diff computeGC.xml @ 0:6e75a84e9338 draft

planemo upload commit e96b43f96afce6a7b7dfd4499933aad7d05c955e-dirty
author thondeboer
date Tue, 15 May 2018 02:39:53 -0400
parents
children 362e0b0f7024
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/computeGC.xml	Tue May 15 02:39:53 2018 -0400
@@ -0,0 +1,91 @@
+<tool id="computeGC"
+      name="computeGC"
+      version="1.0.0"
+	  profile="16.04">
+  <description>computes GC% coverage bias distribution from sample in BAM format. Creates model file for use in NEAT-genReads</description>
+  <requirements>
+    <requirement type="package" version="2.25.0">bedtools</requirement>
+    <requirement type="package" version="1.9.1">numpy</requirement>
+  </requirements>
+  <command detect_errors="exit_code">
+    <![CDATA[
+    bedtools genomecov -d -ibam $bam_file
+		#if $in_type.input_type == "built-in":
+		  -g ${in_type.reference.path}
+		#else:
+		  -g ${in_type.reference}
+		#end if
+		> out.genomecov
+	&& python2 $__tool_directory__/utilities/computeGC.py
+		#if $in_type.input_type == "built-in":
+		  -r ${in_type.reference.path}
+		#else:
+		  -r ${in_type.reference}
+		#end if
+		-i out.genomecov
+		-o $computeGC_modelfile
+		-w $windowsize
+    ]]>
+  </command>
+  <inputs>
+    <param name="bam_file"
+	       type="data"
+		   format="bam"
+		   label="The BAM file to be used to calculate the GC bias from [-ibam]"
+		   help="This will be used by BEDTOOLS to calculate the coverage for each base as preparation by the computeGC tool" 
+	/>
+	
+	<conditional name="in_type">
+	  <param name="input_type" type="select" label="Use a built-in FASTA file or one from the history?">
+		<option value="built-in">Built-in</option>
+		<option value="history">History file</option>
+	  </param>
+	  <when value="built-in">
+		<param name="reference"
+			   type="select"
+			   label="Select a built-in reference sequence"
+			   help="The reference sequence that will be used as the basis for the simulated reads">
+		  <options from_data_table="all_fasta" />
+		</param>
+	  </when>
+	  <when value="history">
+		<param name="reference"
+			   type="data"
+			   format="fasta"
+			   label="The reference sequence (FASTA format)"
+			   help="The reference sequence that will be used as the basis for the simulated reads"
+		/>
+	  </when>
+	</conditional>
+	
+	<param name="windowsize"
+		 type="integer"
+		 value="10"
+		 size="4"
+		 min="1"
+		 label="Window size"
+		 help="Sliding window length [-R]"
+	/>
+	
+  </inputs>
+  <outputs>
+	<data format="txt"
+		  name="computeGC_modelfile"
+				label="${bam_file.name.replace('.bam','')}_computeGC.p"
+				metadata_source="in_type.reference">
+	</data>
+
+  </outputs>
+  <tests>
+ 		<test>
+			<param name="bam_file" value="chrMT-PE-VCF-BAM.bam"/>
+			<conditional name="in_type">
+				<param name="input_type" value="history"/>
+			  <param name="reference" value="chrMT.fa" format="fasta"/>
+			</conditional>
+			<param name="windowsize" value="10"/>
+			<output name="computeGC_modelfile" file="chrMT-PE-VCF-BAM-computeGC.p" compare="diff"/>
+		</test>
+
+  </tests>
+</tool>
\ No newline at end of file