OTU contribution to pathways

466 views
Skip to first unread message

tug8...@temple.edu

unread,
Oct 19, 2016, 11:14:52 AM10/19/16
to picrust-users
Hi everyone, 
I am reposting my question since I did not get a response to it. Is there a way to identify OTU contribution to pathways (collapsed data) instead of individual genes?

Appreciating you help


Regards

Nezar Al-hebshi
Temple University

Jesse Zaneveld

unread,
Oct 19, 2016, 11:31:17 AM10/19/16
to picrus...@googlegroups.com
Hi Nezar,

In the latest metagenome_contributions.py, I added in this functionality.   You can specify a pathway category with the -f option.  This basically just pre-filters data to the specified functional category, prior to running the rest of metagenome_contributions.py

All the best,
Jesse

MacQIIME D-10-156-21-170:procedure $ metagenome_contributions.py --help

Usage: metagenome_contributions.py [options] {-i/--input_otu_table INPUT_OTU_TABLE -o/--output_fp OUTPUT_FP}


[] indicates optional input (order unimportant)

{} indicates required input (order unimportant)




Example usage: 

Print help message and exit

 metagenome_contributions.py -h


Partition the predicted contribution to the  metagenomes from each organism in the given OTU table, limited to only K00001, K00002, and K00004.

 metagenome_contributions.py -i normalized_otus.biom -l K00001,K00002,K00004 -o ko_metagenome_contributions.tab


Partition the predicted contribution to the  metagenomes from each organism in the given OTU table, limited to only COG0001 and COG0002.

 metagenome_contributions.py -i normalized_otus.biom -l COG0001,COG0002 -t cog -o cog_metagenome_contributions.tab


Options:

  --version             show program's version number and exit

  -h, --help            show this help message and exit

  -v, --verbose         Print information during execution -- useful for

                        debugging [default: False]

  -t TYPE_OF_PREDICTION, --type_of_prediction=TYPE_OF_PREDICTION

                        Type of functional predictions. Valid choices are: ko,

                        cog, rfam [default: ko]

  -g GG_VERSION, --gg_version=GG_VERSION

                        Version of GreenGenes that was used for OTU picking.

                        Valid choices are: 13_5, 18may2012 [default: 13_5]

  -c INPUT_COUNT_TABLE, --input_count_table=INPUT_COUNT_TABLE

                        Precalculated function predictions on per otu basis in

                        biom format (can be gzipped). Note: using this option

                        overrides --type_of_prediction and --gg_version.

                        [default: none]

  --suppress_subset_loading

                        Normally, only counts for OTUs present in the sample

                        are loaded.  If this flag is passed, the full biom

                        table is loaded.  This makes no difference for the

                        analysis, but may result in faster load times (at the

                        cost of more memory usage)

  --load_precalc_file_in_biom

                        Instead of loading the precalculated file in tab-

                        delimited format (with otu ids as row ids and traits

                        as columns) load the data in biom format (with otu as

                        SampleIds and traits as ObservationIds) [default:

                        False]

  -f LIMIT_TO_FUNCTIONAL_CATEGORIES, --limit_to_functional_categories=LIMIT_TO_FUNCTIONAL_CATEGORIES

                        If provided only output prediction for functions that

                        match the specified functional category. Multiple

                        categories can be passed as a comma-separated list

                        [default: False]

  -l LIMIT_TO_FUNCTION, --limit_to_function=LIMIT_TO_FUNCTION

                        If provided, only output predictions for the specified

                        function ids.  Multiple function ids can be passed

                        using comma delimiters.


  REQUIRED options:

    The following options must be provided under all circumstances.


    -i INPUT_OTU_TABLE, --input_otu_table=INPUT_OTU_TABLE

                        the input otu table in biom format [REQUIRED]

    -o OUTPUT_FP, --output_fp=OUTPUT_FP

                        the output file for the metagenome contributions

                        [REQUIRED]


--
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-users+unsubscribe@googlegroups.com.
To post to this group, send email to picrus...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

tug8...@temple.edu

unread,
Oct 20, 2016, 12:17:10 PM10/20/16
to picrust-users
HI Jesse, 
Thank you very much for your prompt response. I tried but I get an error message.

This is the command I used:
qiime@qiime-190-virtual-box:~/Desktop/Shared_Folder/picrust-1.1.0/picrust$ metagenome_contributions.py -i NCB.normalized.biom -o NCB.contibutions.tab -f bacterialmotilityproteins

And this is the message I got:

Traceback (most recent call last):
  File "/usr/local/bin/metagenome_contributions.py", line 4, in <module>
    __import__('pkg_resources').run_script('PICRUSt==1.1.0', 'metagenome_contributions.py')
  File "/usr/local/lib/python2.7/dist-packages/setuptools-12.2-py2.7.egg/pkg_resources/__init__.py", line 698, in run_script
    self.require(requires)[0].run_script(script_name, ns)
  File "/usr/local/lib/python2.7/dist-packages/setuptools-12.2-py2.7.egg/pkg_resources/__init__.py", line 1616, in run_script
    exec(code, namespace, namespace)
  File "/usr/local/lib/python2.7/dist-packages/PICRUSt-1.1.0-py2.7.egg/EGG-INFO/scripts/metagenome_contributions.py", line 135, in <module>
    main()
  File "/usr/local/lib/python2.7/dist-packages/PICRUSt-1.1.0-py2.7.egg/EGG-INFO/scripts/metagenome_contributions.py", line 125, in main
    limit_to_functional_categories = ok_functional_categories)
  File "/usr/local/lib/python2.7/dist-packages/PICRUSt-1.1.0-py2.7.egg/picrust/metagenome_contributions.py", line 120, in partition_metagenome_contributions
    genome_table = genome_table.filterObservations(fn_cat_filter)
AttributeError: 'Table' object has no attribute 'filterObservations'

Advice, please?
To unsubscribe from this group and stop receiving emails from it, send an email to picrust-user...@googlegroups.com.

Jesse Zaneveld

unread,
Oct 24, 2016, 4:20:23 PM10/24/16
to picrus...@googlegroups.com
Hi Nezar,

This was a bug, in which PICRUSt did not call the updated filtering functions for the BIOM table object. I have submitted a pull request that fixes this issue in the development branch of PICRUSt.
One additional point:  the specific string you were looking for 'bacterialmotilityproteins' won't be found in the results. Once you update, try 'Bacterial motility proteins' (with spaces), 'Chemotaxis' or another of the KEGG Pathway categories.

Cheers,
Jesse

To unsubscribe from this group and stop receiving emails from it, send an email to picrust-users+unsubscribe@googlegroups.com.

tug8...@temple.edu

unread,
Oct 26, 2016, 9:32:58 AM10/26/16
to picrust-users
Hi Jesse, 
Thank you very much for following this up. I understand that I will have to reinstall an updated version once released, am I right? How will I know once it is? Is there a way to update without uninstalling and reinstalling?
Noted your point about the spaces in pathway name.

Thank you again

Regards

Nezar
Reply all
Reply to author
Forward
0 new messages