changeset 22:093678460093 draft

"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cutadapt commit 916aaa04992e36f9324299949b86cccd12d3081d"
author iuc
date Sat, 04 Jul 2020 06:52:59 -0400
parents 104d86c98776
children c4b82dce8335
files cutadapt.xml macros.xml
diffstat 2 files changed, 76 insertions(+), 49 deletions(-) [+]
line wrap: on
line diff
--- a/cutadapt.xml	Thu Mar 05 06:45:31 2020 -0500
+++ b/cutadapt.xml	Sat Jul 04 06:52:59 2020 -0400
@@ -1,4 +1,4 @@
-<tool id="cutadapt" name="Cutadapt" version="1.16.7" profile="17.09">
+<tool id="cutadapt" name="Cutadapt" version="1.16.8" profile="17.09">
     <description>Remove adapter sequences from Fastq/Fasta</description>
     <macros>
         <import>macros.xml</import>
@@ -113,7 +113,7 @@
 #if str($filter_options.max):
     --maximum-length=$filter_options.max
 #end if
-#if $filter_options.max_n:
+#if str($filter_options.max_n):
     --max-n=$filter_options.max_n
 #end if
 #if str( $library.type ) != "single":
@@ -131,16 +131,16 @@
 #end if
 $read_mod_options.trim_n
 #if $read_mod_options.prefix != '':
-    --prefix="$read_mod_options.prefix"
+    --prefix='$read_mod_options.prefix'
 #end if
 #if $read_mod_options.suffix != '':
-    --suffix="$read_mod_options.suffix"
+    --suffix='$read_mod_options.suffix'
 #end if
 #if str($read_mod_options.length) != '0':
     --length=$read_mod_options.length
 #end if
 #if $read_mod_options.length_tag != '':
-    --length-tag="$read_mod_options.length_tag"
+    --length-tag='$read_mod_options.length_tag'
 #end if
 
 '${read1}'
@@ -518,14 +518,14 @@
                 <param name="discard_untrimmed" value="true"/>
                 <param name="min" value="1"/>
                 <param name="max" value="1000"/>
-                <param name="max_n" value="1"/>
+                <param name="max_n" value="0"/>
                 <param name="pair_filter" value="both"/>
             </section>
             <assert_command>
                 <has_text text="--discard-untrimmed"/>
                 <has_text text="--minimum-length=1"/>
                 <has_text text="--maximum-length=1000"/>
-                <has_text text="--max-n=1"/>
+                <has_text text="--max-n=0"/>
                 <has_text text="--pair-filter=both"/>
             </assert_command>
         </test>
--- a/macros.xml	Thu Mar 05 06:45:31 2020 -0500
+++ b/macros.xml	Sat Jul 04 06:52:59 2020 -0400
@@ -6,7 +6,7 @@
 
         #for $a in $library.r1.adapters
             #if $a.adapter_source.adapter_source_list == 'builtin':
-                -a "${a.adapter_source.adapter.fields.name}"='${a.adapter_source.adapter}'
+                -a '${a.adapter_source.adapter.fields.name}'='${a.adapter_source.adapter}'
             #else if $a.adapter_source.adapter_source_list == 'file':
                 -a file:'${a.adapter_source.adapter_file}'
             #else if str($a.adapter_source.adapter_name) != "":
@@ -17,7 +17,7 @@
         #end for
         #for $aa in $library.r1.anywhere_adapters
             #if $aa.anywhere_adapter_source.anywhere_adapter_source_list == 'builtin':
-                -b ${aa.anywhere_adapter_source.anywhere_adapter.fields.name}"='${aa.anywhere_adapter_source.anywhere_adapter}'
+                -b '${aa.anywhere_adapter_source.anywhere_adapter.fields.name}'='${aa.anywhere_adapter_source.anywhere_adapter}'
             #else if $aa.anywhere_adapter_source.anywhere_adapter_source_list == 'file':
                 -b file:'${aa.anywhere_adapter_source.anywhere_adapter_file}'
             #else if str($aa.anywhere_adapter_source.anywhere_adapter_name) != "":
@@ -28,7 +28,7 @@
         #end for
         #for $fa in $library.r1.front_adapters
             #if $fa.front_adapter_source.front_adapter_source_list == 'builtin':
-                -g "${fa.front_adapter_source.front_adapter.fields.name}"='${fa.front_adapter_source.front_adapter}'
+                -g '${fa.front_adapter_source.front_adapter.fields.name}'='${fa.front_adapter_source.front_adapter}'
             #else if $fa.front_adapter_source.front_adapter_source_list == 'file':
                 -g file:'${fa.front_adapter_source.front_adapter_file}'
             #else if str($fa.front_adapter_source.front_adapter_name) != "":
@@ -71,7 +71,7 @@
 
         #for $a in $library.r2.adapters2
             #if $a.adapter_source2.adapter_source_list2 == 'builtin':
-                -A "${a.adapter_source2.adapter2.fields.name}"='${a.adapter_source2.adapter2}'
+                -A '${a.adapter_source2.adapter2.fields.name}'='${a.adapter_source2.adapter2}'
             #else if $a.adapter_source2.adapter_source_list2 == 'file':
                 -A file:'${a.adapter_source2.adapter_file2}'
             #else if str($a.adapter_source2.adapter_name2) != "":
@@ -82,7 +82,7 @@
         #end for
         #for $aa in $library.r2.anywhere_adapters2
             #if $aa.anywhere_adapter_source2.anywhere_adapter_source_list2 == 'builtin':
-                -B "${aa.anywhere_adapter_source2.anywhere_adapter2.fields.name}"='${aa.anywhere_adapter_source2.anywhere_adapter2}'
+                -B '${aa.anywhere_adapter_source2.anywhere_adapter2.fields.name}'='${aa.anywhere_adapter_source2.anywhere_adapter2}'
             #else if $aa.anywhere_adapter_source2.anywhere_adapter_source_list2 == 'file':
                 -B file:'${aa.anywhere_adapter_source2.anywhere_adapter_file2}'
             #else if str($aa.anywhere_adapter_source2.anywhere_adapter_name2) != "":
@@ -93,7 +93,7 @@
         #end for
         #for $fa in $library.r2.front_adapters2
             #if $fa.front_adapter_source2.front_adapter_source_list2 == 'builtin':
-                -G "${fa.front_adapter_source2.front_adapter2.fields.name}"='${fa.front_adapter_source2.front_adapter2}'
+                -G '${fa.front_adapter_source2.front_adapter2.fields.name}'='${fa.front_adapter_source2.front_adapter2}'
             #else if $fa.front_adapter_source2.front_adapter_source_list2  == 'file':
                 -G file:'${fa.front_adapter_source2.front_adapter_file2}'
             #else if str($fa.front_adapter_source2.front_adapter_name2) != "":
@@ -121,6 +121,57 @@
 
     ]]></token>
 
+        <xml name="adapter_sanitizer">
+            <sanitizer>
+                <valid initial="string.digits">
+                    <add value="A"/><!--standard nucleotides-->
+                    <add value="T"/>
+                    <add value="C"/>
+                    <add value="G"/>
+                    
+                    <add value="U"/><!--ambiguous nucleotides-->
+                    <add value="R"/>
+                    <add value="Y"/>
+                    <add value="S"/>
+                    <add value="W"/>
+                    <add value="K"/>
+                    <add value="M"/>
+                    <add value="B"/>
+                    <add value="D"/>
+                    <add value="H"/>
+                    <add value="V"/>
+                    <add value="N"/>
+
+                    <add value="X"/><!-- don't match any nucleotide-->
+                    
+                    <add value="{"/><!--specify repeats .. needs digits which are added as default-->
+                    <add value="}"/>
+
+                    <add value="^"/><!--anchoring-->
+                    <add value="$"/>
+                    <add value="."/>
+                    <add value="("/><!--specify what to keep-->
+                    <add value=")"/>
+
+                </valid>
+            </sanitizer>
+        </xml>
+        
+        <xml name="adapter" token_name="" token_argument="" token_value="" token_label="">
+            <param name="@NAME@" argument="@ARGUMENT@" type="text" value="@VALUE@" label="@LABEL@">
+                <expand macro="adapter_sanitizer"/>
+            </param>
+        </xml>
+        
+        <xml name="adapter_select" token_name="" token_argument="" token_label="">
+            <param name="@NAME@" argument="@ARGUMENT@" type="select" label="@LABEL@">
+                <options from_data_table="adapters">
+                    <filter type="sort_by" column="1" />
+                </options>
+                <expand macro="adapter_sanitizer"/>
+            </param>
+        </xml>
+
         <xml name="single_end_options" >
 
             <section name="r1" title="Read 1 Options" expanded="True">
@@ -135,15 +186,11 @@
 
                         <when value="user">
                             <param name="adapter_name" type="text" value="" optional="True" label="Enter custom 3' adapter name (Optional if Multiple output is 'No')" />
-                            <param name="adapter" argument="-a" type="text" value="AATTGGCC" label="Enter custom 3' adapter sequence" />
+                            <expand macro="adapter" name="adapter" argument="-a" type="text" value="AATTGGCC" label="Enter custom 3' adapter sequence" />
                         </when>
 
                         <when value="builtin">
-                            <param name="adapter" argument="-a" type="select" label="Choose 3' adapter">
-                                <options from_data_table="adapters">
-                                    <filter type="sort_by" column="1" />
-                                </options>
-                            </param>
+                            <expand macro="adapter_select" name="adapter" argument="-a" label="Choose 3' adapter"/>
                         </when>
 
                         <when value="file">
@@ -162,14 +209,10 @@
 
                         <when value="user">
                             <param name="front_adapter_name" type="text" value="" optional="True" label="Enter custom 5' adapter name (Optional if Multiple output is 'No')" />
-                            <param name="front_adapter" argument="-g" type="text" value="AATTGGCC" label="Enter custom 5' adapter sequence" />
+                            <expand macro="adapter" name="front_adapter" argument="-g" value="AATTGGCC" label="Enter custom 5' adapter sequence" />
                         </when>
                         <when value="builtin">
-                            <param name="front_adapter" argument="-g" type="select" label="Choose 5' adapter">
-                                <options from_data_table="adapters">
-                                    <filter type="sort_by" column="1" />
-                                </options>
-                            </param>
+                            <expand macro="adapter_select" name="front_adapter" argument="-g" label="Choose 5' adapter"/>
                         </when>
                         <when value="file">
                             <param name="front_adapter_file" argument="-g" format="fasta" type="data" help="Should be of datatype &quot;FASTA&quot;" label="Choose file containing 5' adapters" />
@@ -187,14 +230,10 @@
 
                         <when value="user">
                             <param name="anywhere_adapter_name" type="text" value="" optional="True" label="Enter custom 5' or 3' adapter name (Optional if Multiple output is 'No')"  />
-                            <param name="anywhere_adapter" argument="-b" type="text" value="AATTGGCC" label="Enter custom 5' or 3' adapter sequence" />
+                            <expand macro="adapter" name="anywhere_adapter" argument="-b" value="AATTGGCC" label="Enter custom 5' or 3' adapter sequence" />
                         </when>
                         <when value="builtin">
-                            <param name="anywhere_adapter" argument="-b" type="select" label="Choose 5' or 3' adapter">
-                                <options from_data_table="adapters">
-                                    <filter type="sort_by" column="1" />
-                                </options>
-                            </param>
+                            <expand macro="adapter_select" name="anywhere_adapter" argument="-b" label="Choose 5' or 3' adapter"/>
                         </when>
                         <when value="file">
                             <param name="anywhere_adapter_file" argument="-b" format="fasta" type="data" help="Should be of datatype &quot;FASTA&quot;" label="Choose file containing 3' or 5' adapters" />
@@ -226,15 +265,11 @@
 
                         <when value="user">
                             <param name="adapter_name2" type="text" value="" optional="True" label="Enter custom 3' adapter name (Optional)" />
-                            <param name="adapter2" argument="-A" type="text" label="Enter custom 3' adapter sequence" value="AATTGGCC" />
+                            <expand macro="adapter" name="adapter2" argument="-A" label="Enter custom 3' adapter sequence" value="AATTGGCC" />
                         </when>
 
                         <when value="builtin">
-                            <param name="adapter2" argument="-A" type="select" label="Choose 3' adapter">
-                                <options from_data_table="adapters">
-                                    <filter type="sort_by" column="1" />
-                                </options>
-                            </param>
+                            <expand macro="adapter_select" name="adapter2" argument="-A" label="Choose 3' adapter"/>
                         </when>
                         <when value="file">
                             <param name="adapter_file2" argument="-a" format="fasta" type="data" help="Should be of datatype &quot;FASTA&quot;" label="Choose file containing 3' adapters" />
@@ -252,14 +287,10 @@
 
                         <when value="user">
                             <param name="front_adapter_name2" type="text" value="" label="Enter custom 5' adapter name (Optional)" />
-                            <param name="front_adapter2" argument="-G" type="text" value="AATTGGCC" label="Enter custom 5' adapter sequence" />
+                            <expand macro="adapter" name="front_adapter2" argument="-G" value="AATTGGCC" label="Enter custom 5' adapter sequence" />
                         </when>
                         <when value="builtin">
-                            <param name="front_adapter2" argument="-G" type="select" label="Choose 5' adapter">
-                                <options from_data_table="adapters">
-                                    <filter type="sort_by" column="1" />
-                                </options>
-                            </param>
+                            <expand macro="adapter_select" name="front_adapter2" argument="-G" label="Choose 5' adapter"/>
                         </when>
                         <when value="file">
                             <param name="front_adapter_file2" argument="-g" format="fasta" type="data" help="Should be of datatype &quot;FASTA&quot;" label="Choose file containing 5' adapters" />
@@ -277,14 +308,10 @@
 
                         <when value="user">
                             <param name="anywhere_adapter_name2" type="text" value="" optional="True" label="Enter custom 5' or 3' adapter name (Optional)" />
-                            <param name="anywhere_adapter2" argument="-B" type="text" label="Enter custom 5' or 3' adapter sequence" value="AATTGGCC" />
+                            <expand macro="adapter" name="anywhere_adapter2" argument="-B" label="Enter custom 5' or 3' adapter sequence" value="AATTGGCC" />
                         </when>
                         <when value="builtin">
-                            <param name="anywhere_adapter2" argument="-B" type="select" label="Choose 5' or 3' adapter">
-                                <options from_data_table="adapters">
-                                    <filter type="sort_by" column="1" />
-                                </options>
-                            </param>
+                            <expand macro="adapter_select" name="anywhere_adapter2" argument="-B" type="select" label="Choose 5' or 3' adapter"/>
                         </when>
                         <when value="file">
                             <param name="anywhere_adapter_file2" argument="-b" format="fasta" type="data" help="Should be of datatype &quot;FASTA&quot;" label="Choose file containing 3' or 5' adapters" />