diff computeGCBias.xml @ 1:21d563d5f2b2 draft

Uploaded
author bgruening
date Mon, 05 Aug 2013 10:09:51 -0400
parents 09b65c12a75a
children 1f312af2f8db
line wrap: on
line diff
--- a/computeGCBias.xml	Sat Aug 03 13:42:12 2013 -0400
+++ b/computeGCBias.xml	Mon Aug 05 10:09:51 2013 -0400
@@ -1,24 +1,37 @@
-<tool id="computeGCBias" name="computeGCBias" version="1.0">
+<tool id="computeGCBias" name="computeGCBias" version="1.0.1">
   <description></description>
   <requirements>
-    <requirement type="package" version="1.5.1_98e5d8a61431ea8605c0643d991a1a5d8999b4dc">deepTools</requirement>
+    <requirement type="package" version="1.5.1_59e067cce039cb93add04823c9f51cab202f8c2b">deepTools</requirement>
   </requirements>
   <stdio>
     <exit_code range="0" level="warning" description="Warning" />
   </stdio>
   <command>
+    #import tempfile
+    #set $temp_dir = os.path.abspath(tempfile.mkdtemp())
+
+    #set $temp_bam_handle = tempfile.NamedTemporaryFile( dir=$temp_dir )
+    #set $temp_bam_path = $temp_bam_handle.name + '.bam'
+    #silent $temp_bam_handle.close()
+    #silent os.system("ln -s %s %s" % (str($bamInput), $temp_bam_path))
+    #silent os.system("ln -s %s %s.bai" % (str($bamInput.metadata.bam_index), $temp_bam_path))
+
   computeGCBias
-  --bamfile '$bamInput'
+
+  ##ToDo
+  --numberOfProcessors 4
+
+  --bamfile '$temp_bam_path'
   --species '$species'
   --GCbiasFrequenciesFile $outFileName
   --fragmentLength $fragmentLength
-  
+
   #if $source.ref_source=="history":
     --genome $source.input1
   #else:
     --genome "${source.input1_2bit.fields.path}"
   #end if
-  
+
   #if $advancedOpt.showAdvancedOpt == "yes":
     #if str($advancedOpt.region.value) != '':
       --region '$advancedOpt.region'
@@ -27,60 +40,65 @@
     --binSize '$advancedOpt.binSize'
     --sampleSize '$advancedOpt.sampleSize'
     --regionSize '$advancedOpt.regionSize'
-    
+
     #if $advancedOpt.filterOut:
       --filterOut $advancedOpt.filterOut
     #end if
-    
+
     #if $advancedOpt.extraSampling:
       --extraSampling $advancedOpt.extraSampling
     #end if
-    
+
   #end if
-  
-  #set move=""
+
   #if $output.showOutputSettings == "yes"
       #if $output.saveBiasPlot:
-        --biasPlot biasPlot.png
-        #set move="mv biasPlot.png $biasPlot"
+        --biasPlot biasPlot.png ;
+        mv biasPlot.png $biasPlot
       #end if
   #end if
-  ; $move
+
+  ; rm $temp_dir -rf
 
   </command>
+  <inputs>
 
-  <inputs>
-  
-  <param name="bamInput" format="bam" type="data" label="Input BAM file"
-       help="The BAM file must be sorted and indexed."/>
-  
-  <param name="species" type="text" value="" label="Species name abbreviation" />
-  
-  <conditional name="source">
-    <param name="ref_source" type="select" label="Reference genome">
-        <option value="cached">locally cached</option>
-        <option value="history">in your history</option>
-    </param>
-    <when value="cached">
-        <param name="input1_2bit" type="select" label="Using reference genome" help="If your genome of interest is not listed, contact the Galaxy team">
-            <options from_data_table="deepTools_seqs" />
+      <param name="bamInput" format="bam" type="data" label="Input BAM file"
+        help="The BAM file must be sorted and indexed."/>
+      <!--<param name="species" type="text" value="" label="Species name abbreviation" />-->
+
+        <param name="species" type="select" label="Species name abbreviation">
+            <option value="hg19">hg19</option>
+            <option value="ce10">ce10</option>
+            <option value="dm3">dm3</option>
+            <option value="mm9">mm9</option>
+        </param>
+
+      <conditional name="source">
+        <param name="ref_source" type="select" label="Reference genome">
+            <option value="cached">locally cached</option>
+            <option value="history">in your history</option>
         </param>
-    </when>
-    <when value="history">
-        <param name="input1" type="data" format="twobit" label="Select a reference dataset in 2bit format" />
-    </when>
-  </conditional>
-  <param name="fragmentLength" type="integer" value="300" min="1"
-     label="Fragment length used for the sequencing"
-     help ="If paired-end reads are used the fragment length is computed based from the bam file."/>
-  
-  <conditional name="advancedOpt">
-    <param name="showAdvancedOpt" type="select" label="Show advanced options" >
-        <option value="no" selected="true">no</option>
-        <option value="yes">yes</option>
-      </param>
-      <when value="no" />
-      <when value="yes">
+        <when value="cached">
+            <param name="input1_2bit" type="select" label="Using reference genome" help="If your genome of interest is not listed, contact the Galaxy team">
+                <options from_data_table="deepTools_seqs" />
+            </param>
+        </when>
+        <when value="history">
+            <param name="input1" type="data" format="twobit" label="Select a reference dataset in 2bit format" />
+        </when>
+      </conditional>
+      <param name="fragmentLength" type="integer" value="300" min="1"
+        label="Fragment length used for the sequencing"
+        help ="If paired-end reads are used the fragment length is computed based from the bam file."/>
+
+    <conditional name="advancedOpt">
+        <param name="showAdvancedOpt" type="select" label="Show advanced options" >
+            <option value="no" selected="true">no</option>
+            <option value="yes">yes</option>
+        </param>
+        <when value="no" />
+        <when value="yes">
           <param name="region" type="text" value=""
             label="Region of the genome to limit the operation to"
             help="This is useful when testing parameters to reduce the computing time. The format is chr:start:end, for example &quot;chr10&quot; or &quot;chr10:456700:891000&quot;" />
@@ -102,10 +120,10 @@
            <param name="extraSampling" type="data" format="bed" optional="true"
              label="BED file containing genomic regions for which extra sampling is required because they are underrepresented in the genome"
              help="" />
-      </when>
-  </conditional>
+        </when>
+    </conditional>
 
-  <conditional name="output" >
+    <conditional name="output" >
         <param name="showOutputSettings" type="select" label="Show additional output options" >
         <option value="no" selected="true">no</option>
         <option value="yes">yes</option>
@@ -143,5 +161,4 @@
 .. _Fidel Ramirez: ramirez@ie-freiburg.mpg.de
 
   </help>
-  
 </tool>