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

Changeset 2:17b378303f2d (2021-04-27)
Previous changeset 1:29151e779524 (2021-03-09) Next changeset 3:76d4cbefff85 (2021-06-14)
Commit message:
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 3199d3f9c401663ffe45a679c3918489d4f6d149"
modified:
purge_dups.xml
added:
test-data/out2.cov
test-data/out2.wig
test-data/purge_dups_out_2.bed
test-data/test2.paf.gz
b
diff -r 29151e779524 -r 17b378303f2d purge_dups.xml
--- a/purge_dups.xml Tue Mar 09 18:25:07 2021 +0000
+++ b/purge_dups.xml Tue Apr 27 20:48:51 2021 +0000
[
@@ -2,16 +2,20 @@
     <description>and haplotigs in an assembly based on read depth (purge_dups)</description>
     <macros>
         <token name="@TOOL_VERSION@">1.2.5</token>
-        <token name="@VERSION_SUFFIX@">1</token>
+        <token name="@VERSION_SUFFIX@">2</token>
     </macros>
     <requirements>
         <requirement type="package" version="@TOOL_VERSION@">purge_dups</requirement>
     </requirements>
     <command detect_errors="exit_code"><![CDATA[
         #if $function_select.functions == "purge_dups":
-            #if $function_select.input.is_of_type("paf"):
-                gzip -c '$function_select.input' > ./input.paf.gz &&
-            #end if
+            #for $i, $file in enumerate($function_select.input):
+                #if $file.is_of_type("paf"):
+                    gzip -c '${file}' > '${i}.gz' &&
+                #else
+                    ln -s '${file}' '${i}.gz' &&
+                #end if
+            #end for
             purge_dups
             #if $function_select.coverage:
                 -c '$function_select.coverage'
@@ -46,11 +50,10 @@
             #if $function_select.max_extend:
                 -E $function_select.max_extend
             #end if
-            #if $function_select.input.is_of_type("paf"):
-                'input.paf.gz' > dups.bed 2> purge_dups.log
-            #else:
-                '${function_select.input}' > dups.bed 2> purge_dups.log
-            #end if
+            #for $i, $file in enumerate($function_select.input):
+                '${i}.gz'
+            #end for
+            > dups.bed 2> purge_dups.log
         #else if $function_select.functions == "split_fa":
             split_fa
             #if $function_select.split:
@@ -58,9 +61,13 @@
             #end if
             '$function_select.input' > split.fasta
         #else if $function_select.functions == "pbcstat":
-            #if $function_select.input.is_of_type("paf"):
-                gzip -c '$function_select.input' > ./input.paf.gz &&
-            #end if
+            #for $i, $file in enumerate($function_select.input):
+                #if $file.is_of_type("paf"):
+                    gzip -c '${file}' > '${i}.gz' &&
+                #else
+                    ln -s '${file}' '${i}.gz' &&
+                #end if
+            #end for
             pbcstat
             #if $function_select.max_cov:
                 -M $function_select.max_cov
@@ -75,11 +82,9 @@
                 -l $function_select.flank
             #end if
             $function_select.primary_alignments
-            #if $function_select.input.is_of_type("paf"):
-                'input.paf.gz'
-            #else:
-                '${function_select.input}'
-            #end if
+            #for $i, $file in enumerate($function_select.input):
+                '${i}.gz'
+            #end for 
         #else if $function_select.functions == "ngscstat":
             ngscstat
             #if $function_select.min_align_qual:
@@ -137,7 +142,7 @@
                 <option value="get_seqs">obtain seqeuences after purging</option>
             </param>
             <when value="purge_dups">
-                <param name="input" type="data" format="paf,paf.gz" label="PAF input file"/>
+                <param name="input" type="data" format="paf,paf.gz" multiple="true" label="PAF input file"/>
                 <param name="coverage" type="data" format="tabular" optional="true" argument="-c" label="Base-level coverage file" />
                 <param name="cutoffs" type="data" format="tabular" label ="Cutoffs file" optional="true" argument="-T"/>
                 <param name="min_bad" type="float" min="0" max="1" argument="-f" optional="true" label="Minimum fraction of haploid/diploid/bad/repetitive bases in a sequence" help="Default = 0.8"/>
@@ -163,7 +168,7 @@
                 <param name="split" type="boolean" truevalue="-n" falsevalue="" checked="false" label="Base-level coverage file" />
             </when>
             <when value="pbcstat">
-                <param name="input" type="data" format="paf,paf.gz" label="PAF input file"/>
+                <param name="input" type="data" format="paf,paf.gz" multiple="true" label="PAF input file"/>
                 <param name="max_cov" type="integer" label="Maximum coverage" argument="-M" optional="true"/>
                 <param name="min_map_ratio" argument="-f" type="float" min="0" max="1" value="0" label="Minimum mapping length ratio"/>
                 <param name="min_map_qual" type="integer"  argument="-q" optional="true" label="Minimum mapping quality"/>
@@ -288,6 +293,14 @@
             </conditional>
             <output name="purge_dups_bed" value="purge_dups_out.bed"/>
         </test>
+        <!-- Purge dups multiple input -->
+        <test expect_num_outputs="2">
+            <conditional name="function_select">
+                <param name="functions" value="purge_dups"/>
+                <param name="input" value="test.paf,test2.paf.gz"/>
+            </conditional>
+            <output name="purge_dups_bed" value="purge_dups_out_2.bed"/>
+        </test>
         <!-- Split fa -->
         <test expect_num_outputs="1">
             <conditional name="function_select">
@@ -325,6 +338,15 @@
             <output name="pbcstat_cov" value="out.cov"/>
             <output name="pbcstat_wig" value="out.wig"/>
         </test>
+                <!-- Pbcstat multiple input -->
+        <test expect_num_outputs="3">
+            <conditional name="function_select">
+                <param name="functions" value="pbcstat"/>
+                <param name="input" value="test.paf,test2.paf.gz"/>
+            </conditional>
+            <output name="pbcstat_cov" value="out2.cov"/>
+            <output name="pbcstat_wig" value="out2.wig"/>        
+        </test>
         <!-- ngscstat -->
         <test expect_num_outputs="2">
             <conditional name="function_select">
b
diff -r 29151e779524 -r 17b378303f2d test-data/out2.cov
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/out2.cov Tue Apr 27 20:48:51 2021 +0000
b
@@ -0,0 +1,13 @@
+>gi|528476637:29857558-29915771 58214
+1 29092 0
+29093 29357 2
+29358 33375 0
+33376 41952 1
+41953 58214 0
+>gi|157734152:29655295-29712160 56866
+1 29213 0
+29214 29478 1
+29479 33497 0
+33498 42074 1
+42075 48470 0
+48471 56866 1
b
diff -r 29151e779524 -r 17b378303f2d test-data/out2.wig
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/out2.wig Tue Apr 27 20:48:51 2021 +0000
b
@@ -0,0 +1,116 @@
+track type="wiggle_0" name="PB"
+fixedStep chrom=gi|528476637:29857558-29915771 start=1 step=1024 span=1024
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+1
+1
+1
+1
+1
+1
+1
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+variableStep chrom=gi|528476637:29857558-29915771 span=1894
+56321 0
+fixedStep chrom=gi|157734152:29655295-29712160 start=1 step=1024 span=1024
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+1
+1
+1
+1
+1
+1
+1
+1
+0
+0
+0
+0
+0
+0
+0
+1
+1
+1
+1
+1
+1
+variableStep chrom=gi|157734152:29655295-29712160 span=1570
+55297 1
b
diff -r 29151e779524 -r 17b378303f2d test-data/purge_dups_out_2.bed
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/purge_dups_out_2.bed Tue Apr 27 20:48:51 2021 +0000
b
@@ -0,0 +1,1 @@
+gi|157734152 29655294 29712160 HAPLOTIG gi|528476637
b
diff -r 29151e779524 -r 17b378303f2d test-data/test2.paf.gz
b
Binary file test-data/test2.paf.gz has changed