view GrepFile.xml @ 7:418e58465a5a draft default tip

Uploaded
author geert-vandeweyer
date Mon, 28 Jul 2014 08:09:01 -0400
parents 5ddb40c3017c
children
line wrap: on
line source

<tool id="GrepFile" name="Advanced Grep" version="0.0.1">
  <description></description>
  <requirements>
		<requirement type='package' version='1.92'>perl_module_threads</requirement>
		<requirement type='package' version='1.46'>perl_module_threads_shared</requirement>
		<requirement type='package' version='3.02'>perl_module_Thread_Queue</requirement>

        </requirements>

  <command  interpreter="perl">GrepFile.pl
	-i "$input"
	-o "$output"
	
	## perl/case triggers
	$perl
	 
	## return extra lines after the match (eg fasta/fastq grepping)
	#if $extralines.extra == "true":
		-A $extralines.nr
	#end if

	## grep from file or grep from provided pattern
	#if $PatSource.fromfile == "true":
		-t "file"
		-f "$PatSource.patternfile"
	#else:
		-t "single"
		-f "$PatSource.pattern"
	#end if
  </command>
  <inputs>
    <param name="input" type="data" label="Input file" help="text/tabular/fasta/sam/... file to extract the matches from"/>
    <conditional name="extralines">
      <param name="extra" type="select" label="Fetch Extra Lines" help="Also fetch lines following the matched pattern (eg for fastq extraction based on readname)">
        <option value="true" >Yes</option>
        <option value="false" selected="True">No</option>
      </param>
      <when value="true">
	<param name="nr" type="integer" value="1" label="Extra lines to fetch" />
      </when>
    </conditional>
   <conditional name="PatSource">
      <param name="fromfile" type="select" label="Pattern Source" >
        <option value="true" >Pattern File</option>
        <option value="false" >Single Pattern</option>
      </param>
      <when value="true"> 	<param name="patternfile" type="data" label="Pattern File" help="A text file with one pattern per line" />
     </when>
      <when value="false">
	<param name="pattern" type="text" label="Pattern" help="Provide a valid grep pattern" ><sanitizer sanitize="False" /></param>
	
      </when>
    </conditional>
    <param name="perl" type="select" label="Matching type">
	<option value="">Exact string matching</option>
	<option value="-i">Case Insensitive matching (slower!)</option>
	<option value="-P">Interpret patterns as Perl Regex</option>
    </param>

  </inputs>
  <outputs>
    <data format="input" name="output" metadata_source="input"/>
  </outputs>
    <help>

**What it does**

This tool extends the grepping options available in galaxy. It allowes extracting lines following a match, grepping from a file of patterns, and perl-based matching.

    </help>
</tool>