view filter_columns.xml @ 0:e77c9484b2d0 draft default tip

Uploaded
author saskia-hiltemann
date Thu, 22 Oct 2015 09:18:30 -0400
parents
children
line wrap: on
line source

 <tool id="filter_columns" name="Filter Columns" version="1.2">

  <description> filter file based on column values </description>
  
  <command interpreter="bash"> 
  	filter_columns.sh 
  		--infile $infile
  		#for $f in $filters <!--get each var/mastervar file-->
			--filter ${f.column},${f.condition},${f.value}
		#end for
		--outfile_rem $outputfile_removed
		--outfile_ret $outputfile_retained		
  </command>

  <outputs>
	  <data format="input" name="outputfile_removed"  label="${sample} - Removed lines Column filter on ${on_string}" metadata_source="infile"/>
	  <data format="input" name="outputfile_retained" label="${sample} - Retained lines Column filter on ${on_string}" metadata_source="infile"/>
  </outputs>
  
  <inputs>

	<param name="infile" type="data" label="Select input file" help="expects header lines to be indicated by # or > symbols. First line is always considered header line"/>
  	
  	<repeat name="filters" title="Filter" min="1" help="Multiple filters: lines removed if match any of the filters, not all (rules are OR'd, not AND'd)">
		<param name="column"    type="data_column"   data_ref="infile" multiple="False" label="Select Column to filter on"  /> 
		<param name="condition" type="select" label="Remove line if column value.." help="you will receive both file with retained lines and file with removed lines">
			<option value="nonempty">  	non-empty					</option>
			<option value="empty"	>	empty						</option>
			<option value="equals"	>	equals (string or number)	</option>
			<option value="nequals"	>	not equals (string or number)</option>
			<option value="contains"> 	contains (substring) 		</option>
			<option value="ncontains"> 	does not contain (substring) </option>
			<option value="gt"		>	greater than				</option>
			<option value="ge"		>	greater than or equals		</option>
			<option value="lt"		>	less than					</option>
			<option value="le"		>	less than or equals			</option>
		</param>
		
		
		<param name="value" type="text" value="" label="enter number or string unless above option was set to empty or nonempty"/>		
	</repeat>				
  	 
  	<param name="sample"	type="text" value="" label="Output File Name" help="Optional."/>	

  </inputs>

  <help>
  
**What it does**
Concatenates 2 files

  </help>
</tool>