changeset 4:095c349b4343 draft

planemo upload commit 76cbd559320d2a639e35ed10cb2d9522a5a77ae0
author iuc
date Mon, 16 Apr 2018 16:38:19 -0400
parents 853f74e08009
children a211847807c4
files macros.xml umi-tools_whitelist.xml
diffstat 2 files changed, 71 insertions(+), 65 deletions(-) [+]
line wrap: on
line diff
--- a/macros.xml	Sat Mar 31 17:36:28 2018 -0400
+++ b/macros.xml	Mon Apr 16 16:38:19 2018 -0400
@@ -1,5 +1,41 @@
 <?xml version="1.0"?>
 <macros>
+    <macro name="barcode2_conditional" >
+        <conditional name="barcode">
+            <param name="barcode_select" argument="--split-barcode" type="select" label="Barcode on both reads?">
+                <option value="first_read_only">Barcode on first read only</option>
+                <option value="both_reads">Barcode on both reads</option>
+            </param>
+            <when value="first_read_only"/>
+            <when value="both_reads">
+                <param name="bc_pattern2" argument="--bc-pattern2" type="text" value="" label="Barcode pattern for second read"
+                       help="Use this option to specify the format of the UMI/barcode for
+                             the second read pair if required." >
+                </param>
+            </when>
+        </conditional>
+    </macro>
+    <xml name="input_types">
+        <conditional name="input_type">
+            <param name="type" type="select" label="Library type">
+                <option value="single">Single-end</option>
+                <option value="paired">Paired-end</option>
+                <option value="paired_collection">Paired-end Dataset Collection</option>
+            </param>
+            <when value="single">
+                <param name="input_single" type="data" format="fastq,fastq.gz" label="Reads in FASTQ format" />
+            </when>
+            <when value="paired">
+                <param name="input_read1" type="data" format="fastq,fastq.gz" label="Reads in FASTQ format" />
+                <param name="input_read2" type="data" format="fastq,fastq.gz" label="Reads in FASTQ format" />
+                <expand macro="barcode2_conditional" />
+            </when>
+            <when value="paired_collection">
+                <param name="input_readpair" type="data_collection" collection_type="paired" format="fastq,fastq.gz" label="Reads in FASTQ format" />
+                <expand macro="barcode2_conditional" />
+            </when>
+        </conditional>
+    </xml>
     <xml name="citations">
         <citations>
             <citation type="doi">10.1101/gr.209601.116</citation>
@@ -20,4 +56,33 @@
         </requirements>
     </xml>
     <token name="@VERSION@">0.5.3</token>
+    <token name="@COMMAND_LINK@"><![CDATA[
+        #set $gz = False
+        #if $input_type.type == 'single':
+            #if $input_type.input_single.is_of_type("fastq.gz", "fastqsanger.gz"):
+                ln -s '$input_type.input_single' input_single.gz &&
+                #set $gz = True
+            #else
+                ln -s '$input_type.input_single' input_single.txt &&
+            #end if
+        #elif $input_type.type == 'paired':
+            #if $input_type.input_read1.is_of_type("fastq.gz", "fastqsanger.gz"):
+                ln -s '$input_type.input_read1' input_read1.gz &&
+                ln -s '$input_type.input_read2' input_read2.gz &&
+                #set $gz = True
+            #else
+                ln -s '$input_type.input_read1' input_read1.txt &&
+                ln -s '$input_type.input_read2' input_read2.txt &&
+            #end if
+        #else  ## paired_collection
+            #if $input_type.input_readpair.forward.is_of_type("fastq.gz", "fastqsanger.gz"):
+                ln -s '$input_type.input_readpair.forward' input_read1.gz &&
+                ln -s '$input_type.input_readpair.reverse' input_read2.gz &&
+                #set $gz = True
+            #else
+                ln -s '$input_type.input_readpair.forward' input_read1.txt &&
+                ln -s '$input_type.input_readpair.reverse' input_read2.txt &&
+            #end if
+        #end if
+    ]]></token>
 </macros>
--- a/umi-tools_whitelist.xml	Sat Mar 31 17:36:28 2018 -0400
+++ b/umi-tools_whitelist.xml	Mon Apr 16 16:38:19 2018 -0400
@@ -2,51 +2,10 @@
     <description>Extract cell barcodes from FASTQ files</description>
     <macros>
         <import>macros.xml</import>
-        <macro name="barcode2_conditional" >
-            <conditional name="barcode">
-                <param name="barcode_select" argument="--split-barcode" type="select" label="Barcode on both reads?">
-                    <option value="first_read_only">Barcode on first read only</option>
-                    <option value="both_reads">Barcode on both reads</option>
-                </param>
-                <when value="first_read_only"/>
-                <when value="both_reads">
-                    <param name="bc_pattern2" argument="--bc-pattern2" type="text" value="" label="Barcode pattern for second read"
-                           help="Use this option to specify the format of the UMI/barcode for
-                                 the second read pair if required.">
-                    </param>
-                </when>
-            </conditional>
-        </macro>
     </macros>
     <expand macro="requirements" />
     <command detect_errors="exit_code"><![CDATA[
-        #set $gz = False
-        #if $input_type.type == 'single':
-            #if $input_type.input_single.is_of_type("fastq.gz", "fastqsanger.gz"):
-                ln -s '$input_type.input_single' input_single.gz &&
-                #set $gz = True
-            #else
-                ln -s '$input_type.input_single' input_single.txt &&
-            #end if
-        #elif $input_type.type == 'paired':
-            #if $input_type.input_read1.is_of_type("fastq.gz", "fastqsanger.gz"):
-                ln -s '$input_type.input_read1' input_read1.gz &&
-                ln -s '$input_type.input_read2' input_read2.gz &&
-                #set $gz = True
-            #else
-                ln -s '$input_type.input_read1' input_read1.txt &&
-                ln -s '$input_type.input_read2' input_read2.txt &&
-            #end if
-        #else  ## paired_collection
-            #if $input_type.input_readpair.forward.is_of_type("fastq.gz", "fastqsanger.gz"):
-                ln -s '$input_type.input_readpair.forward' input_read1.gz &&
-                ln -s '$input_type.input_readpair.reverse' input_read2.gz &&
-                #set $gz = True
-            #else
-                ln -s '$input_type.input_readpair.forward' input_read1.txt &&
-                ln -s '$input_type.input_readpair.reverse' input_read2.txt &&
-            #end if
-        #end if
+        @COMMAND_LINK@
 
         umi_tools whitelist
             --bc-pattern='$bc_pattern'
@@ -65,7 +24,7 @@
                     --stdin=input_read1.txt
                     --read2-in=input_read2.txt
                 #end if
-                #if $input_type.barcode.barcode_select == "1":
+                #if $input_type.barcode.barcode_select == "both_reads":
                     --bc-pattern2='$input_type.barcode.bc_pattern2'
                 #end if
             #end if
@@ -105,25 +64,7 @@
             mv OUT_cell_thresholds.tsv '$out_thresh'
     ]]></command>
     <inputs>
-        <conditional name="input_type">
-            <param name="type" type="select" label="Library type">
-                <option value="single">Single-end</option>
-                <option value="paired">Paired-end</option>
-                <option value="paired_collection">Paired-end Dataset Collection</option>
-            </param>
-            <when value="single">
-                <param name="input_single" type="data" format="fastq,fastq.gz" label="Reads in FASTQ format" />
-            </when>
-            <when value="paired">
-                <param name="input_read1" type="data" format="fastq,fastq.gz" label="Reads in FASTQ format" />
-                <param name="input_read2" type="data" format="fastq,fastq.gz" label="Reads in FASTQ format" />
-                <expand macro="barcode2_conditional" />
-            </when>
-            <when value="paired_collection">
-                <param name="input_readpair" type="data_collection" collection_type="paired" format="fastq,fastq.gz" label="Reads in FASTQ format" />
-                <expand macro="barcode2_conditional" />
-            </when>
-        </conditional>
+        <expand macro="input_types" />
         <param name="bc_pattern" argument="--bc-pattern" type="text" label="Barcode pattern for first read"
             help="Use this option to specify the format of the UMI/barcode. Use Ns to
                     represent the random positions and Xs to indicate the bc positions.
@@ -180,8 +121,8 @@
             <param name="type" value="paired" />
             <param name="input_read1" value="t_R1.fastq.gz" ftype="fastq" />
             <param name="input_read2" value="t_R2.fastq.gz" ftype="fastq" />
-            <param name="barcode_select" value="both_reads" />
-            <param name="bc_pattern"  value="CCCNNNNNNNNXXXXX" />
+            <param name="barcode_select" value="first_read_only" />
+            <param name="bc_pattern" value="CCCNNNNNNNNXXXXX" />
             <param name="bc_pattern2" value="CCCCCCCCNNNNNNNN" />
             <param name="method" value="reads" />
             <param name="prime3" value="false" />
@@ -202,7 +143,7 @@
                     <element name="reverse" ftype="fastq.gz" value="t_R2.fastq.gz" />
                 </collection>
             </param>
-            <param name="barcode_select" value="both_reads" />
+            <param name="barcode_select" value="first_read_only" />
             <param name="bc_pattern"  value="CCCNNNNNNNNXXXXX" />
             <param name="bc_pattern2" value="CCCCCCCCNNNNNNNN" />
             <param name="method" value="reads" />