changeset 4:5e0825476fb7 draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc commit 72ae2e05f35098c4cb6dd4f038bff07fd36917ed
author iuc
date Tue, 04 Apr 2023 17:23:19 +0000
parents 24e471d13fe9
children 5a0ddb4dc3a4
files smudgeplot.xml test-data/my_genome_smudgeplot_02.png test-data/test_reads_4.fasta.gz test-data/test_reads_5.fasta.gz
diffstat 4 files changed, 32 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/smudgeplot.xml	Thu Jun 30 22:45:21 2022 +0000
+++ b/smudgeplot.xml	Tue Apr 04 17:23:19 2023 +0000
@@ -3,7 +3,7 @@
 
     <macros>
         <token name="@TOOL_VERSION@">0.2.5</token>
-        <token name="@VERSION_SUFFIX@">1</token>
+        <token name="@VERSION_SUFFIX@">2</token>
     </macros>
 
     <xrefs>
@@ -16,6 +16,7 @@
     </requirements>
 
     <command detect_errors="exit_code"><![CDATA[
+      set -o pipefail;
 
       #if $file.input.input_select == 'reads'
 
@@ -24,21 +25,17 @@
         ## Jellyfish kmer count
         ## ---------------------------------------------------------------------
 
-        #if $file.input.reads[0].is_of_type("fastqsanger.gz") or $file.input.reads[0].is_of_type("fasta.gz")
-          gunzip -c
+        mkdir -p './files/' &&
+        #if $file.input.reads[0].ext.endswith(".gz")
+          zcat
           #for $f in $file.input.reads
-              #if $f
-                  '$f'
-              #end if
-              | jellyfish count -m 21 -t 4 -s 1M -o 1_counts.jf -C /dev/stdin
+              '$f'
           #end for
-
+          | jellyfish count -m $file.input.mer_len -t \${GALAXY_SLOTS:-8} -s 1M -o 1_counts.jf -C /dev/stdin
         #else
-          jellyfish count -m 21 -t 4 -s 1M -o 1_counts.jf -C
+          jellyfish count -m $file.input.mer_len -t \${GALAXY_SLOTS:-8} -s 1M -o 1_counts.jf -C
           #for $f in $file.input.reads
-              #if $f
-                  '$f'
-              #end if
+              '$f'
           #end for
         #end if
 
@@ -47,13 +44,13 @@
         ## Calculate lower and upper kmer count cutoffs
         ## ---------------------------------------------------------------------
 
-        #if $file.input.lower_cutoff is not None:
+        #if $file.input.lower_cutoff:
           && L=$file.input.lower_cutoff
         #else
           && L=\$(smudgeplot.py cutoff 1_kmer_k21.hist L)
         #end if
 
-        #if $file.input.upper_cutoff is not None:
+        #if $file.input.upper_cutoff:
           && U=$file.input.upper_cutoff
         #else
           && U=\$(smudgeplot.py cutoff 1_kmer_k21.hist U)
@@ -77,7 +74,7 @@
       ## ---------------------------------------------------------------------
       ## Plot
 
-      && smudgeplot.py plot 2_kmer_pairs_coverages.tsv -o my_genome
+      && smudgeplot.py plot $homozygous 2_kmer_pairs_coverages.tsv -o my_genome
 
     ]]></command>
 
@@ -101,9 +98,18 @@
               Don't worry about read pairing as it is not used in Kmer-counting.
               If selecting multiple datasets, please do not mix datatypes!"
             />
+            
+            <param argument="--mer-len" 
+                  type="integer" 
+                  min="1" 
+                  value="21" 
+                  label="K-mer size" 
+                  help="The size of k-mers should be large enough allowing the k-mer to map uniquely to the genome" />
+
 
             <param
               name="lower_cutoff"
+              min="1"
               label="Lower kmer cutoff"
               type="integer"
               optional="true"
@@ -115,6 +121,7 @@
 
             <param
               name="upper_cutoff"
+              min="1"
               label="Upper kmer cutoff"
               type="integer"
               optional="true"
@@ -135,6 +142,7 @@
           </when>
         </conditional>
       </section>
+      <param argument="--homozygous" type="boolean" truevalue="--homozygous" falsevalue="" checked="false" label="Homozygous" help="Assume no heterozygosity in the genome - plotting a paralog structure." />
 
       <param name="table_output" type="boolean" label="Output summary table"></param>
       <param name="verbose_output" type="boolean" label="Output verbose summary"></param>
@@ -224,6 +232,15 @@
         <param name="dump" value="dump.jf" ftype="txt"/>
         <output name="smudgeplot" ftype="png" file="my_genome_smudgeplot.png" compare="sim_size"/>
       </test>
+      <!-- Standard run without specifying cutoffs and compressed file -->
+      <test expect_num_outputs="2">
+        <param name="input_select" value="reads"/>
+        <param name="reads" value="test_reads_4.fasta.gz,test_reads_5.fasta.gz"/>
+        <output name="smudgeplot" ftype="png" file="my_genome_smudgeplot_02.png" compare="sim_size"/>
+        <assert_stdout>
+          <has_text text="Dump with cutoffs L=10, U=70" />
+        </assert_stdout>
+      </test>
     </tests>
 
     <help><![CDATA[
Binary file test-data/my_genome_smudgeplot_02.png has changed
Binary file test-data/test_reads_4.fasta.gz has changed
Binary file test-data/test_reads_5.fasta.gz has changed