changeset 58:2256bc31d3bf

"planemo upload"
author kkonganti
date Wed, 13 Jul 2022 12:47:22 -0400
parents cea27772bcb8
children a8d6f5950fbf
files cfsan_centriflaken.xml
diffstat 1 files changed, 68 insertions(+), 43 deletions(-) [+]
line wrap: on
line diff
--- a/cfsan_centriflaken.xml	Tue Jul 12 16:56:17 2022 -0400
+++ b/cfsan_centriflaken.xml	Wed Jul 13 12:47:22 2022 -0400
@@ -7,36 +7,46 @@
     <version_command>nextflow -version</version_command>
     <command detect_errors="exit_code"><![CDATA[
 	mkdir -p cpipes-input || exit 1;
-	#for $key in $input.keys()
-	    ln -sf '$input[$key]' './cpipes-input/$key';
-	#end for
-	pwd_path=\$(pwd);
+    pwd_path=\$(pwd);
+    #import os
+    #if (str($input_read_type_cond.input_read_type) == "single_long"):
+	    #for $key in $input_read_type_cond.input.keys()
+	        ln -sf '$input_read_type_cond.input[$key]' './cpipes-input/$key';
+	    #end for
+    #elif (str($input_read_cond.input_read_type) == "paired"):
+        #for $key in $input_read_type_cond.input_pair.keys()
+            #set $read_R1 = os.path.basename($input_read_type_cond.input_pair[$key]['forward'])
+            #set $read_R2 = os.path.basename($input_read_type_cond.input_pair[$key]['reverse'])
+	        ln -sf '$input_read_type_cond.input_pair[$key]['forward']' './cpipes-input/$read_R1';
+            ln -sf '$input_read_type_cond.input_pair[$key]['reverse']' './cpipes-input/$read_R2';
+	    #end for
+    #endif
 	$__tool_directory__/0.2.1/cpipes
-    --pipeline $pipeline
-    #if ($pipeline == "centriflaken"):
+    --pipeline $input_read_type_cond.pipeline
+    #if ($input_read_type_cond.pipeline_cond.pipeline == "centriflaken"):
         --fq_single_end true
         --flye_genome_size '${genome_size}'
-        #if ($long_read_platform == "nanopore_corr"):
+        #if ($input_read_type_cond.pipeline_cond.long_read_platform == "nanopore_corr"):
             --flye_nano_corr true --flye_nano_raw false
-        #elif ($long_read_platform == "nanopore_hq"):
+        #elif ($input_read_type_cond.pipeline_cond.long_read_platform == "nanopore_hq"):
             --flye_nano_hq true --flye_nano_raw false
-        #elif ($long_read_platform == "pacbio_raw"):
+        #elif ($input_read_type_cond.pipeline_cond.long_read_platform == "pacbio_raw"):
             --flye_pacbio_raw true --flye_nano_raw false
-        #elif ($long_read_platform == "pacbio_corr"):
+        #elif ($input_read_type_cond.pipeline_cond.long_read_platform == "pacbio_corr"):
             --flye_pacbio_corr true --flye_nano_raw false
-        #elif ($long_read_platform == "pacbio_hifi"):
+        #elif ($input_read_type_cond.pipeline_cond.long_read_platform == "pacbio_hifi"):
             --flye_pacbio_hifi true --flye_nano_raw false
         #end if
-    #elif ($pipeline == "centriflaken_hy"):
-        #if ($reads_lib_layout == "single"):
+    #elif ($input_read_type_cond.pipeline_cond.pipeline == "centriflaken_hy"):
+        #if (str($input_read_cond.input_read_type) == "single_long"):
             --fq_single_end true
-        #elif ($reads_lib_layout == "paired"):
-            --fq_single_end false --fq2_suffix '${fq2_suffix}'
+        #elif (str($input_read_cond.input_read_type) == "paired"):
+            --fq_single_end false --fq2_suffix '${input_read_cond.fq2_suffix}'
         #end if
     #end if
 	--input \${pwd_path}/cpipes-input
 	--output \${pwd_path}/cpipes-output
-    --fq_suffix '${fq_suffix}'
+    --fq_suffix '${input_read_cond.fq_suffix}'
     #if ($fq_filter_by_len != ""):
         --fq_filter_by_len $fq_filter_by_len
     #end if
@@ -44,35 +54,50 @@
 	--fq_filename_delim_idx $fq_filename_delim_idx
 	--centrifuge_extract_bug '${centrifuge_extract_bug}'
 	-profile kondagac;
-    mv './cpipes-output/${pipeline}-multiqc/multiqc_report.html' './multiqc_report.html';
-    mv './cpipes-output/${pipeline}-results/kraken2_extract_contigs' kraken2_extract_contigs;
-    rm -rf ./cpipes-output;
-    rm -rf ./work
+    mv './cpipes-output/${pipeline}-multiqc/multiqc_report.html' './multiqc_report.html' || exit 1;
+    mv './cpipes-output/${pipeline}-results/kraken2_extract_contigs' kraken2_extract_contigs || exit 1;
+    rm -rf ./cpipes-output || exit 1;
+    rm -rf ./work || exit 1
     ]]></command>
     <inputs>
-        <param name="input" type="data_collection" collection_type="list" format="fastq,fastq.gz,fastqsanger.gz,fastqsanger" label="Input read collection" />
-        <param name="pipeline" type="select" label="CPIPES Workflow name"
-            help="centriflaken: for long reads (Nanopore or PacBio). centriflaken_hy: for short reads (paired or unpaired). Default: centriflaken">
-            <option value="centriflaken" selected="true">centriflaken</option>
-            <option value="centriflaken_hy">centriflaken_hy</option>
-        </param>
-        <param name="reads_lib_layout" type="select" label="Short Read Library Layout"
-            help="Leave this option as Single-End for centriflaken. If the pipeline is centriflaken_hy (i.e for short reads), what is the library layout? Default: Single-End">
-            <option value="single" selected="true">Single-End</option>
-            <option value="paired">Paired-End</option>
-        </param>
-        <param name="long_read_platform" type="select" label="Mention long read sequencing platform and type"
-            help="THIS OPTION IS IGNORED IF THE INPUT READS ARE SHORT READS.">
-            <option value="nanopore_raw" selected="true">Nanopore raw reads, pre-Guppy5 (&lt;20% error)</option>
-            <option value="nanopore_corr">Nanopore reads that were corrected with other methods (&lt;3% error)</option>
-            <option value="nanopore_hq">Nanopore high-quality reads, Guppy5+ SUP or Q20 (5% error)</option>
-            <option value="pacbio_raw">PacBio regular CLR reads (&lt;20% error)</option>
-            <option value="pacbio_corr">PacBio reads that were corrected with other methods (&lt;3% error)</option>
-            <option value="pacbio_hifi">PacBio HiFi reads (&lt;1% error)</option>
-        </param>
-        <param name="fq_suffix" value=".fastq.gz" type="text" label="Suffix of the R1 FASTQ or Unpaired FASTQ"/>
-        <param name="fq2_suffix" value="_R2_001.fastq.gz" type="text" label="Suffix of the R2 FASTQ"
-            help="THIS OPTION IS IGNORED IF THE INPUT READS ARE UNPAIRED/LONG READS."/>
+        <conditional name="input_read_type_cond">
+            <param name="input_read_type" type="select" label="Select the read collection type">
+                <option value="single_long" selected="true">Unpaired reads (i.e. Single-End short reads/Long reads)</option>
+                <option value="paired">Paired-End reads</option>
+            </param>
+            <when value="single_long">
+                <param name="input" type="data_collection" collection_type="list" format="fastq,fastq.gz,fastqsanger.gz,fastqsanger"
+                    label="Dataset list of unpaired short reads / long reads" />
+                <conditional name="pipeline_cond">
+                    <param name="pipeline" type="select" label="CPIPES Workflow name"
+                        help="centriflaken: for long reads (Nanopore or PacBio). centriflaken_hy: for short reads (paired or unpaired). Default: centriflaken">
+                        <option value="centriflaken" selected="true">centriflaken</option>
+                        <option value="centriflaken_hy">centriflaken_hy</option>
+                    </param>
+                    <when value="centriflaken">
+                        <param name="long_read_platform" type="select" label="Mention long read sequencing platform and type">
+                            <option value="nanopore_raw" selected="true">Nanopore raw reads, pre-Guppy5 (&lt;20% error)</option>
+                            <option value="nanopore_corr">Nanopore reads that were corrected with other methods (&lt;3% error)</option>
+                            <option value="nanopore_hq">Nanopore high-quality reads, Guppy5+ SUP or Q20 (5% error)</option>
+                            <option value="pacbio_raw">PacBio regular CLR reads (&lt;20% error)</option>
+                            <option value="pacbio_corr">PacBio reads that were corrected with other methods (&lt;3% error)</option>
+                            <option value="pacbio_hifi">PacBio HiFi reads (&lt;1% error)</option>
+                        </param>
+                    </when>
+                    <when value="centriflaken_hy">
+                        <param name="long_read_platform" value="N/A" type="text" optional="true" label="Mention long read sequencing platform and type"
+                            help="THIS OPTION IS IGNORED IF THE INPUT READS ARE SHORT READS."/>
+                    </when>
+                </conditional>
+                <param name="fq_suffix" value=".fastq.gz" type="text" label="Suffix of the R1 FASTQ or Unpaired FASTQ"/>
+            </when>
+            <when value="paired">
+                <param name="input_pair" type="data_collection" collection_type="list:paired" format="fastq,fastq.gz,fastqsanger.gz,fastqsanger"
+                    label="List of Dataset pairs" />
+                <param name="fq_suffix" value=".fastq.gz" type="text" label="Suffix of the R1 FASTQ or Unpaired FASTQ"/>
+                <param name="fq2_suffix" value="_R2_001.fastq.gz" type="text" label="Suffix of the R2 FASTQ"/>
+            </when>
+        </conditional>
         <param name="fq_filter_by_len" optional="true" value="" type="integer" label="Enter minimum read length to retain before starting the analysis"
             help="Keep this option empty to use default values. Default for centriflaken (long reads) is 4000 bp and for centriflaken_hy (short reads) is 75 bp."/>
         <param name="fq_filename_delim" type="text" value="_" label="File name delimitor by which samples are grouped together (--fq_filename_delim)"