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

Changeset 0:367b1ed91207 (2016-06-07)
Next changeset 1:28ad7ac9c193 (2019-09-11)
Commit message:
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/biom_format commit 01bf97e10e5491ec878cca24495d8125449dfc1e
added:
biom_add_metadata.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 367b1ed91207 biom_add_metadata.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/biom_add_metadata.xml Tue Jun 07 17:25:44 2016 -0400
[
@@ -0,0 +1,134 @@
+<tool id="biom_add_metadata" name="BIOM metadata" version="@VERSION@.0">
+    <description>add-metadata</description>
+    <macros>
+        <import>macros.xml</import>
+    </macros>
+    <expand macro="requirements" />
+    <expand macro="stdio" />
+    <expand macro="version_command" />
+    <command>
+        <![CDATA[
+            biom add-metadata 
+                -i "${input_table}"
+                -o "${output_table}"
+                #if $input_sample_metadata:
+                    --sample-metadata-fp "${input_sample_metadata}"
+                #end if
+                #if $input_observation_metadata:
+                    --observation-metadata-fp "${input_observation_metadata}"
+                #end if
+                #if $sc_separated:
+                    --sc-separated "${sc_separated}"
+                #end if
+                #if $sc_pipe_separated:
+                    --sc-pipe-separated "${sc_pipe_separated}"
+                #end if
+                #if $int_fields:
+                    --int-fields "${int_fields}"
+                #end if
+                #if $float_fields:
+                    --float-fields "${float_fields}"
+                #end if
+                #if $sample_header:
+                    --sample-header "${sample_header}"
+                #end if
+                #if $observation_header:
+                    --observation-header "${observation_header}"
+                #end if
+                ${output_as_json}                
+        ]]>
+    </command>
+    <inputs>
+        <param name="input_table" type="data" format="biom1" label="BIOM File" argument="--input-fp"/>
+        <param name="input_sample_metadata" type="data" format="tabular" optional="True" label="Sample Metadata Tabular File" argument="--sample-metadata-fp PATH"/>
+        <param name="input_observation_metadata" type="data" format="tabular" optional="True" label="Observation Metadata Tabular File" argument="--observation-metadata-fp"/>
+        <param name="sc_separated" type="text" value="" label="Comma-separated list of the metadata fields to split on semicolons" argument="--sc-separated"/>
+        <param name="sc_pipe_separated" type="text" value="" label="Comma-separated list of the metadata fields to split on semicolons and pipes (|)" argument="--sc-pipe-separated"/>
+        <param name="int_fields" type="text" value="" label="Comma-separated list of the metadata fields to cast to integers" argument="--int-fields"/>
+        <param name="float_fields" type="text" value="" label="Comma-separated list of the metadata fields to cast to floating point numbers" argument="--float-fields"/>
+        <param name="sample_header" type="text" value="" label="Comma-separated list of the sample metadata field names" argument="--sample-header"/>
+        <param name="observation_header" type="text" value="" label="Comma-separated list of the observation metadata field names" argument="--observation-header"/>
+        <param name="output_as_json" type="boolean" checked="True" truevalue="--output-as-json" falsevalue="" label="Write the output file in JSON format (biom1)" argument="--output-as-json"/>
+    </inputs>
+    <outputs>
+        <data format="biom1" name="output_table">
+            <change_format>
+                <when input="${str( $output_as_json )}" value="" format="biom2" />
+            </change_format>
+        </data>
+    </outputs>
+    <tests>
+        <test>
+            <param name="input_table" value="input_abundance_1.biom1" ftype="biom1"/>
+            <param name="input_observation_metadata" value="input_taxonomy_1.tabular" ftype="tabular"/>
+            <param name="sc_separated" value="taxonomy"/>
+            <param name="input_sample_metadata"/>
+            <param name="sc_pipe_separated" value=""/>
+            <param name="int_fields" value=""/>
+            <param name="float_fields" value=""/>
+            <param name="sample_header" value=""/>
+            <param name="observation_header" value=""/>
+            <param name="output_as_json" value="True"/>
+            <output name="output_table" file="output_taxonomy_1.biom1.re" ftype="biom1" compare="re_match"/>
+        </test>
+    </tests>
+    <help><![CDATA[
+
+Usage: biom add-metadata [OPTIONS]
+
+  Add metadata to a BIOM table.
+
+  Add sample and/or observation metadata to BIOM-formatted files. See
+  examples here: http://biom-format.org/documentation/adding_metadata.html
+
+  Example usage:
+
+  Add sample metadata to a BIOM table:
+
+  $ biom add-metadata -i otu_table.biom -o table_with_sample_metadata.biom
+  -m sample_metadata.txt
+
+Options:
+  -i, --input-fp PATH             The input BIOM table  [required]
+  -o, --output-fp PATH            The output BIOM table  [required]
+  -m, --sample-metadata-fp PATH   The sample metadata mapping file (will add
+                                  sample metadata to the input BIOM table, if
+                                  provided).
+  --observation-metadata-fp PATH  The observation metadata mapping file (will
+                                  add observation metadata to the input BIOM
+                                  table, if provided).
+  --sc-separated TEXT             Comma-separated list of the metadata fields
+                                  to split on semicolons. This is useful for
+                                  hierarchical data such as taxonomy or
+                                  functional categories.
+  --sc-pipe-separated TEXT        Comma-separated list of the metadata fields
+                                  to split on semicolons and pipes ("|"). This
+                                  is useful for hierarchical data such as
+                                  functional categories with one-to-many
+                                  mappings (e.g. x;y;z|x;y;w)).
+  --int-fields TEXT               Comma-separated list of the metadata fields
+                                  to cast to integers. This is useful for
+                                  integer data such as "DaysSinceStart".
+  --float-fields TEXT             Comma-separated list of the metadata fields
+                                  to cast to floating point numbers. This is
+                                  useful for real number data such as "pH".
+  --sample-header TEXT            Comma-separated list of the sample metadata
+                                  field names. This is useful if a header line
+                                  is not provided with the metadata, if you
+                                  want to rename the fields, or if you want to
+                                  include only the first n fields where n is
+                                  the number of entries provided here.
+  --observation-header TEXT       Comma-separated list of the observation
+                                  metadata field names. This is useful if a
+                                  header line is not provided with the
+                                  metadata, if you want to rename the fields,
+                                  or if you want to include only the first n
+                                  fields where n is the number of entries
+                                  provided here.
+  --output-as-json                Write the output file in JSON format.
+  --help                          Show this message and exit.
+
+
+    ]]></help>
+    <expand macro="citations" />
+</tool>
b
diff -r 000000000000 -r 367b1ed91207 macros.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/macros.xml Tue Jun 07 17:25:44 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 367b1ed91207 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:25:44 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 367b1ed91207 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:25:44 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 367b1ed91207 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:25:44 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 367b1ed91207 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:25:44 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 367b1ed91207 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:25:44 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 367b1ed91207 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:25:44 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\}\]\}