Skip to content

Commit

Permalink
Add test for failing handling of BIOM1 metadata.
Browse files Browse the repository at this point in the history
  • Loading branch information
blankenberg committed Jun 7, 2016
1 parent edca79a commit 42739c8
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 1 deletion.
11 changes: 11 additions & 0 deletions test-data/biom1_metadata_test.txt
@@ -0,0 +1,11 @@
table_rows: __ob__u__sq__2__sq__, u__sq__3__sq__, u__sq__4__sq__, u__sq__5__sq__, u__sq__8__sq__, u__sq__9__sq__, u__sq__10__sq__, u__sq__11__sq__, u__sq__12__sq__, u__sq__14__sq__, u__sq__15__sq__, u__sq__16__sq__, u__sq__17__sq__, u__sq__18__sq__, u__sq__22__sq__, u__sq__23__sq__, u__sq__25__sq__, u__sq__28__sq__, u__sq__29__sq____cb__
table_matrix_element_type: float
table_format: Biological Observation Matrix 1.0.0
table_generated_by: BIOM-Format 2.1.5
table_matrix_type: sparse
table_shape: __ob__19, 2__cb__
table_format_url: http://biom-format.org
table_date: 2016-05-26T16:43:45.614267
table_type: OTU table
table_id: None
table_columns: __ob__u__sq__SAMPLE_1__sq__, u__sq__SAMPLE_2__sq____cb__
1 change: 1 addition & 0 deletions test-data/input_taxonomy.biom1
@@ -0,0 +1 @@
{"id": "None","format": "Biological Observation Matrix 1.0.0","format_url": "http://biom-format.org","matrix_type": "sparse","generated_by": "BIOM-Format 2.1.5","date": "2016-05-26T16:43:45.614267","type": "OTU table","matrix_element_type": "float","shape": [19, 2],"data": [[1,0,160.0],[1,1,242.0],[6,0,1.0],[6,1,1.0],[7,0,3.0],[7,1,4.0],[12,0,13.0],[12,1,36.0],[14,0,1.0],[14,1,5.0],[15,0,1.0],[16,0,1.0],[16,1,3.0]],"rows": [{"id": "2", "metadata": {"taxonomy": ["d__Archaea"]}},{"id": "3", "metadata": {"taxonomy": ["d__Bacteria"]}},{"id": "4", "metadata": {"taxonomy": ["d__Archaea", "p__Crenarchaeota"]}},{"id": "5", "metadata": {"taxonomy": ["d__Archaea", "p__Euryarchaeota"]}},{"id": "8", "metadata": {"taxonomy": ["d__Bacteria", "p__AC1"]}},{"id": "9", "metadata": {"taxonomy": ["d__Bacteria", "p__AD3"]}},{"id": "10", "metadata": {"taxonomy": ["d__Bacteria", "p__Acidobacteria"]}},{"id": "11", "metadata": {"taxonomy": ["d__Bacteria", "p__Actinobacteria"]}},{"id": "12", "metadata": {"taxonomy": ["d__Bacteria", "p__AncK6"]}},{"id": "14", "metadata": {"taxonomy": ["d__Bacteria", "p__Armatimonadetes"]}},{"id": "15", "metadata": {"taxonomy": ["d__Bacteria", "p__BHI80-139"]}},{"id": "16", "metadata": {"taxonomy": ["d__Bacteria", "p__BRC1"]}},{"id": "17", "metadata": {"taxonomy": ["d__Bacteria", "p__Bacteroidetes"]}},{"id": "18", "metadata": {"taxonomy": ["d__Bacteria", "p__CD12"]}},{"id": "22", "metadata": {"taxonomy": ["d__Bacteria", "p__Chlorobi"]}},{"id": "23", "metadata": {"taxonomy": ["d__Bacteria", "p__Chloroflexi"]}},{"id": "25", "metadata": {"taxonomy": ["d__Bacteria", "p__Cyanobacteria"]}},{"id": "28", "metadata": {"taxonomy": ["d__Bacteria", "p__EM19"]}},{"id": "29", "metadata": {"taxonomy": ["d__Bacteria", "p__EM3"]}}],"columns": [{"id": "SAMPLE_1", "metadata": null},{"id": "SAMPLE_2", "metadata": null}]}
28 changes: 28 additions & 0 deletions test/functional/tools/metadata_biom1.xml
@@ -0,0 +1,28 @@
<tool id="metadata_biom1" name="metadata_BIOM1" version="1.0.0">
<command>cp "${input_metadata_values}" "${output_of_input_metadata}"</command>
<configfiles>
<configfile name="input_metadata_values">table_rows: ${input_biom1.metadata.table_rows}
table_matrix_element_type: ${input_biom1.metadata.table_matrix_element_type}
table_format: ${input_biom1.metadata.table_format}
table_generated_by: ${input_biom1.metadata.table_generated_by}
table_matrix_type: ${input_biom1.metadata.table_matrix_type}
table_shape: ${input_biom1.metadata.table_shape}
table_format_url: ${input_biom1.metadata.table_format_url}
table_date: ${input_biom1.metadata.table_date}
table_type: ${input_biom1.metadata.table_type}
table_id: ${input_biom1.metadata.table_id}
table_columns: ${input_biom1.metadata.table_columns}</configfile>
</configfiles>
<inputs>
<param name="input_biom1" type="data" format="biom1" label="BIOM1 File"/>
</inputs>
<outputs>
<data format="txt" name="output_of_input_metadata" />
</outputs>
<tests>
<test>
<param name="input_biom1" value="input_taxonomy.biom1" ftype="biom1" />
<output name="output_of_input_metadata" ftype="txt" file="biom1_metadata_test.txt"/>
</test>
</tests>
</tool>
3 changes: 2 additions & 1 deletion test/functional/tools/sample_datatypes_conf.xml
Expand Up @@ -13,5 +13,6 @@
<datatype extension="sam" type="galaxy.datatypes.tabular:Sam" display_in_upload="true" />
<datatype extension="bam" type="galaxy.datatypes.binary:Bam" mimetype="application/octet-stream" display_in_upload="true" description="A binary file compressed in the BGZF format with a '.bam' file extension." description_url="https://wiki.galaxyproject.org/Learn/Datatypes#BAM" />
<datatype extension="bcf" type="galaxy.datatypes.binary:Bcf" mimetype="application/octet-stream" display_in_upload="true" description="A binary file compressed in the BGZF format with a '.bcf' file extension." description_url="https://wiki.galaxyproject.org/Learn/Datatypes#BCF" />
<datatype extension="biom1" type="galaxy.datatypes.text:Biom1" display_in_upload="True" subclass="True" mimetype="application/json"/>
</registration>
</datatypes>
</datatypes>
1 change: 1 addition & 0 deletions test/functional/tools/samples_tool_conf.xml
Expand Up @@ -23,6 +23,7 @@
<tool file="metadata.xml" />
<tool file="metadata_bam.xml" />
<tool file="metadata_bcf.xml" />
<tool file="metadata_biom1.xml" />
<tool file="strict_shell.xml" />
<tool file="strict_shell_default_off.xml" />
<tool file="detect_errors_aggressive.xml" />
Expand Down

0 comments on commit 42739c8

Please sign in to comment.