biocore / redbiom

Sample search by metadata and features
Other
44 stars 20 forks source link

Pull down based on sample id #72

Closed jwdebelius closed 5 years ago

jwdebelius commented 5 years ago

Redbiom already has support pulling down by specific features. I'd like to be able to do a command-line based pull down of a set of sample IDs. I tried passing a list of survey ids but I can only run two queries at a time. ...This is possible to script, but painful.

Im wondering if there's an additional "search" functionality that could be added to pull down by sample ID.

The context is that I've got additional metadata not in Qiita, but would like to be able to pull down a set of samples that I've pre-selected from the database. (i.e. samples processed through AG linked to an externally hosted survey where I want a subset but can't, for IRB reasons, submit them to Qiita). Selecting them manually out of qiita is tedious and error prone, processing the full AG table is - to put it politely - either expensive or stalled.

jwdebelius commented 5 years ago

I apologise, I did a little bit of reading and realise this is already possible. Maybe worth adding a line in the documentation page (although TBH, I rarely read that well enough either?)

wasade commented 5 years ago

Is there a suggested change? Note that the readme already states that sample data can be retrieved. It is implied this is done by sample ID as I'm not really sure how else you'd do it...?

Redbiom is a cache service for sample metadata and sample data. It allows for rapidly:

* finding samples by the features they contain
* finding samples by arbitrary metadata searches
* summarizing samples over metadata
* retrieval of sample data into BIOM
* discovering metadata categories
* pulling out sample data from different processing types (e.g., search over 16S, retrieve WGS)
jwdebelius commented 5 years ago

Really sorry about opening this. I spent about two hours trying to figure that part out (command line and Qiita explicitly) and ended up trying to hack it. Literally, I think I needed to see a line that said, "save to a file, and pass". Like, you show the example of piping but maybe a couple of lines that say something like,

You can also pass in a file with sample IDs to retrieve data directly.

redbiom search metadata cider > cider.txt
redbiom fetch samples --file ./cider.txt --context $ctx --output cider.biom
wasade commented 5 years ago

:+1:, want to open a PR for a change to the readme?

On Thu, Feb 7, 2019 at 10:31 AM Justine Debelius notifications@github.com wrote:

Really sorry about opening this. I spent about two hours trying to figure that part out (command line and Qiita explicitly) and ended up trying to hack it. Literally, I think I needed to see a line that said, "save to a file, and pass". Like, you show the example of piping but maybe a couple of lines that say something like,

"You can also pass in a file with IDs to retrieve.

redbiom search metadata cider > cider.txt redbiom fetch samples --file ./cider.txt --context $ctx --output cider.biom

"

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/biocore/redbiom/issues/72#issuecomment-461543765, or mute the thread https://github.com/notifications/unsubscribe-auth/AAc8sgRwS8jYgmakqNODJQDlXDnvrgHNks5vLHD7gaJpZM4anZbV .