jpayne@0
|
1 <tool id="reads_subsampler" name="Subsample FASTQ Reads" version="1.0.0" python_template_version="3.5">
|
jpayne@0
|
2 <description>to reduce excess genomic coverage</description>
|
jpayne@0
|
3 <requirements>
|
jpayne@0
|
4 </requirements>
|
jpayne@0
|
5 <command detect_errors="exit_code"><![CDATA[
|
jpayne@0
|
6 #if $reads.reads_select == 'collection'
|
jpayne@0
|
7 python3 ${__tool_directory__}/subsamplr.py '$reads.coll.forward' '$reads.coll.reverse' '$downsampled.forward' '$downsampled.reverse' $coverage $genome_size '$seed'
|
jpayne@0
|
8 #else
|
jpayne@0
|
9 #if $reverse
|
jpayne@0
|
10 python3 ${__tool_directory__}/subsamplr.py '$forward' '$reverse' $forward_out $reverse_out $coverage $genome_size '$seed'
|
jpayne@0
|
11 #else
|
jpayne@0
|
12 python3 ${__tool_directory__}/subsamplr.py '$forward' '$forward_out' $coverage $genome_size '$seed'
|
jpayne@0
|
13 #end if
|
jpayne@0
|
14 #end if
|
jpayne@0
|
15 ]]></command>
|
jpayne@0
|
16 <inputs>
|
jpayne@0
|
17 <conditional name="reads">
|
jpayne@0
|
18 <param name="reads_select" type="select" label="Paired-end collection, or two datasets from your history">
|
jpayne@0
|
19 <option value="collection">Paired collection from your history</option>
|
jpayne@0
|
20 <option value="history">Two FASTQ datasets from your history representing paired reads, forward and reverse</option>
|
jpayne@0
|
21 <option value="single">One FASTQ dataset representing single-end sequencing</option>
|
jpayne@0
|
22 </param>
|
jpayne@0
|
23 <when value="collection">
|
jpayne@0
|
24 <param label="Paired reads" name="coll" type="data_collection" format="fastq,fastqsanger,fastq.gz,fastqsanger.gz,fastq.bz2,fastqsanger.bz2" collection_type="paired" />
|
jpayne@0
|
25 </when>
|
jpayne@0
|
26 <when value="history">
|
jpayne@0
|
27 <param label="Forward reads" type="data" name="forward" format="fastq,fastqsanger,fastq.gz,fastqsanger.gz,fastq.bz2,fastqsanger.bz2" />
|
jpayne@0
|
28 <param label="Reverse reads" type="data" name="reverse" format="fastq,fastqsanger,fastq.gz,fastqsanger.gz,fastq.bz2,fastqsanger.bz2" />
|
jpayne@0
|
29 </when>
|
jpayne@0
|
30 <when value="single">
|
jpayne@0
|
31 <param label="Reads" type="data" name="forward" format="fastq,fastqsanger,fastq.gz,fastqsanger.gz,fastq.bz2,fastqsanger.bz2" />
|
jpayne@0
|
32 </when>
|
jpayne@0
|
33 </conditional>
|
jpayne@0
|
34 <param name="coverage" type="integer" label="Maximum Coverage" value="200" />
|
jpayne@0
|
35 <param name="genome_size" type="select" label="Assumed Genome Size">
|
jpayne@0
|
36 <option value="4500000">Salmonella, E. Coli (4500000)</option>
|
jpayne@0
|
37 <option value="2700000">Listeria (2700000)</option>
|
jpayne@0
|
38 <option value="29900">SARS-CoV-2 (29900)</option>
|
jpayne@0
|
39 </param>
|
jpayne@0
|
40 <param name="seed" type="text" value="ed2b99d842cddc1ac81d7c01a0bf0555" label="Random seed (you don't have to change this)"/>
|
jpayne@0
|
41 </inputs>
|
jpayne@0
|
42 <outputs>
|
jpayne@0
|
43 <data name="forward_out" label="${reads.forward}.downsampled" format_source="forward">
|
jpayne@0
|
44 <filter>reads['reads_select'] == "history" or reads['reads_select'] == "single"</filter>
|
jpayne@0
|
45 </data>
|
jpayne@0
|
46 <data name="reverse_out" label="$reads.forward}.downsampled" format_source="reverse">
|
jpayne@0
|
47 <filter>reads['reads_select'] == "history"</filter>
|
jpayne@0
|
48 </data>
|
jpayne@0
|
49 <collection name="downsampled" type="paired" label="${reads.coll.name}" structured_like="reads|coll" format_source="reads|coll">
|
jpayne@0
|
50 <filter>reads['reads_select'] == "collection"</filter>
|
jpayne@0
|
51 <data name="forward" label="${reads.coll.forward.name}.downsampled" format_source="reads.coll.forward" />
|
jpayne@0
|
52 <data name="reverse" label="${reads.coll.reverse.name}.downsampled" format_source="reads.coll.reverse" />
|
jpayne@0
|
53 </collection>
|
jpayne@0
|
54 </outputs>
|
jpayne@0
|
55 <tests>
|
jpayne@0
|
56 <test>
|
jpayne@0
|
57 <conditional name="reads">
|
jpayne@0
|
58 <param name="reads_select" value="collection" />
|
jpayne@0
|
59 <param name="coll">
|
jpayne@0
|
60 <collection type="paired">
|
jpayne@0
|
61 <element name="forward" value="forward.fastq" ftype="fastqsanger" />
|
jpayne@0
|
62 <element name="reverse" value="reverse.fastq" ftype="fastqsanger" />
|
jpayne@0
|
63 </collection>
|
jpayne@0
|
64 </param>
|
jpayne@0
|
65 </conditional>
|
jpayne@0
|
66 <param name="coverage" value="20" />
|
jpayne@0
|
67 <param name="genome_size" value="29900" />
|
jpayne@0
|
68 <output_collection name="downsampled" type="paired">
|
jpayne@0
|
69 <element name="forward" file="forward_out.fastq" />
|
jpayne@0
|
70 <element name="reverse" file="reverse_out.fastq" />
|
jpayne@0
|
71 </output_collection>
|
jpayne@0
|
72 </test>
|
jpayne@0
|
73 <test>
|
jpayne@0
|
74 <conditional name="reads">
|
jpayne@0
|
75 <param name="reads_select" value="history" />
|
jpayne@0
|
76 <param name="forward" value="forward.fastq" />
|
jpayne@0
|
77 <param name="reverse" value="reverse.fastq" />
|
jpayne@0
|
78 </conditional>
|
jpayne@0
|
79 <param name="coverage" value="20" />
|
jpayne@0
|
80 <param name="genome_size" value="29900" />
|
jpayne@0
|
81 <output name="forward_out" value="forward_out.fastq" />
|
jpayne@0
|
82 <output name="reverse_out" value="reverse_out.fastq" />
|
jpayne@0
|
83 </test>
|
jpayne@0
|
84 <test>
|
jpayne@0
|
85 <conditional name="reads">
|
jpayne@0
|
86 <param name="reads_select" value="history" />
|
jpayne@0
|
87 <param name="forward" value="forward.fastq.gz" />
|
jpayne@0
|
88 <param name="reverse" value="reverse.fastq.gz" />
|
jpayne@0
|
89 </conditional>
|
jpayne@0
|
90 <param name="coverage" value="20" />
|
jpayne@0
|
91 <param name="genome_size" value="29900" />
|
jpayne@0
|
92 <output name="forward_out" value="forward_out.fastq.gz" decompress="true" />
|
jpayne@0
|
93 <output name="reverse_out" value="reverse_out.fastq.gz" decompress="true" />
|
jpayne@0
|
94 </test>
|
jpayne@0
|
95 <test>
|
jpayne@0
|
96 <conditional name="reads">
|
jpayne@0
|
97 <param name="reads_select" value="history" />
|
jpayne@0
|
98 <param name="forward" value="forward.fastq.bz2" />
|
jpayne@0
|
99 <param name="reverse" value="reverse.fastq.bz2" />
|
jpayne@0
|
100 </conditional>
|
jpayne@0
|
101 <param name="coverage" value="20" />
|
jpayne@0
|
102 <param name="genome_size" value="29900" />
|
jpayne@0
|
103 <output name="forward_out" value="forward_out.fastq.bz2" decompress="true" />
|
jpayne@0
|
104 <output name="reverse_out" value="reverse_out.fastq.bz2" decompress="true" />
|
jpayne@0
|
105 </test>
|
jpayne@0
|
106 </tests>
|
jpayne@0
|
107 <help><![CDATA[
|
jpayne@0
|
108 Randomly subsample single or paired-end FASTQ reads to target a certain genomic coverage depth.
|
jpayne@0
|
109 ]]></help>
|
jpayne@0
|
110 <citations />
|
jpayne@0
|
111 </tool> |