diff biobox_add_taxid.xml @ 4:2e0af1e2d487 draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/amber/ commit 09a7f1234811e6104671c0fbb51a515e13815041
author iuc
date Sat, 08 Feb 2025 11:33:03 +0000
parents 450a61fc097f
children
line wrap: on
line diff
--- a/biobox_add_taxid.xml	Sun Sep 08 14:37:41 2024 +0000
+++ b/biobox_add_taxid.xml	Sat Feb 08 11:33:03 2025 +0000
@@ -1,68 +1,59 @@
-<tool id="biobox_add_taxid" name="Biobox add taxid" version="@SCRIPT_VERSION@+galaxy@VERSION_SUFFIX@" profile="@PROFILE@">
+<tool id="biobox_add_taxid" name="Biobox add taxid" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="@PROFILE@">
     <description>Add taxid output from BAT or GTDB to biobox binning data</description>
     <macros>
-        <import>macros.xml</import>
-        <token name="@SCRIPT_VERSION@">0.6</token>
+        <token name="@TOOL_VERSION@">1.2</token>
+        <token name="@VERSION_SUFFIX@">0</token>
+        <token name="@PROFILE@">24.1</token>
     </macros>
     <requirements>
-        <requirement type="package" version="@SCRIPT_VERSION@">biobox_add_taxid</requirement>
+        <requirement type="package" version="@TOOL_VERSION@">biobox_add_taxid</requirement>
     </requirements>
     <command detect_errors="exit_code">
     <![CDATA[
 
-        mkdir -p input taxonkit gtdb_to_taxdump &&
-
-        ln -s '${biobox_file}' '$biobox_file.element_identifier' &&
-
-        #for $i, $f in enumerate($tool_type.input):
-            ln -s '$f' 'input/${i}.tsv' &&
-        #end for
+    ln -s '$biobox_file' 'biobox.tsv' &&
 
-        #if $tool_type.is_select == 'GTDB':
-            #for $i, $f in enumerate($gtdb_to_taxdump):
-                ln -s '$f' 'gtdb_to_taxdump/gtdb_to_taxdump_${i}.tsv' &&
-            #end for
-            #for $i, $f in enumerate($taxonkit):
-                ln -s '$f' 'taxonkit/taxonkit_${i}.tsv' &&
-            #end for
-        #end if
+    #if $input.is_select == 'contig':
+        ln -s '$contig2taxid' 'contig.tsv' &&
+    #else:
+        ln -s '$binid2taxid' 'bin.tsv' &&
+    #end if
 
-        biobox_add_taxid.py
-        '$biobox_file.element_identifier'
-        '$tool_type.is_select'
-        'input'
-        #if $tool_type.is_select == 'GTDB':
-            -g 'gtdb_to_taxdump'
-            -t 'taxonkit'
-            -c $column
-        #end if
-        &&
+    biobox_add_taxid.py
+    'biobox.tsv'
+    #if $input.is_select == 'contig':
+        -c 'contig.tsv'
+    #else:
+        -b 'bin.tsv'
+    #end if
+    -k_c ${key_col}
+    -t_c ${taxid_col}
 
-        #if $tool_type.is_select == 'GTDB':
-            cp *_add_taxid_GTDB* $output
-        #else:
-            cp *_add_taxid_BAT* $output
-        #end if
+    &&
+
+    cp 'modified_biobox_file.tsv' '$output'
 
     ]]>
     </command>
     <inputs>
-        <param name="biobox_file" type="data" format="tabular" label="CAMI amber biobox file input" help="Input the CAMI amber biobox file here which are corespond with the biner and the BAT/GTDB output which did used the biner as input! "/>
-        <conditional name="tool_type">
-            <param name="is_select" type="select" label="Select the tool which output should be used here" help="Select BAT when you use the bin2classifier file(s) or select GTDB when using the summary file(s)">
-                <option value="BAT">BAT</option>
-                <option value="GTDB">GTDB</option>
+        <param name="biobox_file" type="data" format="tabular" label="Input biobox file"
+            help="This file can be generated with the utility tool from CAMI AMBER named convert to biobox"/>
+        <conditional name="input">
+            <param name="is_select" type="select" label="Select typ of input">
+                <option value="contig">ContigID2TaxID</option>
+                <option value="bin">BinID2TaxID</option>
             </param>
-            <when value="GTDB">
-                <param argument="--gtdb_to_taxdump" type="data" multiple="true" format="tabular" label="Input the output from gtdb_to_taxdump here" help="Use the output from gtdb_to_taxdump here since we need the mapped names from GTDB to NCBI to get the arcoding taxids from NCBI"/>
-                <param argument="--taxonkit" type="data" format="tabular" multiple="true" label="Input the output from Taxonkit here" help="Use the output from Taxonkit here since the need the mapped NCBI names to the arcording taxids"/>
-                <param argument="--column" type="data_column" data_ref="taxonkit" label="Input the colum with the NCBI names"/>
-                <param name="input" type="data" multiple="true" format="tabular" label="Input the GTDB-Tk summary file(s) here"
-                    help="Use the GTDB-Tk file(s) which are coresponding with the binning file!"/>
+            <when value="contig">
+                <param argument="--contig2taxid" type="data" format="tabular" label="Input ConitgID2TaxID file"
+                    help="This input comes from Kraken2"/>
+                <param argument="--key_col" type="data_column" data_ref="contig2taxid" label="Select the column where the ContigID are stated"/>
+                <param argument="--taxid_col" type="data_column" data_ref="contig2taxid" label="Select the column where the TaxID are stated"/>
             </when>
-            <when value="BAT">
-                <param name="input" type="data" multiple="true" format="tabular" label="Input bin2classifier file(s) from BAT here"
-                    help="Use the BAT file(s) which are coresponding with the binning file!"/>
+            <when value="bin">
+                <param argument="--binid2taxid" type="data" format="tabular" label="Input BinID2TaxID file"
+                    help="This input comes from Kraken2"/>
+                <param argument="--key_col" type="data_column" data_ref="binid2taxid" label="Select the column where the BinID are stated"/>
+                <param argument="--taxid_col" type="data_column" data_ref="binid2taxid" label="Select the column where the TaxID are stated"/>
             </when>
         </conditional>
     </inputs>
@@ -70,48 +61,52 @@
         <data name="output" format="tabular" label="${tool.name}: BIOBOX ADD TAXID COLUMN"/>
     </outputs>
     <tests>
-        <test expect_num_outputs="1">
-            <param name="biobox_file" ftype="tabular" value="test_biobox_file.tsv"/>
-            <conditional name="tool_type">
-                <param name="is_select" value="BAT"/>
-                <param name="input" ftype="tabular" value="test_bat_file.tsv"/>
+        <test>
+            <param name="biobox_file" value="biobox_file.tsv" ftype="tabular"/>
+            <conditional name="input">
+                <param name="is_select" value="bin"/>
+                <param name="binid2taxid" value="binid2taxid.tsv" ftype="tabular"/>
+                <param name="key_col" value="1"/>
+                <param name="taxid_col" value="2"/>
             </conditional>
-            <output name="output" file="test_biobox_file_add_taxid_bat.tsv"/>
+            <output name="output" file="modified_biobox_file_bin.tsv"/>
         </test>
-        <test expect_num_outputs="1">
-            <param name="biobox_file" ftype="tabular" value="test_biobox_file.tsv"/>
-            <conditional name="tool_type">
-                <param name="is_select" value="GTDB"/>
-                <param name="gtdb_to_taxdump" ftype="tabular" value="test_gtdb_to_taxdump_file.tsv"/>
-                <param name="taxonkit" ftype="tabular" value="test_taxonkit_file_1.tsv,test_taxonkit_file_2.tsv"/>
-                <param name="column" value="1"/>
-                <param name="input" ftype="tabular" value="test_gtdb_file.tsv"/>
+        <test>
+            <param name="biobox_file" value="biobox_file.tsv" ftype="tabular"/>
+            <conditional name="input">
+                <param name="is_select" value="contig"/>
+                <param name="contig2taxid" value="kraken2.tsv" ftype="tabular"/>
+                <param name="key_col" value="2"/>
+                <param name="taxid_col" value="3"/>
             </conditional>
-            <output name="output" file="test_biobox_file_add_taxid_gtdb.tsv"/>
+            <output name="output" file="modified_biobox_file_contig.tsv"/>
         </test>
     </tests>
     <help>
     <![CDATA[
         
         **USAGE OF THIS TOOL**
-
-        This tool was desgin for using the BAT/GTDB-Tk output to expand the CAMI amber biobox file with the taxid column to access taxa evaluation with amber!
-
-        **IMPORTAND NOTE WHEN USING GTDB OUTPUT**
-
-        Befor using GTDB-Tk output you have to use 2 other tools to map the GTDB names to the NCBI names and then map the NCBI names to there taxids.
-        To map the GTDB names to the NCBI names you extract the GTDB names from the summary file and with them you can now use the gtdb_to_taxdum tool!
-        After using the gtdb_to_taxdum tool you have the extract the NCBI names here and then use the tool Taxonkit[name2taxid] to finaly get the taxids.
+        
+        This tool can be used to add the TaxID column to a biobox file.
 
         **INPUTS**
-        - The CAMI amber biobox file
-        - BAT[bin2classifier] file(s) OR GTDB-Tk[Summary] file(s)
-        - The gtdb_to_taxdum output[WHEN USING GTDB-Tk]
-        - The Taxonkit[name2taxid] output[WHEN USING GTDB-Tk]
+        
+        - A biobox file. This file can be generated with the CAMI AMBER utility Tool named 'convert to biobox'
+        - Either a Contig2TaxID file which is generated from Kraken2 (the classification file from Kraken2) or a BinID2TaxID which has to be done manualy
+
+        Example for a BinID2TaxID file 
+
+        ::
+        
+            #BinID   TaxID
+            test1   11056
+            test2   444944
+            ABC 888
 
         **OUTPUT**
 
-        A CAMI amber biobox file with a taxid colum
+        - A CAMI AMBER biobox file with a taxid column
+
     ]]> 
     </help>
     <citations>
@@ -121,8 +116,7 @@
             journal = {GitHub},
             year = {2024},
             month = aug,
-            note = {[Online; accessed 22. Aug. 2024]},
-            url = {https://github.com/SantaMcCloud/biobox_add_taxid/tree/release-0.3}
+            url = {https://github.com/SantaMcCloud/biobox_add_taxid/tree/release-1.0}
         }</citation>
     </citations>
 </tool>