pathway_pipeline.py - KeyError: 'Sample-Name'

37 views
Skip to first unread message

Afrina Ad

unread,
Jan 27, 2020, 9:02:58 PM1/27/20
to picrust-users
Hi all,

I am trying to run the code below to get the output as shown in the tutorial but I keep getting key error with the sample name eventhough my file has the same format/column as in the tutorial.
pathway_pipeline.py -i EC_metagenome_out/pred_metagenome_contrib.tsv.gz --no_regroup -o pathways_out -p 1

This is the error that I got:
Traceback (most recent call last):
 
File "/home/customercare/miniconda3/envs/picrust2/bin/pathway_pipeline.py", line 272, in <module>
    main
()
 
File "/home/customercare/miniconda3/envs/picrust2/bin/pathway_pipeline.py", line 210, in main
    verbose
=args.verbose)
 
File "/home/customercare/miniconda3/envs/picrust2/lib/python3.6/site-packages/picrust2/pathway_pipeline.py", line 398, in pathway_pipeline
   
for sample_id in samples)
 
File "/home/customercare/miniconda3/envs/picrust2/lib/python3.6/site-packages/joblib/parallel.py", line 1017, in __call__
   
self.retrieve()
 
File "/home/customercare/miniconda3/envs/picrust2/lib/python3.6/site-packages/joblib/parallel.py", line 909, in retrieve
   
self._output.extend(job.get(timeout=self.timeout))
 
File "/home/customercare/miniconda3/envs/picrust2/lib/python3.6/site-packages/joblib/_parallel_backends.py", line 562, in wrap_future_result
   
return future.result(timeout=timeout)
 
File "/home/customercare/miniconda3/envs/picrust2/lib/python3.6/concurrent/futures/_base.py", line 432, in result
   
return self.__get_result()
 
File "/home/customercare/miniconda3/envs/picrust2/lib/python3.6/concurrent/futures/_base.py", line 384, in __get_result
   
raise self._exception
KeyError: 'G25Wk16'


Can anyone point out which part should I edit? Or is it because my pred_metagenome_contrib.tsv.gz is too big (9 Gb)?

Gavin Douglas

unread,
Jan 28, 2020, 8:27:01 AM1/28/20
to picrus...@googlegroups.com
Hey there,

How many samples do you have and would you mind sharing the head of the input file?


Thanks,

Gavin

--
You received this message because you are subscribed to the Google Groups "picrust-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to picrust-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/picrust-users/095f93e0-b6c3-4d0a-8de6-6aa26fdb43bc%40googlegroups.com.

Afrina Ad

unread,
Jan 28, 2020, 8:43:55 PM1/28/20
to picrust-users
I have about 300+ samples which then produced about 100+ m rows in my pred_metagenome_contrib.tsv.gz.

Here is the head of the input file:

sample    function    taxon      taxon_abun   taxon_rel_abun      genome_function_count  taxon_function_abun  taxon_rel_function_abun
G25Wk16   EC
:1.1.1.1  OTU_1      830.0        3.931059633701022      2                   1660.0               7.862119267402044
G25Wk16   EC
:1.1.1.1  OTU_10     359.0        1.7003016969863456     2                   718.0                3.400603393972691
G25Wk16   EC
:1.1.1.1  OTU_1002   3.0          0.01420864927843743    2                   6.0                  0.02841729855687486
Gavin

To unsubscribe from this group and stop receiving emails from it, send an email to picrus...@googlegroups.com.

Gavin Douglas

unread,
Jan 29, 2020, 9:45:14 AM1/29/20
to picrus...@googlegroups.com
Hey again,

I think the issue is that when you’re using the —no_regroup option that the tool is unable to identify any pathways as present and is returning an empty object. I’ll be sure to make the tool throw a warning and end gracefully in these cases for a future release.

In the meantime, you actually need to use the “—no_regroup” option if you’re using the default pathway inference pipeline - this option prevents the EC numbers from being regrouped to MetaCyc reactions, which is necessary for inferring the MetaCyc pathways. 


Best,

Gavin

To unsubscribe from this group and stop receiving emails from it, send an email to picrust-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/picrust-users/1eab4c99-a1b7-4683-be61-00be3586dd9d%40googlegroups.com.

Reply all
Reply to author
Forward
0 new messages