changeset 34:8fbd165f8835

Patch from Bjorn Gruning
author lparsons
date Mon, 04 Nov 2013 16:19:36 -0500
parents 073c77ce5e94
children ff21a055413b
files bam2wig.xml
diffstat 1 files changed, 7 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/bam2wig.xml	Tue Oct 15 12:58:55 2013 -0400
+++ b/bam2wig.xml	Mon Nov 04 16:19:36 2013 -0500
@@ -8,15 +8,12 @@
         <requirement type="package" version="2.3.7">rseqc</requirement>
     </requirements>
     <command>
+        tmp_input_name=\$(mktemp -u);
+        bai='.bai';
 
-        #import tempfile, os
-        #set $tmp_input = tempfile.NamedTemporaryFile()
-        #set $tmp_input_name = $input_singles_tmp_handle.name
-        #silent $tmp_input.close()
-
-        ln -s "${input}" $tmp_input_name &amp;&amp;
-        ln -s "${input.metadata.bam_index}" $tmp_input_name + ".bai" &amp;&amp;
-        bam2wig.py -i "local_input.bam" -s $chromsize -o outfile
+        ln -s "${input}" \$tmp_input_name &amp;&amp;
+        ln -s "${input.metadata.bam_index}" \$tmp_input_name\$bai &amp;&amp;
+        bam2wig.py -i \$tmp_input_name -s $chromsize -o outfile
 
         #if str($strand_type.strand_specific) == "pair"
             -d
@@ -44,8 +41,8 @@
             -u
         #end if
         ;
-        rm $tmp_input_name + ".bai" ;
-        rm $tmp_input_name
+        rm "\$tmp_input_name\$bai";
+        rm \$tmp_input_name
     </command>
     <inputs>
         <param name="input" type="data" label="Input .bam File" format="bam" />