View Message
Programmatic access to data in Panorama gabe  2016-09-09
 
Hi, I'm wondering where I can find descriptions or documentation on APIs or programmatic access to Skyline data in Panorama. This PDF suggests that APIs exist (page 23) but I can't find any more info anywhere. Thanks Gabe
 
 
vsharma responded:  2016-09-09
Hi Gabe,

The LabKey Server documentation for client APIs is located here:
https://www.labkey.org/home/Documentation/wiki-page.view?name=viewApis

Hopefully, an API exists for the programming language of your choice. If not, you could use the "HTTP interface" and write a wrapper around it.

To query the data you need to be somewhat familiar with the database schema. If you are the administrator of your own LabKey Server installation, or you have admin privileges for a project on PanoramaWeb or your own instance of LabKey Server, you can browse the schema via: Admin > Go To Module > Query. Look at the details of the 'targetedms' schema.

The "SelectRows" API is probably the most useful. Here is an example of getting a list of Skyline documents in a folder using the JavaScript API:

LABKEY.Query.selectRows({
            containerPath: 'path_to_folder, // Folder of interest 
            schemaName: 'targetedms',
            queryName: 'runs', // Name of table that stores an entry for each Skyline document uploaded to the folder
            success: onSuccess,
            failure: onFailure
        });


Please let me know if you have any further questions, or if I can help you with any specific queries.

Thanks,
Vagisha
 
gabe responded:  2016-09-09
Thank you Vagisha -- I'd just found the LabKey API documentation, as well. There is a Perl API (my preferred language) but I'm having trouble connecting it to panoramaweb.org. Here's what I'm trying:
my $results = LabKey::Query::selectRows(
    -baseUrl => 'https://panoramaweb.org',
    -containerPath => 'VividionTx - Biology/Testing1/',
    -schemaName => 'targetedms',
    -queryName => 'replicateannotation',
    );
but I can't get it to connect. Do I need to specify a port? Am I doing something obviously wrong?

I can get the HTTP interface to run a similar query, like this. Also, I should mention that what I'm ultimately trying to do is programmatically access the chromatographs generated for each peptide in a dataset. I'd be happy to link to the panoramaweb.org server, but to do that I'd need to know the id# of the peptide object (using showPeptide.vew?id=###) and I don't know how to find that. Is there an easier way to accomplish this? I'd ideally be able to link from a peptide sequence straight to the appropriate showPeptide page, given a particular project/folder. Thanks Gabe

 
gabe responded:  2016-09-09
I figured-out that I need to use port #9443, like this:
my $results = LabKey::Query::selectRows(
    -baseUrl => 'https://panoramaweb.org:9443/labkey',
    -containerPath => 'VividionTx%20-%20Biology',
    -folderPath => 'Testing1',
    -schemaName => 'targetedms',
    -queryName => 'replicateannotation',
    -queryName => 'Precursor',
    );
but now I'm getting "malformed JSON string" errors. I don't think I'm pointing to my data correctly (some combination of containerPath and folderPath?).
 
vsharma responded:  2016-09-09
I think you only need the containerPath. Did you try this for containerPath - 'VividionTx - Biology/Testing1'? Also, with just a single queryName?