diff coverm_genome.xml @ 1:a671907f96fe draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tools/coverm commit 2388df7187533fb66b7729730340d2eb7b93c112
author iuc
date Tue, 24 Jan 2023 12:32:54 +0000
parents 134e4e78e754
children 5bf5792b0996
line wrap: on
line diff
--- a/coverm_genome.xml	Tue Apr 26 15:27:01 2022 +0000
+++ b/coverm_genome.xml	Tue Jan 24 12:32:54 2023 +0000
@@ -1,5 +1,5 @@
-<tool id="coverm_genome" name="CoverM-GENOME" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" python_template_version="3.5">
-    <description>read coverage and relative abundance calculator focused on metagenomics applications</description>
+<tool id="coverm_genome" name="CoverM genome" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="@PROFILE@">
+    <description>Calculate coverage of individual genomes</description>
     <macros>
         <import>macros.xml</import>
     </macros>
@@ -135,7 +135,7 @@
                     ln -s '$input_file' '$file_path' &&
                     $ref_files.append($file_path)
                 #end for
-            #if $reads.genome.add_genome.add_genome
+            #if $reads.genome.add_genome.add_genome == "true"
                 mkdir -p genomes &&
                 #set genome_files = []
                 #if $reads.genome.add_genome.add_genomic == "history"
@@ -156,7 +156,8 @@
                 #end if
             #end if
         #end if
-    
+        
+        mkdir ./representative-fasta/ &&
         coverm genome
             #if $reads.read_type == 'paired'
                 -1
@@ -240,7 +241,7 @@
                         -s "$reads.genome.cond_single_genome.separator"
                     #end if
                 #end if
-                #if $reads.genome.add_genome.add_genome
+                #if $reads.genome.add_genome.add_genome == "true"
                     -f
                     #for $genome in $genome_files
                         '${genome}'
@@ -255,27 +256,27 @@
 
             $derep.dereplicate
             #if $derep.checkm_tab_table:
-                --chekm-tab-table $derep.checkm_tab_table
+                --chekm-tab-table '$derep.checkm_tab_table'
             #end if
             #if $derep.genome_info:
-                --genome-info $derep.genome_info
+                --genome-info '$derep.genome_info'
             #end if
-            #if $derep.min_completeness:
+            #if $derep.min_completeness != "":
                 --min-completeness $derep.min_completeness
             #end if
-            #if $derep.max_contamination:
+            #if $derep.max_contamination != "":
                 --max-contamination $derep.max_contamination
             #end if
-            #if $derep.dereplication_ani:
+            #if $derep.dereplication_ani != "":
                 --dereplication-ani $derep.dereplication_ani
             #end if
-            #if $derep.dereplication_aligned_fraction:
+            #if $derep.dereplication_aligned_fraction != "":
                 --dereplication-aligned-fraction $derep.dereplication_aligned_fraction
             #end if
-            #if $derep.dereplication_fragment_length:
+            #if $derep.dereplication_fragment_length != "":
                 --dereplication-fragment-length $derep.dereplication_fragment_length
             #end if
-            #if $derep.dereplication_prethreshold_ani:
+            #if $derep.dereplication_prethreshold_ani != "":
                 --dereplication-prethreshold-ani $derep.dereplication_prethreshold_ani
             #end if
             #if $derep.dereplication_quality_formula:
@@ -315,13 +316,13 @@
             --methods $cov.relative_abundance $cov.mean $cov.cond_methods.trimmed_mean $cov.covered_bases $cov.covered_fraction
             $cov.variance $cov.length $cov.count $cov.metabat $cov.coverage_histogram $cov.reads_per_base 
             $cov.rpkm $cov.tpm
-            #if $cov.min_covered_fraction:
+            #if $cov.min_covered_fraction != "":
                 --min-covered-fraction $cov.min_covered_fraction
             #end if
-            #if $cov.contig_end_exclusion:
+            #if $cov.contig_end_exclusion != "":
                 --contig-end-exclusion $cov.contig_end_exclusion
             #end if
-            #if $cov.cond_methods.trimmed_mean
+            #if $cov.cond_methods.trimmed_mean == "trimmed_mean"
                 #if $cov.cond_methods.trim_min:
                     --trim-min $cov.cond_methods.trim_min
                 #end if
@@ -334,15 +335,18 @@
                 --output-format $out.output_format
             #end if
             #if $out.dereplication_output_cluster_definition:
-                --dereplication-output-cluster-definition
+                --dereplication-output-cluster-definition '$cluster_definition'
             #end if
             #if $out.dereplication_output_representative_fasta_directory_copy:
-                --dereplication-output-representative-fasta-directory-copy .
+                --dereplication-output-representative-fasta-directory-copy ./representative-fasta/
             #end if
             $out.no_zeros
             --output-file output.tsv
             --threads \${GALAXY_SLOTS:-1}
-            2> stdout.txt
+
+        #if $derep.dereplicate and $out.dereplication_output_cluster_definition
+            && sed -i -e 's@genomes/@@g; s/\.fna//g' '$cluster_definition'
+        #end if
     ]]></command>
     <inputs>
         <expand macro="reads" />
@@ -394,12 +398,16 @@
     </inputs>
     <outputs>
         <data name="output1" format="tsv" from_work_dir="./output.tsv"/>
-        <data name="cluster-definition" format="tsv">
-            <filter>out['dereplication_output_cluster_definition']</filter>
+        <data name="cluster_definition" format="tsv" label="${tool.name} on ${on_string}: cluster definition">
+            <filter>derep['dereplicate'] and out['dereplication_output_cluster_definition']</filter>
         </data>
+        <collection name="representative_fasta" type="list" label="${tool.name} on ${on_string}: representative fasta">
+            <discover_datasets pattern="(?P&lt;designation&gt;.*)\.fna" format="fasta" directory="representative-fasta" />
+            <filter>derep['dereplicate'] and out['dereplication_output_representative_fasta_directory_copy']</filter>
+        </collection>
     </outputs>
     <tests>
-        <test>
+        <test expect_num_outputs="1">
             <conditional name="reads">
                 <param name="read_type" value="paired_collection"/>
                 <param name="paired_reads">
@@ -489,7 +497,7 @@
                 </assert_contents>
             </output>
         </test>
-        <test expect_num_outputs="1">
+        <test expect_num_outputs="3">
             <conditional name="reads">
                 <param name="read_type" value="paired_collection"/>
                 <param name="paired_reads">
@@ -513,7 +521,20 @@
             <section name="cov">
                 <param name="mean" value="true"/>
             </section>
+            <section name="derep">
+                <param name="dereplicate" value="true"/>
+            </section>
+            <section name="out">
+                <param name="dereplication_output_cluster_definition" value="true"/>
+                <param name="dereplication_output_representative_fasta_directory_copy" value="true"/>
+            </section>
             <output name="output1" file="test3.tsv" ftype="tsv"/>
+            <output name="cluster_definition" ftype="tsv" value="test4_cluster.tsv"/>
+            <output_collection name="representative_fasta" type="list" count="3">
+                <element name="genome1" file="test4_rep1.fa" ftype="fasta" />
+                <element name="genome2" file="test4_rep2.fa" ftype="fasta" />
+                <element name="genome3" file="test4_rep3.fa" ftype="fasta" />
+            </output_collection>
         </test>
         <test expect_num_outputs="1">
             <conditional name="reads">