diff genMutModel.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/genMutModel.xml	Tue May 15 02:39:53 2018 -0400
@@ -0,0 +1,184 @@
+<tool id="genMutModel"
+      name="genMutModel"
+      version="1.0.0"
+	  profile="16.04">
+  <description>generates a mutation model based on provided mutations. Creates model file for use in NEAT-genReads</description>
+  <requirements>
+    <requirement type="package" version="1.9.1">numpy</requirement>
+    <requirement type="package">matplotlib</requirement>
+  </requirements>
+  <command detect_errors="exit_code">
+    <![CDATA[
+	## Filenames and extensions are important, so make some links to make life easier downstream
+	ln -s $mutation_file mutation_file.vcf
+	#if $in_type.input_type == "built-in":
+	&& ln ${in_type.reference.path} reference.fa
+	#else:
+	&& ln ${in_type.reference} reference.fa
+	#end if
+    && python2 $__tool_directory__/utilities/genMutModel.py
+		-r reference.fa
+		-m mutation_file.vcf
+		-o $genMutModel_modelfile
+		#if $misc.include_file:
+		  -bi $misc.include_file
+		#end if
+		#if $misc.exclude_file:
+		  -be $misc.exclude_file
+		#end if
+		$misc.save_trinuc
+		$misc.no_whitelist
+		$misc.skip_common
+	]]>
+  </command>
+  <inputs>
+
+    <param name="mutation_file"
+	       type="data"
+		   format="vcf"
+		   label="The VCF file to use as the definition of errors in the sequence [-m]"
+		   help="Trinucleotides are identified in the reference genome and the variant file. Frequencies of each trinucleotide transition are calculated and output as a pickle (.p) file" 
+	/>
+	
+	<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>
+
+	<section name="misc"
+			 title="Miscellanous settings"
+			 expanded="false"
+			 help="Miscellanous settings. In/Exclude regions and other settings"
+	>
+		<param name="include_file"
+			   optional="true"
+			   type="data"
+			   format="bed"
+			   label="Only use mutations falling inside this region [-bi]"
+			   help="" 
+		/>
+		
+		<param name="exclude_file"
+			   optional="true"
+			   type="data"
+			   format="bed"
+			   label="Exlude mutations falling inside this region [-be]"
+			   help="Trinucleotides are identified in the reference genome and the variant file. Frequencies of each trinucleotide transition are calculated and output as a pickle (.p) file" 
+		/>
+
+		<param name="save_trinuc"
+			   type="boolean"
+			   checked="false"
+			   truevalue="--save-trinuc"
+			   falsevalue=""
+			   label="Save the trinulceotide counts for ref [--save-trinuc]"
+			   help=""
+		/>
+		
+		<param name="no_whitelist"
+			   type="boolean"
+			   checked="false"
+			   truevalue="--no-whitelist"
+			   falsevalue=""
+			   label="Allow any non-standard reference [--no-whitelist]"
+			   help=""
+		/>
+		
+		<param name="skip_common"
+			   type="boolean"
+			   checked="false"
+			   truevalue="--skip-common"
+			   falsevalue=""
+			   label="Do not save common SNPs and high mutation regions"
+			   help=""
+		/>
+	</section>
+  </inputs>
+  <outputs>
+	<data format="txt"
+		  name="genMutModel_modelfile"
+		  label="${os.path.splitext($mutation_file.name)}_genMutModel.p"
+		  metadata_source="in_type.reference">
+	</data>
+	
+	<data format="simple"
+	      name="trinuc_file"
+		  from_work_dir="reference.fa.trinucCounts"
+	      label="${os.path.splitext($mutation_file.name)}_trinucCounts.tsv"
+	      metadata_source="in_type.reference">
+		  <filter>misc['save_trinuc']</filter>
+	</data>
+
+  </outputs>
+  <help>
+  </help>
+	<tests>
+		
+		<test>
+			<conditional name="in_type">
+				<param name="input_type" value="history"/>
+			  <param name="reference" value="chrMT.fa" format="fasta"/>
+			</conditional>
+			<param name="mutation_file" value="chrMT-PE-VCF-BAM.vcf"/>
+			<output name="genMutModel_modelfile" value="chrMT-PE-VCF-BAM-genMutModel.p" compare="diff"/>
+		</test>
+
+		<test>
+			<conditional name="in_type">
+				<param name="input_type" value="history"/>
+			  <param name="reference" value="chrMT.fa" format="fasta"/>
+			</conditional>
+			<param name="mutation_file" value="chrMT-PE-VCF-BAM.vcf"/>
+			<section name="misc">
+				<param name="include_file" value="chrMT-Targets.bed"/>
+			</section>
+			<output name="genMutModel_modelfile" value="chrMT-PE-VCF-BAM-INCLUDELIST-genMutModel.p" compare="diff"/>
+		</test>
+
+		<test>
+			<conditional name="in_type">
+				<param name="input_type" value="history"/>
+			  <param name="reference" value="chrMT.fa" format="fasta"/>
+			</conditional>
+			<param name="mutation_file" value="chrMT-PE-VCF-BAM.vcf"/>
+			<section name="misc">
+				<param name="exclude_file" value="chrMT-Targets.bed"/>
+			</section>
+			<output name="genMutModel_modelfile" value="chrMT-PE-VCF-BAM-EXCLUDELIST-genMutModel.p" compare="diff"/>
+		</test>
+
+		<test>
+			<conditional name="in_type">
+				<param name="input_type" value="history"/>
+			  <param name="reference" value="chrMT.fa" format="fasta"/>
+			</conditional>
+			<param name="mutation_file" value="chrMT-PE-VCF-BAM.vcf"/>
+			<section name="misc">
+				<param name="save_trinuc" value="true"/>
+				<param name="no_whitelist" value="true"/>
+				<param name="skip_common" value="true"/>
+			</section>
+			<output name="genMutModel_modelfile" value="chrMT-PE-VCF-BAM-BOOLEANS-genMutModel.p" compare="diff"/>
+			<output name="trinuc_file" value="chrMT.fa.trinucCounts" compare="diff"/>
+		</test>
+
+	</tests>
+</tool>
\ No newline at end of file