2
|
1 <tool id="filter_contigs" name="Filter contigs" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="@PROFILE@">
|
0
|
2 <description>from an assembled FASTA file</description>
|
|
3 <macros>
|
|
4 <import>macros.xml</import>
|
|
5 </macros>
|
|
6 <expand macro="requirements"/>
|
|
7 <command detect_errors="exit_code"><![CDATA[
|
|
8 #if $input.is_of_type('fasta.gz'):
|
|
9 gunzip -c '$input' > 'input.fasta' &&
|
|
10 #else:
|
|
11 ln -s '$input' 'input.fasta' &&
|
|
12 #end if
|
2
|
13 #if str($max_min_cond.max_min) == 'max':
|
|
14 faidx -i chromsizes 'input.fasta' | awk '($2 <= $max_min_cond.max_len) {print $1}' | parallel -n1 -n1 \$(which faidx) 'input.fasta' > '$output'
|
|
15 #else:
|
|
16 faidx -i chromsizes 'input.fasta' | awk '($2 > $max_min_cond.min_len) {print $1}' | parallel -n1 -n1 \$(which faidx) 'input.fasta' > '$output'
|
|
17 #end if
|
|
18
|
0
|
19 ]]></command>
|
|
20 <inputs>
|
|
21 <param name="input" type="data" format="fasta,fasta.gz" label="Assembled FASTA file"/>
|
2
|
22 <conditional name="max_min_cond">
|
|
23 <param name="max_min" type="select" label="Use minimum or maximum contig length when filtering?">
|
|
24 <option value="max" selected="true">Maximum - contigs shorter than or equal to this length will be filtered</option>
|
|
25 <option value="min">Minimum - contigs longer than this length will be filtered</option>
|
|
26 </param>
|
|
27 <when value="max">
|
|
28 <param name="max_len" type="integer" value="1500000" min="0" label="Maximum contig length"/>
|
|
29 </when>
|
|
30 <when value="min">
|
|
31 <param name="min_len" type="integer" value="1000" min="0" label="Maximum contig length"/>
|
|
32 </when>
|
|
33 </conditional>
|
0
|
34 </inputs>
|
|
35 <outputs>
|
|
36 <data name="output" format="fasta"/>
|
|
37 </outputs>
|
|
38 <tests>
|
|
39 <test>
|
|
40 <param name="input" value="input.fasta.gz" ftype="fasta.gz"/>
|
|
41 <param name="max_len" value="30000"/>
|
|
42 <output name="output" ftype="fasta">
|
|
43 <assert_contents>
|
|
44 <has_size value="51690"/>
|
|
45 <has_text text=">contig_10"/>
|
|
46 <has_text text=">contig_7"/>
|
|
47 </assert_contents>
|
|
48 </output>
|
|
49 </test>
|
|
50 <test>
|
|
51 <param name="input" value="input2.fasta" ftype="fasta"/>
|
|
52 <param name="max_len" value="30000"/>
|
|
53 <output name="output" ftype="fasta">
|
|
54 <assert_contents>
|
|
55 <has_size value="28492"/>
|
|
56 <has_text text=">contig_7"/>
|
|
57 </assert_contents>
|
|
58 </output>
|
|
59 </test>
|
|
60 </tests>
|
|
61 <help>
|
|
62 **What it does**
|
|
63
|
|
64 Filters contigs from an assembled fasta file that are longer than the specified length.
|
|
65 </help>
|
|
66 <expand macro="citations"/>
|
|
67 </tool>
|
|
68
|