<commit_before><tool	id="gedlab-khmer-normalize-by-median"
	name="Normalize By Median"
	version="0.7.1.1"
	force_history_refresh="true">
	
	<description>
		Filters a fastq/fasta file using digital normalization via
	    	median k-mer abundances.
	</description>

	<requirements>
		<requirement
			type="python-module"
			version="0.7">
				khmer
		</requirement>
    	</requirements>
	
	<version_command>
		normalize-by-median.py --version
    	</version_command>

   	<command>
		normalize-by-median.py
		$paired_switch
		#if $parameters.type == "simple"
			--ksize=20
			--n_hashes=4
			--hashsize=$parameters.hashsize
			--cutoff=20
		#else
			--ksize=$parameters.ksize
			--n_hashes=$parameters.n_hashes 
			--hashsize=$parameters.hashsize_specific
			--cutoff=$parameters.cutoff
		#end if
		--out=$output
		#for input in $inputs
			$input
		#end for
	</command>

	<inputs>
		<param	name="inputs"
			multiple="true"
			type="data"
			format="fasta,fastq,fastqsanger,fastqsolexa,fastqillumina"
			label="FAST[AQ] file(s)"
			help="Put in order of precedence such as longest reads first." />

		<param	name="paired_switch"
			type="boolean"
			checked="false"
			truevalue="-p"
			falsevalue=""
			label="Are the inputs interleaved paired ends?"
			help="If so, then selecting this option will process the paired ends together." />
       
		<conditional name="parameters">
			<param	name="type"
				type="select"
				label="Advanced Parameters"
				help="ksize, n_hashess, a specific hashsize, cutoff" >
				<option	value="simple"
					selected="true">
					Hide
				</option>
				<option value="specific">
					Show
				</option>
            		</param>
			<when	value="simple">
				<param	name="hashsize"
					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_hashes"
					type="integer"
					min="1"
					value="4"
					label="n_hashes"
					help="number of hash tables to use" />
				<param	name="hashsize_specifc"
					type="text"
					label="hashsize"
					help="lower bound on the hashsize to use" />
				<param	name="cutoff"
					type="integer"
					min="1"
					value="20"
					label="cutoff" />
			</when>
		</conditional>
	</inputs>
	<outputs>
	       	<!-- later
		<data	name="hash"
			format="data"
			label="${tool.name} hash table from  #echo ', '.join(map(str, $inputs ))#" />
		-->
		<data	name="output"
			format="input" />
	</outputs>
 	<stdio><commit_msg>try to support hash loading and saving cleanly<commit_after><tool	id="gedlab-khmer-normalize-by-median"
	name="Normalize By Median"
	version="0.7.1.1"
	force_history_refresh="true">
	
	<description>
		Filters a fastq/fasta file using digital normalization via
	    	median k-mer abundances.
	</description>

	<requirements>
		<requirement
			type="python-module"
			version="0.7">
				khmer
		</requirement>
    	</requirements>
	
	<version_command>
		normalize-by-median.py --version
    	</version_command>

   	<command>
		normalize-by-median.py
		$paired_switch
		#if $parameters.type == "simple"
			--ksize=20
			--n_hashes=4
			--hashsize=$parameters.hashsize
			--cutoff=20
		#else
			--ksize=$parameters.ksize
			--n_hashes=$parameters.n_hashes 
			--hashsize=$parameters.hashsize_specific
			--cutoff=$parameters.cutoff
		#end if
		#if $save_hashtable
			--savehash=$hash
		#end if
		#if $hashtable_to_load
			--loadhash=$hashtable_to_load
		#end if
		--out=$output
		#for input in $inputs
			$input
		#end for
	</command>

	<inputs>
		<param	name="inputs"
			multiple="true"
			type="data"
			format="fasta,fastq,fastqsanger,fastqsolexa,fastqillumina"
			label="FAST[AQ] file(s)"
			help="Put in order of precedence such as longest reads first." />

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

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

		<param	name="save_hashtable"
			type="boolean"
			label="Save the kmer counts hashtable(s) in a file"
			help="" />

		<conditional name="parameters">
			<param	name="type"
				type="select"
				label="Advanced Parameters"
				help="ksize, n_hashess, a specific hashsize, cutoff" >
				<option	value="simple"
					selected="true">
					Hide
				</option>
				<option value="specific">
					Show
				</option>
            		</param>
			<when	value="simple">
				<param	name="hashsize"
					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_hashes"
					type="integer"
					min="1"
					value="4"
					label="n_hashes"
					help="number of hash tables to use" />
				<param	name="hashsize_specifc"
					type="text"
					label="hashsize"
					help="lower bound on the hashsize to use" />
				<param	name="cutoff"
					type="integer"
					min="1"
					value="20"
					label="cutoff" />
			</when>
		</conditional>
	</inputs>
	<outputs>
		<data	name="hash"
			format="data"
			label="${tool.name} kmer counts hashtable from  #echo ', '.join(map(str, $inputs ))#">
			<filter>save_hashtable == True</filter>
		</data>
		<data	name="output"
			format="input" />
	</outputs>
 	<stdio>
{'fraction_non_alphanumeric': 0.14249525015832806, 'fraction_numerical': 0.008549715009499683, 'mean_word_length': 2.958020050125313, 'pattern_counts': {'":': 0, '<': 101, '<?xml version=': 0, '>': 101, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4716046', 'n_tokens_mistral': 2785, 'n_tokens_neox': 2131, 'n_words': 496}