changeset 2:589078edd230 draft

"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/merqury commit 726df1fe4e8d703f62e1b9062bab1627c94ce746"
author iuc
date Mon, 25 Apr 2022 11:20:41 +0000
parents 39edec572bae
children f8113c25bc6b
files macros.xml merqury.xml test-data/output_05_log.txt
diffstat 3 files changed, 98 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/macros.xml	Thu Nov 11 16:38:42 2021 +0000
+++ b/macros.xml	Mon Apr 25 11:20:41 2022 +0000
@@ -1,6 +1,6 @@
 <macros>
     <token name="@TOOL_VERSION@">1.3</token>
-    <token name="@VERSION_SUFFIX@">1</token>
+    <token name="@VERSION_SUFFIX@">2</token>
     <xml name="bio_tools">
         <xrefs>
             <xref type="bio.tools">merqury</xref>
--- a/merqury.xml	Thu Nov 11 16:38:42 2021 +0000
+++ b/merqury.xml	Mon Apr 25 11:20:41 2022 +0000
@@ -17,7 +17,10 @@
                 #else
                     && ln -s '$mode.assembly_options.assembly_01' assembly.fasta
                 #end if 
-                && merqury.sh read-db.meryl assembly.fasta ${label}
+                && merqury.sh read-db.meryl assembly.fasta ${label} 
+                #if 'log' in $output_selector
+                    &> $log_file
+                #end if
                 && mv ${label}* output_files
                 && find . -maxdepth 1 -name 'assembly_only*' -type f -print0 | xargs -0r mv -t output_files
             #else
@@ -32,6 +35,9 @@
                     && ln -s '$mode.assembly_options.assembly_02' assembly_02.fasta
                 #end if 
                 && merqury.sh read-db.meryl assembly_01.fasta assembly_02.fasta ${label}
+                #if 'log' in $output_selector
+                    &> $log_file
+                #end if
                 && mv ${label}* output_files
                 && find . -maxdepth 1 -name 'assembly_only*' -type f -print0 | xargs -0r mv -t output_files
             #end if
@@ -47,6 +53,9 @@
                     && ln -s '$mode.assembly_options.assembly_01' assembly.fasta
                 #end if 
                 && merqury.sh read-db.meryl pat.meryl mat.meryl assembly.fasta ${label}
+                #if 'log' in $output_selector
+                    &> $log_file
+                #end if
                 && mv ${label}* output_files
                 && find . -maxdepth 1 -name 'assembly_only*' -type f -print0 | xargs -0r mv -t output_files
             #else
@@ -61,10 +70,14 @@
                     && ln -s '$mode.assembly_options.assembly_02' assembly_02.fasta
                 #end if
                 && merqury.sh read-db.meryl pat.meryl mat.meryl assembly_01.fasta assembly_02.fasta ${label}
+                #if 'log' in $output_selector
+                    &> $log_file
+                #end if
                 && mv ${label}* output_files
                 && find . -maxdepth 1 -name 'assembly_only*' -type f -print0 | xargs -0r mv -t output_files
             #end if
         #end if
+        
     ]]>    </command>
     <inputs>
         <conditional name="mode">
@@ -144,6 +157,7 @@
             <option value="stats" selected="true">Stats file</option>
             <option value="bed">BED: hap-mer tracks</option>
             <option value="wig">WIG: hap-mer tracks</option>
+            <option value="log">Log file</option>
         </param>
     </inputs>
     <outputs>
@@ -171,6 +185,9 @@
             <discover_datasets pattern="(?P&lt;name&gt;.+)\.stats" format="tabular" directory="output_files"/>
             <filter>"stats" in output_selector</filter>
         </collection>
+        <data name="log_file" format="txt" label="${tool.name} on ${on_string}: log file">
+            <filter>"log" in output_selector</filter>
+        </data>
     </outputs>
     <tests>
         <!--Test 01: trio mode-->
@@ -300,6 +317,26 @@
                 <element name="output_04" file="output_04_qv.tabular" ftype="tabular"/>
             </output_collection>
         </test>
+        <!--Test 05: log file-->
+        <test expect_num_outputs="2">
+            <conditional name="mode">
+                <param name="options" value="trio"/>
+                <param name="meryldb_F1" value="child.meryldb" ftype="meryldb"/>
+                <param name="meryldb_PAT" value="pat.meryldb" ftype="meryldb"/>
+                <param name="meryldb_MAT" value="mat.meryldb" ftype="meryldb"/>
+                <conditional name="assembly_options">
+                    <param name="number_assemblies" value="two"/>
+                    <param name="assembly_01" value="assembly.fasta.gz" ftype="fasta.gz"/>
+                    <param name="assembly_02" value="assembly_02.fasta.gz" ftype="fasta.gz"/>
+                </conditional>
+            </conditional>
+            <param name="label" value="output_05"/>
+            <param name="output_selector" value="qv,log"/>
+            <output_collection name="qv_files" type="list" count="1">
+                <element name="output_05" file="output_04_qv.tabular" ftype="tabular"/>
+            </output_collection>
+            <output name="log_file" file="output_05_log.txt" ftype="txt" lines_diff='4'/>
+        </test>
     </tests>
     <help><![CDATA[
 .. class:: infomark
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/output_05_log.txt	Mon Apr 25 11:20:41 2022 +0000
@@ -0,0 +1,59 @@
+read: read-db.meryl
+
+Haplotype dbs provided.
+Running Merqury in trio mode...
+
+hap1: pat.meryl
+hap2: mat.meryl
+asm1: assembly_01.fasta
+asm2: assembly_02.fasta
+out : output_05
+
+
+Get spectra-cn plots and QV stats
+
+Get blob plots
+
+Get haplotype specfic spectra-cn plots
+
+Get phase blocks
+
+
+Get block N plots
+No modules available..
+# Generate assembly_01.fasta.fai
+
+*** # Found assembly_01.gaps.bed ***
+
+# No gaps found. This is a contig set.
+
+# Generate assembly_02.fasta.fai
+
+*** # Found assembly_02.gaps.bed ***
+
+# No gaps found. This is a contig set.
+
+# Convert output_05.assembly_01.100_20000.phased_block.bed to sizes
+ Result saved as output_05.assembly_01.100_20000.phased_block.sizes
+
+# Plot output_05.assembly_01.100_20000.phased_block.bed
+Rscript /home/laptop/miniconda3/envs/mulled-v1-df114ce4641e6c1c408ddc8230d91a93fc95c8ba1dfeff221f556e667abb43c0/share/merqury/plot/plot_block_N.R -b output_05.assembly_01.100_20000.phased_block.sizes -c output_05.assembly_01.contig.sizes  -o output_05.assembly_01 
+Loading required package: argparse
+Loading required package: ggplot2
+Loading required package: scales
+Error in read.table(dat, header = F) : no lines available in input
+Calls: block_n -> attach_n -> read.table
+Execution halted
+
+# Convert output_05.assembly_02.100_20000.phased_block.bed to sizes
+ Result saved as output_05.assembly_02.100_20000.phased_block.sizes
+
+# Plot output_05.assembly_02.100_20000.phased_block.bed
+Rscript /home/laptop/miniconda3/envs/mulled-v1-df114ce4641e6c1c408ddc8230d91a93fc95c8ba1dfeff221f556e667abb43c0/share/merqury/plot/plot_block_N.R -b output_05.assembly_02.100_20000.phased_block.sizes -c output_05.assembly_02.contig.sizes  -o output_05.assembly_02 
+Loading required package: argparse
+Loading required package: ggplot2
+Loading required package: scales
+Error in read.table(dat, header = F) : no lines available in input
+Calls: block_n -> attach_n -> read.table
+Execution halted
+