changeset 1:bd2a15dbcea1 draft

planemo upload for repository https://github.com/mesocentre-clermont-auvergne/galaxy-tools/tree/master/tools/polypolish commit afc3449a0b68d43fd1179543815dfe23b951e157
author iuc
date Fri, 20 Oct 2023 12:41:27 +0000
parents aaa868913641
children f355085dd2aa
files macro.xml polypolish.xml
diffstat 2 files changed, 58 insertions(+), 22 deletions(-) [+]
line wrap: on
line diff
--- a/macro.xml	Thu Sep 22 07:51:48 2022 +0000
+++ b/macro.xml	Fri Oct 20 12:41:27 2023 +0000
@@ -1,7 +1,7 @@
 
 <macros>
   <token name="@TOOL_VERSION@">0.5.0</token>
-  <token name="@VERSION_SUFFIX@">0</token>
+  <token name="@VERSION_SUFFIX@">1</token>
   <token name="@PROFILE@">21.05</token>
   <token name="@THREADS@">\${GALAXY_SLOTS:-7}</token>
   <xml name="version_command">
@@ -33,8 +33,8 @@
               <option value="non_filter"> No filtering step</option>
           </param>
           <when value="filter">
-              <param name="low" argument="--low" type="float" min="0" value="0.1" label="Low percentile threshold" help="Select the lower value to remove [default: 0.1]"/>
-              <param name="high" argument="--high" type="float" min="0" value="99.9" label="High percentile threshold" help="Select the lower value to remove [default: 99.9]"/>
+              <param argument="--low" type="float" min="0" value="0.1" label="Low percentile threshold" help="Select the lower value to remove [default: 0.1]"/>
+              <param argument="--high" type="float" min="0" value="99.9" label="High percentile threshold" help="Select the lower value to remove [default: 99.9]"/>
           </when>
           <when value="non_filter">
           </when>
--- a/polypolish.xml	Thu Sep 22 07:51:48 2022 +0000
+++ b/polypolish.xml	Fri Oct 20 12:41:27 2023 +0000
@@ -14,25 +14,31 @@
                     For single SAM
         ======================================*#
         #if $input.sam_data_type.sam_selector == 'single'
-            #if $input.sam_data_type.single_sam.ext == 'unsorted.bam'
+            #if $input.sam_data_type.single_sam.is_of_type("unsorted.bam")
                 samtools view -h $input.sam_data_type.single_sam > input_sam &&
             #elif $input.sam_data_type.single_sam.ext == 'sam'
                 ln -s $input.sam_data_type.single_sam input_sam &&
+            #else
+                echo "${input.sam_data_type.single_sam} not a sam/bam file"
             #end if
             polypolish input_data input_sam > '$polished_fasta'
         #*======================================
                     For paired SAM
         ======================================*#
         #elif $input.sam_data_type.sam_selector == 'paired'
-            #if $input.sam_data_type.R1_sam.ext == 'unsorted.bam'
+            #if $input.sam_data_type.R1_sam.is_of_type("unsorted.bam")
                 samtools view -h $input.sam_data_type.R1_sam > sample_R1.sam &&
             #elif $input.sam_data_type.R1_sam.ext == 'sam'
                 ln -s '$input.sam_data_type.R1_sam' sample_R1.sam &&
+            #else
+                echo "${input.sam_data_type.single_sam} not a sam/bam file"
             #end if
-            #if $input.sam_data_type.R2_sam.ext == 'unsorted.bam'
+            #if $input.sam_data_type.R2_sam.is_of_type("unsorted.bam")
                 samtools view -h $input.sam_data_type.R2_sam > sample_R2.sam &&
             #elif $input.sam_data_type.R2_sam.ext == 'sam'
                 ln -s '$input.sam_data_type.R2_sam' sample_R2.sam &&
+            #else
+                echo "${input.sam_data_type.single_sam} not a sam/bam file"
             #end if
             #if $input.sam_data_type.insert_filter.filter_select == 'filter'
                 polypolish_insert_filter.py --low '$input.sam_data_type.insert_filter.low'
@@ -51,10 +57,12 @@
         #elif $input.sam_data_type.sam_selector == 'multiple_single'
             mkdir single_collection &&
             #for $value, $single_sam in enumerate($input.sam_data_type.single_collection):
-                #if $single_sam.ext == 'unsorted.bam'
+                #if $single_sam.is_of_type("unsorted.bam")
                     samtools view -h $single_sam > 'single_collection/$(single_sam.element_identifier).sam' &&
                 #elif $single_sam.ext == 'sam'
                     ln -s $single_sam 'single_collection/$(single_sam.element_identifier).$(single_sam.ext)' &&
+                #else
+                    echo "${single_sam} is not a sam/bam file"
                 #end if
             #end for
             polypolish input_data single_collection/*.sam > '$polished_fasta'
@@ -64,12 +72,12 @@
         #elif $input.sam_data_type.sam_selector == "multiple_paired"
             mkdir paired_collection &&
             #for $value, $paired_sam in enumerate($input.sam_data_type.paired_collection):
-                #if $paired_sam.forward.ext == 'unsorted.bam'
+                #if $paired_sam.forward.is_of_type("unsorted.bam")
                     samtools view -h $paired_sam.forward > 'paired_collection/forward_input$(value)$(paired_sam.forward.element_identifier).sam' &&
                 #else
                     ln -s '$paired_sam.forward' 'paired_collection/forward_input$(value)$(paired_sam.forward.element_identifier).sam' &&
                 #end if
-                #if $paired_sam.reverse.ext == 'unsorted.bam'
+                #if $paired_sam.reverse.is_of_type("unsorted.bam")
                     samtools view -h $paired_sam.reverse > 'paired_collection/reverse_input$(value)$(paired_sam.reverse.element_identifier).sam' &&
                 #else
                     ln -s '$paired_sam.reverse' 'paired_collection/reverse_input$(value)$(paired_sam.reverse.element_identifier).sam' &&
@@ -135,16 +143,16 @@
             </conditional>
         </section>
         <section name="options" title="Options" expanded="False">
-            <param name="min_depth" argument="--min_depth" type="integer" min="0" value="5" label="Minimal depth"
+            <param argument="--min_depth" type="integer" min="0" value="5" label="Minimal depth"
                    help="A base must occur at least this many times in the pileup to be considered valid [default: 5]"/>
-            <param name="fraction_invalid" argument="--fraction_invalid" type="float" min="0" value="0.2" max="1" label="Minimal invalid fraction"
+            <param argument="--fraction_invalid" type="float" min="0" value="0.2" max="1" label="Minimal invalid fraction"
                    help="A base must make up less than this fraction of the read depth to be considered invalid [default: 0.2]"/>
-            <param name="max_errors" argument="--max_errors" type="integer" min="0" value="10" label="Number of mismatch/indels to ignore alignments"
+            <param argument="--max_errors" type="integer" min="0" value="10" label="Number of mismatch/indels to ignore alignments"
                    help="Ignore alignments with more than this many mismatches and indels [default: 10]"/>
-            <param name="fraction_valid" argument="--fraction_valid" type="float" min="0" value="0.5" max="1" label="Minimal valid fraction"
+            <param argument="--fraction_valid" type="float" min="0" value="0.5" max="1" label="Minimal valid fraction"
                    help="A base must make up at least this fraction of the read depth to be considered valid [default: 0.5"/>
             <param name="keep_logfile" type="boolean" truevalue="true" falsevalue="false" label="Keep log file"/>
-            <param name="debug" argument="--debug" type="boolean" truevalue="true" falsevalue="false" label="Keep per base information file"/>
+            <param argument="--debug" type="boolean" truevalue="true" falsevalue="false" label="Keep per base information file"/>
         </section>
     </inputs>
     <outputs>
@@ -343,9 +351,9 @@
                     <param name="sam_selector" value="multiple_single"/>
                     <param name="single_collection">
                         <collection type="list">
-                            <element name="R1_sam" value="aligned_test_file/alignement_R1.bam" ftype="unsorted.bam"/>
-                            <element name="R1_bis_sam" value="aligned_test_file/alignement_R1_bis.bam" ftype="unsorted.bam"/>
-                            <element name="R1_ter_sam" value="aligned_test_file/alignement_R1_ter.bam" ftype="unsorted.bam"/>
+                            <element name="R1_sam" value="aligned_test_file/alignement_R1.sam" ftype="sam"/>
+                            <element name="R1_bis_sam" value="aligned_test_file/alignement_R1_bis.sam" ftype="sam"/>
+                            <element name="R1_ter_sam" value="aligned_test_file/alignement_R1_ter.sam" ftype="sam"/>
                         </collection>
                     </param>
                 </conditional>
@@ -392,6 +400,34 @@
             </section>
             <output name="polished_fasta" value="polished.fasta"/>
         </test>
+        <!-- Test_12 Test with bam files -->
+        <test expect_num_outputs="1">
+            <section name="input">
+                <param name="fasta_file" value="contigs.fa"/>
+                <conditional name="sam_data_type">
+                    <param name="sam_selector" value="single"/>
+                    <param name="single_sam" value="aligned_test_file/alignement_R1.bam"/>
+                </conditional>
+            </section>
+            <output name="polished_fasta" value="polished.fasta"/>
+        </test>
+        <!-- Test_13 paired bam -->
+        <test expect_num_outputs="2">
+            <section name="input">
+                <param name="fasta_file" value="contigs.fa"/>
+                <conditional name="sam_data_type">
+                    <param name="sam_selector" value="paired"/>
+                    <param name="R1_sam" value="aligned_test_file/alignement_R1.bam"/>
+                    <param name="R2_sam" value="aligned_test_file/alignement_R2.bam"/>
+                </conditional>
+            </section>
+            <section name="options">
+                <param name="debug" value="true"/>
+                <param name="keep_logfile" value="false"/>
+            </section>
+            <output name="polished_fasta" value="polished.fasta"/>
+            <output name="debug_file" value="debug_file_test_2.tsv"/>
+        </test>
     </tests>
   <help><![CDATA[
     **What it does**
@@ -401,10 +437,12 @@
 
     **Polypolish pipeline steps**
     1. [Optional] Filter aligned reads
-        - Exclude some alignments based on their insert size
-        - This should reduce the number of excessive alignments, particularly near the edges of repeat sequences, improving Polypolish's ability to fix errors in those regions.
+    Exclude some alignments based on their insert size
+    This should reduce the number of excessive alignments,
+    particularly near the edges of repeat sequences, improving Polypolish's ability to fix errors in those regions.
     2. Clean assembly with filtered reads
 
+
     **Inputs**
     Polypolish need SAM/BAM input format obtain from aligner with option to keep all possible location
     Polypolish take on or more assembly as input fasta.
@@ -414,9 +452,7 @@
     For example using bwa mem to align raw data before use, you need :
     1. To align each read data independantly (also for paired data)
     2. Set the option "Output all alignments for single-ends or unpaired paired-ends" in Select analysis mode>Set input/output options
-      - This allow multiple ailgnemnt output need to use polypolish
-
-      
+    This allow multiple ailgnemnt output need to use polypolish
   ]]></help>
     <expand macro="citations"/>
 </tool>