Repository 'biom_convert'
hg clone https://toolshed.g2.bx.psu.edu/repos/iuc/biom_convert

Changeset 0:501c21cce614 (2016-06-07)
Next changeset 1:0de92f0b96ef (2019-09-11)
Commit message:
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/biom_format commit 01bf97e10e5491ec878cca24495d8125449dfc1e
added:
biom_convert.xml
macros.xml
test-data/input_abundance_1.biom1
test-data/input_abundance_1.tabular
test-data/input_abundance_taxonomy_1.tabular
test-data/input_taxonomy_1.tabular
test-data/output_1.biom1.re
test-data/output_taxonomy_1.biom1.re
b
diff -r 000000000000 -r 501c21cce614 biom_convert.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/biom_convert.xml Tue Jun 07 17:26:00 2016 -0400
[
b'@@ -0,0 +1,182 @@\n+<tool id="biom_convert" name="Convert BIOM" version="@VERSION@.0">\n+    <description>formats</description>\n+    <macros>\n+        <import>macros.xml</import>\n+    </macros>\n+    <expand macro="requirements" />\n+    <expand macro="stdio" />\n+    <expand macro="version_command" />\n+    <command>\n+        <![CDATA[\n+            biom convert -i "${input_type.input_table}" -o "${output_table}"\n+            #if str( $input_type.input_type_selector ) == "tsv": \n+                #if $input_type.process_obs_metadata:\n+                    --process-obs-metadata "${input_type.process_obs_metadata}"\n+                #end if\n+            #end if\n+\n+            #if str( $output_type.output_type_selector ) == "tsv": \n+                --to-tsv\n+                #if $output_type.header_key:\n+                    --header-key "${output_type.header_key}"\n+                    #if $output_type.output_metadata_id:\n+                        --output-metadata-id "${output_type.output_metadata_id}"\n+                    #end if\n+                    --tsv-metadata-formatter "${output_type.tsv_metadata_formatter}"\n+                #end if\n+            #else:\n+                --table-type "${output_type.table_type}"\n+                #if str( $output_type.biom_type.biom_type_selector ) == \'hdf5\':\n+                    --to-hdf5\n+                    ${output_type.biom_type.collapsed_samples}\n+                    ${output_type.biom_type.collapsed_observations}\n+                #else:\n+                    --to-json\n+                #end if\n+                #if $output_type.sample_metadata_fp:\n+                    --sample-metadata-fp "${output_type.sample_metadata_fp}"\n+                #end if\n+                #if $output_type.observation_metadata_fp:\n+                    --observation-metadata-fp "${output_type.observation_metadata_fp}"\n+                #end if\n+            #end if   \n+        ]]>\n+    </command>\n+    <inputs>\n+        <conditional name="input_type">\n+            <param name="input_type_selector" type="select" label="Choose the source BIOM format">\n+                <option value="tsv" selected="True">Tabular File</option>\n+                <option value="biom">BIOM File</option>\n+            </param>\n+            <when value="tsv">\n+                <param name="input_table" type="data" format="tabular" label="Tabular File" argument="--input-fp"/>\n+                <param name="process_obs_metadata" type="select" label="Process metadata associated with observations when converting" argument="--process-obs-metadata">\n+                    <option value="" selected="True">Do Not process metadata</option>\n+                    <option value="taxonomy">taxonomy</option>\n+                    <option value="naive">naive</option>\n+                    <option value="sc_separated">sc_separated</option>\n+                </param>\n+            </when>\n+            <when value="biom">\n+                <param name="input_table" type="data" format="biom1" label="Tabular File" argument="--input-fp"/>\n+            </when>\n+        </conditional>\n+        <conditional name="output_type">\n+            <param name="output_type_selector" type="select" label="Choose the output type" argument="--to-tsv">\n+                <option value="tsv">TSV-formatted (classic) table</option>\n+                <option value="biom" selected="True">BIOM</option>\n+            </param>\n+            <when value="tsv">\n+                <param name="header_key" type="text" value="" label="observation metadata to include" help="Leave empty to ignore" argument="--header-key"/>\n+                <param name="output_metadata_id" type="text" value="" label="name to be given to the observation metadata column" help="Leave empty to ignore" argument="--output-metadata-id"/>\n+                <param name="tsv_metadata_formatter" type="select" label="Method for formatting the observation metadata" argumet="--tsv-metadata-formatter">\n+                    <option value="naive" selected="T'..b'<conditional name="input_type">\n+                <param name="input_type_selector" value="tsv"/>\n+                <param name="input_table" value="input_abundance_taxonomy_1.tabular" ftype="tabular"/>\n+                <param name="process_obs_metadata" value="taxonomy"/>\n+            </conditional>\n+            <conditional name="output_type">\n+                <param name="output_type_selector" value="biom"/>\n+                <param name="table_type" value="OTU table"/>\n+                <conditional name="biom_type">\n+                    <param name="biom_type_selector" value="json"/>\n+                </conditional>\n+                <param name="sample_metadata_fp"/>\n+                <param name="observation_metadata_fp"/>\n+            </conditional>\n+            <output name="output_table" file="output_taxonomy_1.biom1.re" ftype="biom1" compare="re_match"/>\n+        </test>\n+        <test>\n+            <conditional name="input_type">\n+                <param name="input_type_selector" value="tsv"/>\n+                <param name="input_table" value="input_abundance_1.tabular" ftype="tabular"/>\n+                <param name="process_obs_metadata" value=""/>\n+            </conditional>\n+            <conditional name="output_type">\n+                <param name="output_type_selector" value="biom"/>\n+                <param name="table_type" value="OTU table"/>\n+                <conditional name="biom_type">\n+                    <param name="biom_type_selector" value="json"/>\n+                </conditional>\n+                <param name="sample_metadata_fp"/>\n+                <param name="observation_metadata_fp"/>\n+            </conditional>\n+            <output name="output_table" file="output_1.biom1.re" ftype="biom1" compare="re_match"/>\n+        </test>\n+    </tests>\n+    <help><![CDATA[\n+\n+Usage: biom convert [OPTIONS]::\n+\n+  Convert to/from the BIOM table format.\n+\n+  Convert between BIOM table formats. See examples here: http://biom-format.org/documentation/biom_conversion.html\n+\n+  Example usage:\n+\n+  Convert a "classic" BIOM file (tab-separated text) to an HDF5 BIOM formatted OTU table:\n+\n+  $ biom convert -i table.txt -o table.biom --to-hdf5\n+\n+\n+Options:\n+  -i, --input-fp PATH             The input BIOM table  [required]\n+  -o, --output-fp PATH            The output BIOM table  [required]\n+  -m, --sample-metadata-fp PATH   The sample metadata mapping file (will add sample metadata to the input BIOM table, if provided).\n+  --observation-metadata-fp PATH  The observation metadata mapping file (will add observation metadata to the input BIOM table, if provided).\n+  --to-json                       Output as JSON-formatted table.\n+  --to-hdf5                       Output as HDF5-formatted table.\n+  --to-tsv                        Output as TSV-formatted (classic) table. table is a BIOM table with collapsed samples, this will update the sample metadata of the table to the supported HDF5 collapsed format.\n+  --collapsed-observations        If --to_hdf5 is passed and the original table is a BIOM table with collapsed observations, this will update the  supported HDF5 collapsed format.\n+  --header-key TEXT               The observation metadata to include from the input BIOM table file when creating a tsv table file. By default no observation metadata will be included.\n+  --output-metadata-id TEXT       The name to be given to the observation metadata column when creating a tsv table file if the column should be renamed.\n+  --table-type                    OTU table,Pathway table,Function table,Ortholog table,Gene table,Metabolite table,Taxon table,Table The type of the table.\n+  --process-obs-metadata          taxonomy,naive,sc_separated Process metadata associated with observations when converting from a classic table.\n+  --tsv-metadata-formatter        naive,sc_separated Method for formatting the observation \n+  --help                          Show this message and exit.\n+\n+    ]]></help>\n+    <expand macro="citations" />\n+</tool>\n'
b
diff -r 000000000000 -r 501c21cce614 macros.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/macros.xml Tue Jun 07 17:26:00 2016 -0400
b
@@ -0,0 +1,24 @@
+<macros>
+    <xml name="requirements">
+        <requirements>
+            <requirement type="package" version="2.1.5">biom-format</requirement>
+            <yield/>
+        </requirements>
+    </xml>
+    <token name="@VERSION@">2.1.5</token>
+    <xml name="stdio">
+        <stdio>
+            <exit_code range="1:" />
+            <exit_code range=":-1" />
+        </stdio>
+    </xml>
+    <xml name="version_command">
+        <version_command>biom --version</version_command>
+    </xml>
+    <xml name="citations">
+        <citations>
+            <citation type="doi">10.1186/2047-217X-1-7</citation>
+            <yield/>
+        </citations>
+    </xml>
+</macros>
b
diff -r 000000000000 -r 501c21cce614 test-data/input_abundance_1.biom1
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/input_abundance_1.biom1 Tue Jun 07 17:26:00 2016 -0400
[
@@ -0,0 +1,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-26T17:20:40.263567","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": null},{"id": "3", "metadata": null},{"id": "4", "metadata": null},{"id": "5", "metadata": null},{"id": "8", "metadata": null},{"id": "9", "metadata": null},{"id": "10", "metadata": null},{"id": "11", "metadata": null},{"id": "12", "metadata": null},{"id": "14", "metadata": null},{"id": "15", "metadata": null},{"id": "16", "metadata": null},{"id": "17", "metadata": null},{"id": "18", "metadata": null},{"id": "22", "metadata": null},{"id": "23", "metadata": null},{"id": "25", "metadata": null},{"id": "28", "metadata": null},{"id": "29", "metadata": null}],"columns": [{"id": "SAMPLE_1", "metadata": null},{"id": "SAMPLE_2", "metadata": null}]}
\ No newline at end of file
b
diff -r 000000000000 -r 501c21cce614 test-data/input_abundance_1.tabular
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/input_abundance_1.tabular Tue Jun 07 17:26:00 2016 -0400
b
@@ -0,0 +1,20 @@
+#ID SAMPLE_1 SAMPLE_2
+2 0 0
+3 160 242
+4 0 0
+5 0 0
+8 0 0
+9 0 0
+10 1 1
+11 3 4
+12 0 0
+14 0 0
+15 0 0
+16 0 0
+17 13 36
+18 0 0
+22 1 5
+23 1 0
+25 1 3
+28 0 0
+29 0 0
b
diff -r 000000000000 -r 501c21cce614 test-data/input_abundance_taxonomy_1.tabular
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/input_abundance_taxonomy_1.tabular Tue Jun 07 17:26:00 2016 -0400
b
@@ -0,0 +1,20 @@
+#ID SAMPLE_1 SAMPLE_2 taxonomy
+2 0 0 d__Archaea
+3 160 242 d__Bacteria
+4 0 0 d__Archaea;p__Crenarchaeota
+5 0 0 d__Archaea;p__Euryarchaeota
+8 0 0 d__Bacteria;p__AC1
+9 0 0 d__Bacteria;p__AD3
+10 1 1 d__Bacteria;p__Acidobacteria
+11 3 4 d__Bacteria;p__Actinobacteria
+12 0 0 d__Bacteria;p__AncK6
+14 0 0 d__Bacteria;p__Armatimonadetes
+15 0 0 d__Bacteria;p__BHI80-139
+16 0 0 d__Bacteria;p__BRC1
+17 13 36 d__Bacteria;p__Bacteroidetes
+18 0 0 d__Bacteria;p__CD12
+22 1 5 d__Bacteria;p__Chlorobi
+23 1 0 d__Bacteria;p__Chloroflexi
+25 1 3 d__Bacteria;p__Cyanobacteria
+28 0 0 d__Bacteria;p__EM19
+29 0 0 d__Bacteria;p__EM3
b
diff -r 000000000000 -r 501c21cce614 test-data/input_taxonomy_1.tabular
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/input_taxonomy_1.tabular Tue Jun 07 17:26:00 2016 -0400
b
@@ -0,0 +1,20 @@
+#ID taxonomy
+2 d__Archaea
+3 d__Bacteria
+4 d__Archaea;p__Crenarchaeota
+5 d__Archaea;p__Euryarchaeota
+8 d__Bacteria;p__AC1
+9 d__Bacteria;p__AD3
+10 d__Bacteria;p__Acidobacteria
+11 d__Bacteria;p__Actinobacteria
+12 d__Bacteria;p__AncK6
+14 d__Bacteria;p__Armatimonadetes
+15 d__Bacteria;p__BHI80-139
+16 d__Bacteria;p__BRC1
+17 d__Bacteria;p__Bacteroidetes
+18 d__Bacteria;p__CD12
+22 d__Bacteria;p__Chlorobi
+23 d__Bacteria;p__Chloroflexi
+25 d__Bacteria;p__Cyanobacteria
+28 d__Bacteria;p__EM19
+29 d__Bacteria;p__EM3
b
diff -r 000000000000 -r 501c21cce614 test-data/output_1.biom1.re
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/output_1.biom1.re Tue Jun 07 17:26:00 2016 -0400
[
@@ -0,0 +1,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\"\:\ \".*\"\,\"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\"\:\ null\}\,\{\"id\"\:\ \"3\"\,\ \"metadata\"\:\ null\}\,\{\"id\"\:\ \"4\"\,\ \"metadata\"\:\ null\}\,\{\"id\"\:\ \"5\"\,\ \"metadata\"\:\ null\}\,\{\"id\"\:\ \"8\"\,\ \"metadata\"\:\ null\}\,\{\"id\"\:\ \"9\"\,\ \"metadata\"\:\ null\}\,\{\"id\"\:\ \"10\"\,\ \"metadata\"\:\ null\}\,\{\"id\"\:\ \"11\"\,\ \"metadata\"\:\ null\}\,\{\"id\"\:\ \"12\"\,\ \"metadata\"\:\ null\}\,\{\"id\"\:\ \"14\"\,\ \"metadata\"\:\ null\}\,\{\"id\"\:\ \"15\"\,\ \"metadata\"\:\ null\}\,\{\"id\"\:\ \"16\"\,\ \"metadata\"\:\ null\}\,\{\"id\"\:\ \"17\"\,\ \"metadata\"\:\ null\}\,\{\"id\"\:\ \"18\"\,\ \"metadata\"\:\ null\}\,\{\"id\"\:\ \"22\"\,\ \"metadata\"\:\ null\}\,\{\"id\"\:\ \"23\"\,\ \"metadata\"\:\ null\}\,\{\"id\"\:\ \"25\"\,\ \"metadata\"\:\ null\}\,\{\"id\"\:\ \"28\"\,\ \"metadata\"\:\ null\}\,\{\"id\"\:\ \"29\"\,\ \"metadata\"\:\ null\}\]\,\"columns\"\:\ \[\{\"id\"\:\ \"SAMPLE\_1\"\,\ \"metadata\"\:\ null\}\,\{\"id\"\:\ \"SAMPLE\_2\"\,\ \"metadata\"\:\ null\}\]\}
b
diff -r 000000000000 -r 501c21cce614 test-data/output_taxonomy_1.biom1.re
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/output_taxonomy_1.biom1.re Tue Jun 07 17:26:00 2016 -0400
[
@@ -0,0 +1,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\"\:\ \".*\"\,\"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\}\]\}