picrust/picrust — pull request #64 by zaneveld (2013-01-11 00:13:11+00:00)
Title: Load subset

This pull request addresses issue #58.

-- Abstracts out yield_subset_biom_str and load_subset_from_biom_str from the biom subset loader and puts them in the predict_metagenomes.py library file

-- Adds a script option to predict_metagenomes.py to suppress subset loading. By default, only OTU entries that are needed for metagenome prediction are now loaded.

-- Adds test code to test_predict_metagenomes.py for the new functions

-!!- There appears to be a bug with direct_parse_key in biom where the loaded key gets truncated in some cases where the key contains commas. So one test currently fails due to this. I raised the issue on the biom page. This appears to mostly come up in the 'generated_by' key, so may not interfere with normal operations.

I verified decreaed memory usage/load times on my machine predicting one of the rarified OTU tables for the Fierer dataset from the precalculated KO table, but it would be good if someone else could try it out.

Here's the commandline I used:
predict_metagenomes.py -i rarefaction_10000_0.biom -c ~/Dropbox/picrust_holdouts/picrust_util_files/KEGG_acepic_predict_traits_97.biom -o ../test_load_subset_of_data.biom --verbose