Skip to content

Commit

Permalink
TST: the two tests that can be run pass now. The OTU table had an und…
Browse files Browse the repository at this point in the history
…efined pH for one of the samples, which is invalid for the hdf5 formatter, issue biocore/biom-format#609
  • Loading branch information
wasade committed Mar 7, 2015
1 parent daafc0d commit f3e2571
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"rows": [{"id": "A", "metadata": null}, {"id": "B", "metadata": null}, {"id": "C", "metadata": null}], "format": "Biological Observation Matrix v0.9", "data": [[0, 0, 1.0], [0, 1, 2.0], [0, 2, 3.0], [0, 3, 5.0], [1, 0, 5.0], [1, 1, 1.0], [1, 3, 2.0], [2, 2, 1.0], [2, 3, 4.0]], "columns": [{"id": "Sample1", "metadata": {"pH":7.0}}, {"id": "Sample2", "metadata": {"pH":8.0}}, {"id": "Sample3", "metadata": {"pH":7.0}}, {"id": "Sample4", "metadata": null}],"generated_by": "QIIME 1.4.0-dev, svn revision 2753", "matrix_type": "sparse", "shape": [3, 4], "format_url": "http://www.qiime.org/svn_documentation/documentation/biom_format.html", "date": "2012-02-22T20:50:05.024661", "type": "OTU table", "id": null, "matrix_element_type": "float"}
{"id": "None","format": "Biological Observation Matrix 1.0.0","format_url": "http://biom-format.org","matrix_type": "sparse","generated_by": "picrust","date": "2015-03-07T11:40:42.151151","type": "OTU table","matrix_element_type": "float","shape": [3, 4],"data": [[0,0,1.0],[0,1,2.0],[0,2,3.0],[0,3,5.0],[1,0,5.0],[1,1,1.0],[1,3,2.0],[2,2,1.0],[2,3,4.0]],"rows": [{"id": "A", "metadata": null},{"id": "B", "metadata": null},{"id": "C", "metadata": null}],"columns": [{"id": "Sample1", "metadata": {"pH": 7.0}},{"id": "Sample2", "metadata": {"pH": 8.0}},{"id": "Sample3", "metadata": {"pH": 7.0}},{"id": "Sample4", "metadata": {"pH": NaN}}]}
9 changes: 5 additions & 4 deletions scripts/predict_metagenomes.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,16 @@
script_info = {}
script_info['brief_description'] = "This script produces the actual metagenome functional predictions for a given OTU table."
script_info['script_description'] = ""
script_info['script_usage'] = [("","Predict KO abundances for a given OTU table picked against the newest version of GreenGenes.",\
"%prog -i normalized_otus.biom -o predicted_metagenomes.biom"),
script_info['script_usage'] = [
("","Predict KO abundances for a given OTU table picked against the newest version of GreenGenes.", "%prog -i normalized_otus.biom -o predicted_metagenomes.biom"),
("","Change output format to plain tab-delimited:","%prog -f -i normalized_otus.biom -o predicted_metagenomes.txt"),
("","Predict COG abundances for a given OTU table.","%prog -i normalized_otus.biom -t cog -o cog_predicted_metagenomes.biom"),\
("","Predict RFAM abundances for a given OTU table.","%prog -i normalized_otus.biom -t rfam -o rfam_predicted_metagenomes.biom"),\
("","Output confidence intervals for each prediction.","%prog -i normalized_otus.biom -o predicted_metagenomes.biom --with_confidence"),\
("","Predict metagenomes using a custom trait table in tab-delimited format.","%prog -i otu_table_for_custom_trait_table.biom -c custom_trait_table.tab -o output_metagenome_from_custom_trait_table.biom"),\
("","Predict metagenomes,variances,and 95% confidence intervals for each gene category using a custom trait table in tab-delimited format.","%prog -i otu_table_for_custom_trait_table.biom --input_variance_table custom_trait_table_variances.tab -c custom_trait_table.tab -o output_metagenome_from_custom_trait_table.biom --with_confidence"),\
("","Change the version of GG used to pick OTUs","%prog -i normalized_otus.biom -g 18may2012 -o predicted_metagenomes.biom")]
("","Change the version of GG used to pick OTUs","%prog -i normalized_otus.biom -g 18may2012 -o predicted_metagenomes.biom")
]
script_info['output_description']= "Output is a table of function counts (e.g. KEGG KOs) by sample ids."
script_info['required_options'] = [
make_option('-i','--input_otu_table',type='existing_filepath',help='the input otu table in biom format'),
Expand Down Expand Up @@ -150,7 +151,7 @@ def main():
print "Loading OTU table: ",opts.input_otu_table

otu_table = load_table(opts.input_otu_table)
ids_to_load = otu_table.ids(axis='observation')
ids_to_load = otu_table.ids(axis='observation').tolist()

if opts.verbose:
print "Done loading OTU table containing %i samples and %i OTUs." \
Expand Down

0 comments on commit f3e2571

Please sign in to comment.