annotate filter_contigs.xml @ 2:1442e77ee8e9 draft default tip

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