changeset 18:c2228166c035 draft

"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/emboss_5 commit 4812c313fd8762b11f7fd002436e3a93b4c67f00"
author iuc
date Fri, 20 Nov 2020 16:49:40 +0000
parents bde3097ac0f6
children d0847fe9b443
files emboss_dreg.xml emboss_format_corrector.py emboss_preg.xml macros.xml test-data/dreg.seqtable test-data/preg.seqtable
diffstat 6 files changed, 173 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/emboss_dreg.xml	Tue Dec 03 02:12:56 2019 +0000
+++ b/emboss_dreg.xml	Fri Nov 20 16:49:40 2020 +0000
@@ -1,4 +1,4 @@
-<tool id="EMBOSS: dreg27" name="dreg" version="@VERSION@">
+<tool id="EMBOSS: dreg27" name="dreg" version="@VERSION@+galaxy1">
   <description>Regular expression search of a nucleotide sequence</description>
   <macros>
     <import>macros.xml</import>
@@ -7,12 +7,20 @@
   <command>dreg -sequence '$input1' -outfile '$out_file1' -pattern '$pattern' -raccshow3 "no" -rusashow3 "no" -rdesshow3 "no" -auto</command>
   <inputs>
     <param name="input1" type="data" format="data" label="Sequence 1" />
-    <param name="pattern" type="text" value="(AUG)" label="Regular expression pattern" />
+    <param name="pattern" type="text" value="(AUG)" label="Regular expression pattern">
+      <expand macro="regex_sanitizer"/>
+    </param>
   </inputs>
   <outputs>
     <data name="out_file1" format="dreg" />
   </outputs>
-  <!-- tests not possible since dreg timestamps output file -->
+  <tests>
+    <test>
+      <param name="input1" ftype="fasta" value="2.fasta"/>
+      <param name="pattern" value="g[atcg]ctct{2,2}gcc"/>
+      <output name="out_file1" value="dreg.seqtable" lines_diff="8"/>
+    </test>
+  </tests>
   <help>
     You can view the original documentation here_.
 
--- a/emboss_format_corrector.py	Tue Dec 03 02:12:56 2019 +0000
+++ b/emboss_format_corrector.py	Fri Nov 20 16:49:40 2020 +0000
@@ -3,7 +3,7 @@
 
 
 # Properly set file formats before job run
-def exec_before_job( app, inp_data=None, out_data=None, tool=None, param_dict=None ):
+def exec_before_job(app, inp_data=None, out_data=None, tool=None, param_dict=None):
     # why isn't items an ordered list?
     items = out_data.items()
     items = sorted(items, key=operator.itemgetter(0))
@@ -11,7 +11,7 @@
     # normal filetype correction
     data_count = 1
     for name, data in items:
-        outputType = param_dict.get( 'out_format' + str(data_count), None )
+        outputType = param_dict.get('out_format' + str(data_count), None)
         if outputType is not None:
             if outputType == 'ncbi':
                 outputType = "fasta"
@@ -20,28 +20,28 @@
             elif outputType == 'text':
                 outputType = "txt"
             data = app.datatypes_registry.change_datatype(data, outputType)
-            app.model.context.add( data )
+            app.model.context.add(data)
             app.model.context.flush()
         data_count += 1
 
     # html filetype correction
     data_count = 1
     for name, data in items:
-        wants_plot = param_dict.get( 'html_out' + str(data_count), None )
+        wants_plot = param_dict.get('html_out' + str(data_count), None)
         ext = "html"
         if wants_plot == "yes":
             data = app.datatypes_registry.change_datatype(data, ext)
-            app.model.context.add( data )
+            app.model.context.add(data)
             app.model.context.flush()
         data_count += 1
 
     # png file correction
     data_count = 1
     for name, data in items:
-        wants_plot = param_dict.get( 'plot' + str(data_count), None )
+        wants_plot = param_dict.get('plot' + str(data_count), None)
         ext = "png"
         if wants_plot == "yes":
             data = app.datatypes_registry.change_datatype(data, ext)
-            app.model.context.add( data )
+            app.model.context.add(data)
             app.model.context.flush()
         data_count += 1
--- a/emboss_preg.xml	Tue Dec 03 02:12:56 2019 +0000
+++ b/emboss_preg.xml	Fri Nov 20 16:49:40 2020 +0000
@@ -1,4 +1,4 @@
-<tool id="EMBOSS: preg78" name="preg" version="@VERSION@">
+<tool id="EMBOSS: preg78" name="preg" version="@VERSION@+galaxy1">
   <description>Regular expression search of a protein sequence</description>
   <macros>
     <import>macros.xml</import>
@@ -7,11 +7,20 @@
   <command>preg -sequence '$input1' -outfile '$out_file1' -pattern '$pattern' -auto</command>
   <inputs>
     <param name="input1" type="data" format="data" label="Sequence" />
-    <param name="pattern" type="text" value="(ACD)" label="Regular expression pattern" />
+    <param name="pattern" type="text" value="(ACD)" label="Regular expression pattern">
+      <expand macro="regex_sanitizer"/>
+    </param>
   </inputs>
   <outputs>
     <data name="out_file1" format="preg" />
   </outputs>
+  <tests>
+    <test>
+      <param name="input1" ftype="fasta" value="2.pep"/>
+      <param name="pattern" value="AS-?L"/>
+      <output name="out_file1" value="preg.seqtable" lines_diff="8"/>
+    </test>
+  </tests>
   <help>
     You can view the original documentation here_.
 
--- a/macros.xml	Tue Dec 03 02:12:56 2019 +0000
+++ b/macros.xml	Fri Nov 20 16:49:40 2020 +0000
@@ -19,4 +19,27 @@
             <yield />
         </citations>
     </xml>
+    <xml name="regex_sanitizer">
+        <sanitizer>
+            <valid initial="string.ascii_letters,string.digits">
+                <add value="^"/>
+                <add value="$"/>
+                <add value="("/>
+                <add value=")"/>
+                <add value="|"/>
+                <add value="?"/>
+                <add value="*"/>
+                <add value="+"/>
+                <add value="{"/>
+                <add value="}"/>
+                <add value="\"/>
+                <add value="["/>
+                <add value="]"/>
+                <add value="."/>
+                <add value=","/>
+            </valid>
+        </sanitizer>
+        <validator type="empty_field" />
+        <validator type="regex" message="Pattern must not end with backslash.">.*[^\\]$</validator>
+    </xml>
 </macros>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/dreg.seqtable	Fri Nov 20 16:49:40 2020 +0000
@@ -0,0 +1,34 @@
+########################################
+# Program: dreg
+# Rundate: Thu 19 Nov 2020 16:17:07
+# Commandline: dreg
+#    -sequence /tmp/tmpo6m2ny4d/files/4/b/a/dataset_4ba37f85-26f4-4d07-82eb-e313af066380.dat
+#    -outfile /tmp/tmpo6m2ny4d/files/4/6/e/dataset_46e9ea4f-becf-4442-9075-66c0be3bf67f.dat
+#    -pattern "g[atcg]ctct{2,2}gcc"
+#    -raccshow3 no
+#    -rusashow3 no
+#    -rdesshow3 no
+#    -auto
+# Report_format: seqtable
+# Report_file: /tmp/tmpo6m2ny4d/files/4/6/e/dataset_46e9ea4f-becf-4442-9075-66c0be3bf67f.dat
+########################################
+
+#=======================================
+#
+# Sequence: Sequence     from: 1   to: 561
+# HitCount: 1
+#
+# Pattern: g[atcg]ctct{2,2}gcc
+#
+#=======================================
+
+  Start     End Pattern_name Sequence
+    141     150 regex1       gtctcttgcc
+
+#---------------------------------------
+#---------------------------------------
+
+#---------------------------------------
+# Total_sequences: 1
+# Total_hitcount: 1
+#---------------------------------------
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/preg.seqtable	Fri Nov 20 16:49:40 2020 +0000
@@ -0,0 +1,87 @@
+########################################
+# Program: preg
+# Rundate: Thu 19 Nov 2020 16:17:17
+# Commandline: preg
+#    -sequence /tmp/tmpo6m2ny4d/files/f/6/0/dataset_f609b47c-0fca-4ed4-b83a-d3263a8cfb17.dat
+#    -outfile /tmp/tmpo6m2ny4d/files/7/0/8/dataset_7087e30b-2929-4100-b6d7-1220864626f8.dat
+#    -pattern "ASX?L"
+#    -auto
+# Report_format: seqtable
+# Report_file: /tmp/tmpo6m2ny4d/files/7/0/8/dataset_7087e30b-2929-4100-b6d7-1220864626f8.dat
+########################################
+
+#=======================================
+#
+# Sequence: HSFAU1_3     from: 1   to: 150
+# HitCount: 1
+#
+# Pattern: ASX?L
+#
+#=======================================
+
+  Start     End Pattern_name Sequence
+     47      49 regex1       ASL
+
+#---------------------------------------
+#---------------------------------------
+#=======================================
+#
+# Sequence: HSFAU2_3     from: 1   to: 78
+# HitCount: 1
+#
+# Pattern: ASX?L
+#
+#=======================================
+
+  Start     End Pattern_name Sequence
+     47      49 regex1       ASL
+
+#---------------------------------------
+#---------------------------------------
+#=======================================
+#
+# Sequence: HSFAU3_3     from: 1   to: 151
+# HitCount: 1
+#
+# Pattern: ASX?L
+#
+#=======================================
+
+  Start     End Pattern_name Sequence
+     47      49 regex1       ASL
+
+#---------------------------------------
+#---------------------------------------
+#=======================================
+#
+# Sequence: HSFAU4_3     from: 1   to: 153
+# HitCount: 1
+#
+# Pattern: ASX?L
+#
+#=======================================
+
+  Start     End Pattern_name Sequence
+     48      50 regex1       ASL
+
+#---------------------------------------
+#---------------------------------------
+#=======================================
+#
+# Sequence: HSFAU5_3     from: 1   to: 151
+# HitCount: 1
+#
+# Pattern: ASX?L
+#
+#=======================================
+
+  Start     End Pattern_name Sequence
+     47      49 regex1       ASL
+
+#---------------------------------------
+#---------------------------------------
+
+#---------------------------------------
+# Total_sequences: 5
+# Total_hitcount: 5
+#---------------------------------------