diff cut_up_fasta.xml @ 2:2da5cb929899 draft

"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/concoct commit 1a79c139165648b969d82530784cea3fc8f2d2c0"
author iuc
date Thu, 07 Jul 2022 08:28:24 +0000
parents 225210d07ff5
children
line wrap: on
line diff
--- a/cut_up_fasta.xml	Fri Jul 01 14:12:17 2022 +0000
+++ b/cut_up_fasta.xml	Thu Jul 07 08:28:24 2022 +0000
@@ -1,81 +1,90 @@
-<tool id="concoct_cut_up_fasta" name="CONCOCT: cut fasta contigs" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="@PROFILE@">
-    <description>into equal length non-overlapping or overlapping parts</description>
+<tool id="concoct_cut_up_fasta" name="CONCOCT: Cut up contigs" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="@PROFILE@">
+    <description>in non-overlapping or overlapping parts of equal length</description>
     <macros>
         <import>macros.xml</import>
     </macros>
     <expand macro="requirements"/>
     <command detect_errors="exit_code"><![CDATA[
-python '$__tool_directory__/cut_up_fasta.py'
---input_fasta '$input_fasta'
-#if $input_fasta.is_of_type('fasta.gz'):
-    --gzipped
+## CONCOCT doesn't handle gzipped files.
+#if $input_fasta.ext.endswith(".gz")
+    gunzip -c '$input_fasta' > 'input.fa' &&
+#else:
+    ln -s '$input_fasta' 'input.fa' &&
 #end if
---chunk_size $chunk_size
---overlap_size $overlap_size
-$merge_last
-#if str($output_bed_param) == 'yes':
-    --output_bed '$output_bed'
-#end if
---output_fasta '$output_fasta'
+
+cut_up_fasta.py
+    'input.fa'
+    --chunk_size $chunk_size
+    --overlap_size $overlap_size
+    $merge_last
+    #if $bedfile
+    --bedfile '$output_bed'
+    #end if
+    > '$output_fasta'
     ]]></command>
     <inputs>
         <param name="input_fasta" type="data" format="fasta,fasta.gz" label="Fasta contigs file"/>
-        <param argument="--chunk_size" type="integer" value="1999" label="Chunk size"/>
-        <param argument="--overlap_size" type="integer" value="1900" label="Overlap size" help="Zero value produces non-overlapping parts"/>
+        <param argument="--chunk_size" type="integer" min="0" value="10000"  label="Chunk size"/>
+        <param argument="--overlap_size" type="integer" min="0" value="0" label="Overlap size" help="Zero value produces non-overlapping parts"/>
         <param argument="--merge_last" type="boolean" truevalue="--merge_last" falsevalue="" checked="false" label="Concatenate final part to last contig?"/>
-        <param name="output_bed_param" type="select" label="Output bed file with exact regions of the original contigs corresponding to the newly created contigs?" help="Can be used as input to the SAMTools bedcov tool">
-            <option value="no" selected="true">No</option>
-            <option value="yes">Yes</option>
-        </param>
+        <param name="bedfile" type="boolean" label="Output bed file with exact regions of the original contigs corresponding to the newly created contigs?" help="Can be used as input to the SAMTools bedcov tool"/>
     </inputs>
     <outputs>
-        <data name="output_bed" format="bed" label="${tool.name} on ${on_string} (bed)">
-            <filter>output_bed_param == 'yes'</filter>
+        <data name="output_fasta" format="fasta" label="${tool.name} on ${on_string}: Cut contigs"/>
+        <data name="output_bed" format="bed" label="${tool.name} on ${on_string}: Contig parts with coordinates">
+            <filter>bedfile</filter>
         </data>
-        <data name="output_fasta" format="fasta" label="${tool.name} on ${on_string} (contigs)"/>
     </outputs>
     <tests>
         <!-- default settings -->
         <test expect_num_outputs="1">
-            <param name="input_fasta" value="input.fasta.gz" ftype="fasta.gz"/>
+            <param name="input_fasta" value="two_contigs.fa"/>
+            <param name="chunk_size" value="1000" />
+            <param name="overlap_size" value="0"/>
+            <param name="merge_last" value=""/>
+            <param name="bedfile" value="false"/>
             <output name="output_fasta" ftype="fasta">
                 <assert_contents>
-                    <has_size value="2366"/>
-                    <has_text text="116"/>
-                    <has_n_lines n="100"/>
+                    <has_size value="12009"/>
+                    <has_text text=">contig-21000001.concoct_part_0"/>
+                    <has_n_lines n="24"/>
                 </assert_contents>
             </output>
         </test>
         <!-- merge_last and  output bed file -->
         <test expect_num_outputs="2">
-            <param name="input_fasta" value="input.fasta.gz" ftype="fasta.gz"/>
+            <param name="input_fasta" value="two_contigs.fa"/>
+            <param name="chunk_size" value="1000" />
+            <param name="overlap_size" value="0"/>
             <param name="merge_last" value="--merge_last"/>
-            <param name="output_bed_param" value="yes"/>
+            <param name="bedfile" value="true"/>
             <output name="output_bed" ftype="bed">
                 <assert_contents>
-                    <has_size value="1332"/>
-                    <has_text text="116"/>
-                    <has_n_lines n="50"/>
+                    <has_size value="564"/>
+                    <has_text text="contig-21000001.concoct_part_1"/>
+                    <has_n_lines n="10"/>
                 </assert_contents>
             </output>
             <output name="output_fasta" ftype="fasta">
                 <assert_contents>
-                    <has_size value="2366"/>
-                    <has_text text="116"/>
-                    <has_n_lines n="100"/>
+                    <has_size value="11943"/>
+                    <has_text text=">contig-21000001.concoct_part_0"/>
+                    <has_n_lines n="20"/>
                 </assert_contents>
             </output>
         </test>
-        <!-- Change chunk size and overlap size -->
+        <!-- Change chunk size, overlap size, fasta.gz as inputs -->
         <test expect_num_outputs="1">
-            <param name="input_fasta" value="input.fasta.gz" ftype="fasta.gz"/>
-            <param name="chunk_size" value="500"/>
+            <param name="input_fasta" value="composition.fa.gz" ftype="fasta.gz"/>
+            <param name="chunk_size" value="500" />
             <param name="overlap_size" value="499"/>
+            <param name="merge_last" value=""/>
+            <param name="bedfile" value="false"/>
             <output name="output_fasta" ftype="fasta">
                 <assert_contents>
-                    <has_size value="2366"/>
+                    <has_size value="505603858"/>
                     <has_text text="116"/>
-                    <has_n_lines n="100"/>
+                    <has_n_lines n="2048636"/>
                 </assert_contents>
             </output>
         </test>
@@ -83,10 +92,7 @@
     <help><![CDATA[
 **What it does**
 
-Accepts a fasta file containing contigs, cuts them into non-overlapping or overlapping parts of equal length, and produces
-a fasta file containing the cut contigs.  An optional output BED file can be produced, where the cut contigs are specified
-in terms of the original contigs.  Using this file as input to a BED coverage tool (e.g., bedtools Compute both the length
-and depth of coverage) will produce a file that can be used as input to the CONCOCT Create coverage table tool.
+Accepts a fasta file containing contigs, cuts them into non-overlapping or overlapping parts of equal length, and produces a fasta file containing the cut contigs.  An optional output BED file can be produced, where the cut contigs are specified in terms of the original contigs.  Using this file as input to a BED coverage tool (e.g., bedtools Compute both the length and depth of coverage) will produce a file that can be used as input to the CONCOCT Create coverage table tool.
 
 @HELP_OVERVIEW@
     ]]></help>