Python APIs alpha87  2014-10-01 14:53
Status: Closed
 
Wondering if the following pipeline using Python APIs is possible:

1 - load a bunch of different .xls files in different assays, stored in subfolders (MainFolder/Subfolder1, MainFolder/SubFolder2, etc). Ideally, we want to keep previous runs, so we should create a new run, and upload the data in this new run.
2 - publish these data to a common study folder, deleting the previously published ones.

I'm worried about all the foreign keys that certainly LabKey creates when doing the pipeline above via the web interface.

We may also think to implement this in R, if the APIs are better.

Thank you!
 
 
jeckels responded:  2014-10-02 13:55
Hello,

1. We do have an API for this, but not a Python client-side binding at this time. This will handle inserting into all of the various tables, maintaining the FKs, etc. The R version is labkey.saveBatch(). The JavaScript version is LABKEY.Experiment.saveBatch(), as documented here: https://www.labkey.org/download/clientapi_docs/javascript-api/symbols/LABKEY.Experiment.html#.saveBatch. It would be reasonably straightforward to create a Python binding for this same underlying HTTP/JSON API.

2. Unfortunately, we don't have an API in any of our supported client languages that performs a copy-to-study operation. It would be possible to create the POST that the UI does when a user performs this operation, though we don't encourage this approach as it's subject to breaking in future versions.

We'd also be happy to discuss extending our client API support if you'd be interested in a proposal for this work.

Thanks,
Josh
 
alpha87 responded:  2014-10-03 03:21
Hi Josh,

thanks for your answer!

We'll implement in R, then! However, lack of a copy-to-study API greatly decreases the script usefulness, so we may just decide to abandon it.

What do you mean by "proposal for this work"? Unfortunately, we do not have any funds to sponsor LabKey development. However, if we can support you in any other way, let us know!
 
jeckels responded:  2014-10-03 09:23
At the moment, API support for copying assay data to a study isn't on planned and scheduled feature list, but knowing that there are users (with or without funding) does help us prioritize it.

It may not fit your desired workflow, but there is an option to automatically copy assay data to a study if it already contains participant and timepoint information. It's configured in the assay designer. This means that there's no explicit review step, but it might suit your needs.

Thanks,
Josh