biocore / redbiom

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

ran the example, got following errors. #99

Closed hotblast closed 4 years ago

hotblast commented 4 years ago

Hi, there, I ran your example and got following errors. Any idea? thanks, Gary

(base) pn1933734:~ garyxie$ redbiom search metadata beer | head 11366.14HM08.M.4 11366.14HM309.M.1 11366.14HM403.M.1 11366.14HM551.M.1 11366.14HM177.M.1 11366.14HM428.M.2 11366.14HM349.M.2 11366.14HM480.M.1 11366.14HM487.M.2 11366.14HM536.M.1 (base) pn1933734:~ garyxie$ redbiom search metadata beer | wc -l 416 (base) pn1933734:~ garyxie$ redbiom summarize contexts | cut -f 1,2,3 | grep 16S-v4 | grep Greengenes-illumina | sort -k 2 -n (base) pn1933734:~ garyxie$ redbiom summarize contexts | head -n 1 ContextName SamplesWithData FeaturesWithData Description (base) pn1933734:~ garyxie$ export ctx=Pick_closed-reference_OTUs-Greengenes-illumina-16S-v4-5c6506 (base) pn1933734:~ garyxie$ redbiom search metadata beer | redbiom fetch samples --context $ctx --output example.biom Traceback (most recent call last): File "/Users/garyxie/opt/anaconda3/bin/redbiom", line 10, in sys.exit(cli()) File "/Users/garyxie/opt/anaconda3/lib/python3.7/site-packages/click/core.py", line 764, in call return self.main(args, kwargs) File "/Users/garyxie/opt/anaconda3/lib/python3.7/site-packages/click/core.py", line 717, in main rv = self.invoke(ctx) File "/Users/garyxie/opt/anaconda3/lib/python3.7/site-packages/click/core.py", line 1137, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "/Users/garyxie/opt/anaconda3/lib/python3.7/site-packages/click/core.py", line 1137, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "/Users/garyxie/opt/anaconda3/lib/python3.7/site-packages/click/core.py", line 956, in invoke return ctx.invoke(self.callback, ctx.params) File "/Users/garyxie/opt/anaconda3/lib/python3.7/site-packages/click/core.py", line 555, in invoke return callback(args, **kwargs) File "/Users/garyxie/opt/anaconda3/lib/python3.7/site-packages/redbiom/commands/fetch.py", line 194, in fetch_samples_from_samples table, ambig = redbiom.fetch.data_from_samples(context, iterable) File "/Users/garyxie/opt/anaconda3/lib/python3.7/site-packages/redbiom/fetch.py", line 299, in data_from_samples return _biom_from_samples(context, samples) File "/Users/garyxie/opt/anaconda3/lib/python3.7/site-packages/redbiom/fetch.py", line 343, in _biom_from_samples redbiom._requests.valid(context, get) File "/Users/garyxie/opt/anaconda3/lib/python3.7/site-packages/redbiom/_requests.py", line 179, in valid raise ValueError("Unknown context: %s" % context) ValueError: Unknown context: Pick_closed-reference_OTUs-Greengenes-illumina-16S-v4-5c6506 (base) pn1933734:~ garyxie$ biom summarize-table -i example.biom | head Usage: biom summarize-table [OPTIONS] Try "biom summarize-table -h" for help.

Error: Invalid value for "-i" / "--input-fp": File "example.biom" does not exist. (base) pn1933734:~ garyxie$ redbiom search metadata beer | redbiom fetch sample-metadata --output example.txt --context $ctx Traceback (most recent call last): File "/Users/garyxie/opt/anaconda3/bin/redbiom", line 10, in sys.exit(cli()) File "/Users/garyxie/opt/anaconda3/lib/python3.7/site-packages/click/core.py", line 764, in call return self.main(args, kwargs) File "/Users/garyxie/opt/anaconda3/lib/python3.7/site-packages/click/core.py", line 717, in main rv = self.invoke(ctx) File "/Users/garyxie/opt/anaconda3/lib/python3.7/site-packages/click/core.py", line 1137, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "/Users/garyxie/opt/anaconda3/lib/python3.7/site-packages/click/core.py", line 1137, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "/Users/garyxie/opt/anaconda3/lib/python3.7/site-packages/click/core.py", line 956, in invoke return ctx.invoke(self.callback, ctx.params) File "/Users/garyxie/opt/anaconda3/lib/python3.7/site-packages/click/core.py", line 555, in invoke return callback(args, **kwargs) File "/Users/garyxie/opt/anaconda3/lib/python3.7/site-packages/redbiom/commands/fetch.py", line 94, in fetch_sample_metadata tagged=tagged) File "/Users/garyxie/opt/anaconda3/lib/python3.7/site-packages/redbiom/fetch.py", line 192, in sample_metadata raise ValueError("None of the samples were found in the context") ValueError: None of the samples were found in the context

wasade commented 4 years ago

Thanks, @hotblast! It looks like the context name has changed since the readme was written (note the capital V in the below):

(qiime2-2020.6) 11:18:11 (dtmcdonald@here):~$ ctx=Pick_closed-reference_OTUs-Greengenes-Illumina-16S-V4-5c6506
(qiime2-2020.6) 11:18:35 (dtmcdonald@here):~$ redbiom search metadata beer | redbiom fetch samples --context $ctx --output example.biom
(qiime2-2020.6) 11:19:51 (dtmcdonald@here):~$ biom summarize-table -i example.biom | head
Num samples: 203
Num observations: 5,265
Total count: 5,187,346
Table density (fraction of non-zero values): 0.026

Counts/sample summary:
 Min: 1.000
 Max: 208,223.000
 Median: 11,172.000
 Mean: 25,553.429

I'll update the readme right now.

wasade commented 4 years ago

Ah, the readme is a little more out of date than just the capital V...

hotblast commented 4 years ago

Hi, Daniel Thanks for quick response. If I want to search all samples that have been amplicon sequenced ( such as ITS, LSU) and GPS location documented ( latitude, longitude, and elevation), what query line should I used? Thanks, Gary

From: Daniel McDonald notifications@github.com Reply-To: biocore/redbiom reply@reply.github.com Date: Wednesday, August 19, 2020 at 12:21 PM To: biocore/redbiom redbiom@noreply.github.com Cc: Gang Xie xie@lanl.gov, Mention mention@noreply.github.com Subject: [EXTERNAL] Re: [biocore/redbiom] ran the example, got following errors. (#99)

Thanks, @hotblasthttps://github.com/hotblast! It looks like the context name has changed since the readme was written (note the capital V in the below):

(qiime2-2020.6) 11:18:11 (dtmcdonald@here):~$ ctx=Pick_closed-reference_OTUs-Greengenes-Illumina-16S-V4-5c6506

(qiime2-2020.6) 11:18:35 (dtmcdonald@here):~$ redbiom search metadata beer | redbiom fetch samples --context $ctx --output example.biom

(qiime2-2020.6) 11:19:51 (dtmcdonald@here):~$ biom summarize-table -i example.biom | head

Num samples: 203

Num observations: 5,265

Total count: 5,187,346

Table density (fraction of non-zero values): 0.026

Counts/sample summary:

Min: 1.000

Max: 208,223.000

Median: 11,172.000

Mean: 25,553.429

I'll update the readme right now.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/biocore/redbiom/issues/99#issuecomment-676585511, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AETLJXZW545W7SO7RBJ7UELSBQJ2JANCNFSM4QFGMAGA.

wasade commented 4 years ago

It may suffice to do redbiom search metadata "where latitude is not None and longitude is not None"

wasade commented 4 years ago

...readme updated, thanks again @hotblast!