view normalize-by-median.xml @ 34:7611b274ed67

Specify filetypes
author Michael R. Crusoe <mcrusoe@msu.edu>
date Sun, 29 Jun 2014 18:11:02 -0400
parents d067ee282412
children 846232fc30bf
line wrap: on
line source

<tool	id="gedlab-khmer-normalize-by-median"
	name="Normalize By Median"
	version="1.1-4"
	force_history_refresh="true">
	
	<description>
		Filters a fastq/fasta file using digital normalization via
	    	median k-mer abundances.
	</description>
        <macros>
                <token name="@BINARY@">normalize-by-median.py</token>
                <import>macros.xml</import>
        </macros>
        <expand macro="requirements" />
	<command>
		mkdir output;
		cd output;
		normalize-by-median.py
		$paired_switch
		#if $parameters.type == "simple"
			--ksize=20
			--n_tables=4
			--min-tablesize=$parameters.tablesize
			--cutoff=20
		#else
			--ksize=$parameters.ksize
			--n_tables=$parameters.n_tables
			--min-tablesize=$parameters.tablesize_specific
			--cutoff=$parameters.cutoff
		#end if
		#if $save_countingtable
			--savetable=$countingtable
		#end if
		#if $countingtable_to_load
			--loadtable=$countingtable_to_load
		#end if
		--report-total-kmers
		#for input in $inputs
			$input
		#end for
	</command>

	<inputs>
		<expand macro="input_sequences_filenames" />
		<param	name="paired_switch"
			type="boolean"
			checked="false"
			truevalue="--paired"
			falsevalue=""
			label="Are the inputs interleaved paired ends?"
			help="If so, then selecting this option will process the paired ends together." />

		<param	name="countingtable_to_load"
			type="data"
			optional="true"
			label="an optional k-mer counting table to load"
			help="The inputs file(s) will be processed using the kmer counts in the specified k-mer counting table file as a starting point." />

		<param	name="save_countingtable"
			type="boolean"
			label="Save the k-mer counting table(s) in a file"
			help="" />

		<conditional name="parameters">
			<param	name="type"
				type="select"
				label="Advanced Parameters"
				help="ksize, n_tabless, a specific tablesize, cutoff" >
				<option	value="simple"
					selected="true">
					Hide
				</option>
				<option value="specific">
					Show
				</option>
            		</param>
			<when	value="simple">
				<param	name="tablesize"
					type="select"
					label="Sample Type"
					display="radio">
					<option	value="1e9"
						selected="true">
						Microbial Genome
					</option>
					<option value="2e9">
						Animal Transcriptome
					</option>
					<option value="4e9">
						Small Animal Genome or Low-Diversity Metagenome
					</option>
					<option value="16e9">
						Large Animal Genome
					</option>
				</param>
			</when>
			<when	value="specific">
				<param	name="ksize"
					type="integer"
					value="20"
					label="ksize"
					help="k-mer size to use" />
				<param	name="n_tables"
					type="integer"
					min="1"
					value="4"
					label="n_tables"
					help="number of k-mer counting tables to use" />
				<param	name="tablesize_specific"
					type="text"
					label="tablesize"
					help="lower bound on the tablesize to use" />
				<param	name="cutoff"
					type="integer"
					min="1"
					value="20"
					label="cutoff" />
			</when>
		</conditional>
	</inputs>
	<outputs>
		<data	name="countingtable"
			format="data"
			label="${tool.name} k-mer counting table from  #echo ', '.join(map(str, $inputs ))#">
			<filter>save_countingtable == True</filter>
		</data>
		<expand macro="output_sequences" />
	</outputs>
 	<stdio>
        <!-- [HELP] If no exit code rule is defined, the tool will stop if anything is written to STDERR -->
		<exit_code	range="1:"
				level="fatal" />
	</stdio>
	
	<tests>
		<test interactor="api">
			<param name="inputs" value="test-abund-read-2.fa"/>
			<param name="cutoff" value="1" />
			<param name="ksize" value="17" />
			<output name="output">
				<discover_dataset name="test-abund-read-2.fa.keep">
					<assert_contents>
						<has_line_matching expression="GGTTGACGGGGCTCAGGGGG" />
					</assert_contents>
				</discover_dataset>
			</output>
		</test>
		<test interactor="api">
			<param name="inputs" value="test-abund-read-2.fa" />
			<param name="cutoff" value="2" />
			<param name="ksize" value="17" />
			<output name="output">
				<discover_dataset name="test-abund-read-2.fa.keep">
					<assert_contents>
						<has_line_matching expression="GGTTGACGGGGCTCAGGGGG" />
						<has_line_matching expression="GGTTGACGGGGCTCAGGG" />
					</assert_contents>
				</discover_dataset>
			</output>
		</test>
		<test interactor="api">
			<param name="inputs" value="test-abund-read-paired.fa" />
			<param name="cutoff" value="1" />
			<param name="ksize" value="17" />
			<param name="paired" value="true" />
			<output name="output">
				<discover_dataset name="test-abund-read-paired.fa.keep">
					<assert_contents>
						<has_line_matching expression="GGTTGACGGGGCTCAGGGGG" />
						<has_line_matching expression="GGTTGACGGGGCTCAGGG" />
					</assert_contents>
				</discover_dataset>
			</output>
		</test>

	</tests>
    
    <!-- [OPTIONAL] Help displayed in Galaxy -->
    <!--
	<help>
	</help>
    -->    
</tool>