view genSeqErrorModel.xml @ 9:441103f02a11 draft

planemo upload commit e96b43f96afce6a7b7dfd4499933aad7d05c955e-dirty
author thondeboer
date Wed, 16 May 2018 02:05:26 -0400
parents 5bcfac4f8116
children
line wrap: on
line source

<tool id="genSeqErrorModel"
      name="genSeqErrorModel"
      version="1.0.0"
	  profile="16.04">
  <description>generates sequence error model for genReads. Creates model file for use in NEAT-genReads</description>
  <requirements>
    <requirement type="package">numpy</requirement>
    <requirement type="package">matplotlib</requirement>
  </requirements>
  <command detect_errors="exit_code">
    <![CDATA[
	#if $lib_type_cond.read1.ext == "fastqsanger.gz":
	  ln -s $lib_type_cond.read1 read1.fq.gz;
	  #set $read1="read1.fq.gz"
	  #if $lib_type_cond.lib_type == 'paired':
	    ln -s $lib_type_cond.read2 read2.fq.gz;
		#set $read2="read2.fq.gz"
	  #end if
	#else
	  ln -s $lib_type_cond.read1 read1.fq;
	  #set $read1="read1.fq"
	  #if $lib_type_cond.lib_type == 'paired':
	    ln -s $lib_type_cond.read2 read2.fq;
		#set $read2="read2.fq"
	  #end if
	#end if
	python2 $__tool_directory__/utilities/genSeqErrorModel.py
	  -i $read1
	#if $lib_type_cond.lib_type == 'paired':
	  -i2 $read2
	#end if
	#if $stats.simulations != '':
	  -s ${stats.simulations}
	#end if
	#if $stats.score_offset != '':
	  -q ${stats.score_offset}
	#end if
	#if $stats.max_qualscore != '':
	  -s ${stats.max_qualscore}
	#end if
	#if $stats.process_cond.process == 'max':
	  -n ${stats.process_cond.max_reads}
	#end if
	-o $genSeqErrorModel_modelfile
	]]>
  </command>
  <inputs>

	<conditional name="lib_type_cond">
	  <param name="lib_type"
	         type="select"
			 label="Single-end or paired-end sequencing library?"
	  >
		<option value="paired">Paired-end</option>
	    <option value="single">Single-end</option>
	  </param>
	    <when value="paired">
		<param name="read1"
			   type="data"
			   format="fastqsanger,fastqsanger.gz"
			   label="The first read"
			   help=""
		/>
		<param name="read2"
			   type="data"
			   format="fastqsanger,fastqsanger.gz"
			   label="The second read"
			   help=""
		/>
	    </when>
		<when value="single">
			<param name="read1"
				   type="data"
				   format="fastqsanger,fastqsanger.gz"
				   label="The first read"
				   help=""
			/>
	    </when>
	</conditional>

	<section name="stats"
			 title="Miscellanous settings"
			 expanded="false"
			 help="The settings for the error rates etc. for the model"
	>
	  <param name="simulations"
	         type="integer"
			 value="1000000"
			 min="1000"
			 optional="true"
			 label="Number of simulation iterations [-s]"
			 help="Default is 1,000,000"
	  />
	  <conditional name="process_cond">
		  <param name="process" type="select" label="Maximum number of reads to process">
			  <option value="all">All</option>
			  <option value="max">Set a maximum number</option>
		  </param>
		  <when value="max">
			  <param name="max_reads"
					 optional="true"
					 type="integer"
					 value="1000000"
					 min="1"
					 label="Maximum number of reads to process"
					 help="Processing all reads is the default [-n]"
			  />
		  </when>
	  </conditional>
	  
	  
	  <param name="score_offset"
			 optional="true"
			 type="integer"
			 label="Quality score offset (Default = 33)"
			 help="There are different quality score offsets (depends on provider). When in doubt, leave at default (33) which is typical for modern Illumina sequencing runs [-q]"
	  />
	  <param name="max_qualscore"
		 type="integer"
		 min="1"
		 optional="true"
		 label="Maximum quality score (Default = 41)"
		 help="Setting the maximum quality score may have an effect on the accuracy of the error model [-Q]"
	  />

	</section>

  </inputs>
  <outputs>
	<data format="txt"
		  name="genSeqErrorModel_modelfile"
		  label="${os.path.splitext($lib_type_cond.read1.name)[0]}_genSeqErrorModel.p"
		  metadata_source="in_type.reference">
	</data>
  </outputs>
  <help>
  </help>
	<tests>
		
		<test>
			<conditional name="lib_type_cond">
				<param name="lib_type" value="single"/>
				<param name="read1" value="chrMT_read1.fq" format="fastqsanger"/>
			</conditional>
			<section name="stats">
				<param name="simulations" value="100000"/>
			</section>
			<assert_stdout has_text="saving model..."/>
		</test>

		<test>
			<conditional name="lib_type_cond">
				<param name="lib_type" value="paired"/>
				<param name="read1" value="chrMT-PE_read1.fq" format="fastqsanger"/>
				<param name="read2" value="chrMT-PE_read2.fq" format="fastqsanger"/>
			</conditional>
			<section name="stats">
				<param name="simulations" value="100000"/>
			</section>
			<assert_stdout has_text="saving model..."/>
		</test>

		<test>
			<conditional name="lib_type_cond">
				<param name="lib_type" value="paired"/>
				<param name="read1" value="chrMT-PE_read1.fq" format="fastqsanger"/>
				<param name="read2" value="chrMT-PE_read2.fq" format="fastqsanger"/>
			</conditional>
			<section name="stats">
				<param name="simulations" value="100000"/>
				<conditional name="process_cond">
					<param name="process" value="max"/>
					<param name="max_reads" value="100"/>
				</conditional>
			</section>
			<assert_stdout has_text="saving model..."/>
		</test>

	</tests>
</tool>