changeset 6:09a7281d24c5 draft

planemo upload commit 00a7926c285bc4a339bd7deebf40b28f39c7d947-dirty
author devteam
date Tue, 21 Jul 2015 14:12:49 -0400
parents fbf460831036
children d8c9597bfb09
files bwa-mem.xml bwa.xml bwa_macros.xml read_group_macros.xml
diffstat 4 files changed, 58 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/bwa-mem.xml	Tue Jul 21 13:51:02 2015 -0400
+++ b/bwa-mem.xml	Tue Jul 21 14:12:49 2015 -0400
@@ -1,5 +1,5 @@
 <?xml version="1.0"?>
-<tool id="bwa_mem" name="Map with BWA-MEM" version="0.3">
+<tool id="bwa_mem" name="Map with BWA-MEM" version="0.3.1">
   <description>- map medium and long reads (&gt; 100 bp) against reference genome</description>
   <macros>
     <import>read_group_macros.xml</import>
@@ -9,9 +9,7 @@
     <requirement type="package" version="0.7.10.039ea20639">bwa</requirement>
     <requirement type="package" version="1.1">samtools</requirement>
   </requirements>
-  <stdio>
-    <exit_code range="1:" />
-  </stdio>
+  <expand macro="stdio" />
   <command>
     #set $reference_fasta_filename = "localref.fa"
 
@@ -291,7 +289,9 @@
   </inputs>
 
   <outputs>
-    <data format="bam" name="bam_output" label="${tool.name} on ${on_string} (mapped reads in BAM format)"/>
+    <data format="bam" name="bam_output" label="${tool.name} on ${on_string} (mapped reads in BAM format)">
+      <expand macro="dbKeyActionsBwaMem" />
+    </data>
   </outputs>
 
   <tests>
--- a/bwa.xml	Tue Jul 21 13:51:02 2015 -0400
+++ b/bwa.xml	Tue Jul 21 14:12:49 2015 -0400
@@ -1,5 +1,5 @@
 <?xml version="1.0"?>
-<tool id="bwa" name="Map with BWA" version="0.3.0">
+<tool id="bwa" name="Map with BWA" version="0.3.1">
   <description>- map short reads (&lt; 100 bp) against reference genome</description>
   <macros>
     <import>read_group_macros.xml</import>
@@ -70,9 +70,7 @@
     <requirement type="package" version="0.7.10.039ea20639">bwa</requirement>
     <requirement type="package" version="1.1">samtools</requirement>
   </requirements>
-  <stdio>
-    <exit_code range="1:" />
-  </stdio>
+  <expand macro="stdio" />
   <command>
     #set $reference_fasta_filename = "localref.fa"
 
@@ -371,7 +369,9 @@
   </inputs>
 
   <outputs>
-    <data format="bam" name="bam_output" label="${tool.name} on ${on_string} (mapped reads in BAM format)"/>
+    <data format="bam" name="bam_output" label="${tool.name} on ${on_string} (mapped reads in BAM format)">
+      <expand macro="dbKeyActionsBwa" />
+    </data>
   </outputs>
 
   <tests>
--- a/bwa_macros.xml	Tue Jul 21 13:51:02 2015 -0400
+++ b/bwa_macros.xml	Tue Jul 21 14:12:49 2015 -0400
@@ -14,7 +14,51 @@
       #set $rg_string += $format_read_group("\tPI:", $rg_pi)
       #set $rg_string += $format_read_group("\tPU:", $rg_pu)
   </token>
-    
+
+  <xml name="stdio">
+      <stdio>
+          <exit_code range="1:" />
+          <exit_code range=":-1" />
+          <regex match="Error:" />
+          <regex match="Exception:" />
+      </stdio>
+  </xml>
+
+  <macro name="dbKeyActionsBwa">
+    <expand macro="dbKeyActions">
+      <option type="from_data_table" name="bwa_indexes" column="1" offset="0">
+        <filter type="param_value" column="0" value="#" compare="startswith" keep="False"/>
+        <filter type="param_value" ref="reference_source.ref_file" column="0"/>
+      </option>
+    </expand>
+  </macro>
+
+  <macro name="dbKeyActionsBwaMem">
+    <expand macro="dbKeyActions">
+      <option type="from_data_table" name="bwa_mem_indexes" column="1" offset="0">
+        <filter type="param_value" column="0" value="#" compare="startswith" keep="False"/>
+        <filter type="param_value" ref="reference_source.ref_file" column="0"/>
+      </option>
+    </expand>
+  </macro>
+
+  <macro name="dbKeyActions">
+      <actions>
+          <conditional name="reference_source.reference_source_selector">
+              <when value="cached">
+                  <action type="metadata" name="dbkey">
+                      <yield />
+                  </action>
+              </when>
+              <when value="history">
+                  <action type="metadata" name="dbkey">
+                    <option type="from_param" name="reference_source.ref_file" param_attribute="dbkey" />
+                  </action>
+              </when>
+          </conditional>
+      </actions>
+  </macro>
+
   <token name="@RG@">
 -----
 
--- a/read_group_macros.xml	Tue Jul 21 13:51:02 2015 -0400
+++ b/read_group_macros.xml	Tue Jul 21 14:12:49 2015 -0400
@@ -2,7 +2,6 @@
     <!-- Import this at the top of your command block and then
          define rg_auto_name. -->
     <token name="@define_read_group_helpers@">
-#import re
 #def identifier_or_name($input1)
     #if hasattr($input1, 'element_identifier')
         #return $input1.element_identifier
@@ -12,6 +11,7 @@
 #end def
 
 #def clean(name)
+    #import re
     #set $name_clean = re.sub('[^\w\-_\.]', '_', $name)
     #return $name_clean
 #end def
@@ -79,7 +79,7 @@
 
     #if $rg_param('read_group_lb_conditional') is None
         #set $rg_lb = ''
-    #elif $rg_param('read_group_lb_conditional')do_auto_name
+    #elif $rg_param('read_group_lb_conditional').do_auto_name
         #set $rg_lb = $rg_auto_name
     #else
         #set $rg_lb = str($rg_param('read_group_lb_conditional').LB)
@@ -147,7 +147,7 @@
     </xml>
     <xml name="read_group_id_param">
         <param name="ID" type="text" value="" size="20" label="Read group identifier (ID)" help="This value must be unique among multiple samples in your experiment" optional="false">
-        <validator type="empty_field" />
+            <validator type="empty_field" />
         </param>
     </xml>
     <xml name="read_group_id_conditional">