9
|
1 <tool id="single_fastq_filtering" name="Preprocessing of FASTQ reads">
|
5
|
2 <stdio>
|
|
3 <exit_code range="1:" level="fatal" description="Error" />
|
|
4 </stdio>
|
0
|
5 <description>
|
9
|
6 Preprocessing of FASTQ read files
|
0
|
7 including trimming, quality filtering, cutadapt filtering and sampling
|
|
8 </description>
|
|
9 <requirements>
|
|
10 <requirement type="package">blast</requirement>
|
|
11 <requirement type="package">cutadapt</requirement>
|
|
12 <requirement type="package">bioconductor-shortread</requirement>
|
|
13 <requirement type="package">r-optparse</requirement>
|
|
14 </requirements>
|
|
15 <command interpreter="bash">
|
|
16 single_fastq_filtering_wrapper.sh -a ${A} -o ${output} -c ${cut_off} -p ${percent_above} -N ${max_n} -G ${png_output}
|
|
17
|
|
18 #if $sampling.sequence_sampling :
|
|
19 -n $sampling.sample_size
|
|
20 #end if
|
|
21
|
|
22 #if $trimming.sequence_trimming :
|
|
23 -e $trimming.trim_end -s $trimming.trim_start
|
|
24 #end if
|
|
25
|
|
26 #if $cutadapt.use_custom :
|
|
27 -C "${cutadapt.custom_options}"
|
|
28 #end if
|
|
29
|
|
30 #if $similarity_filtering.include :
|
|
31 -F "${similarity_filtering.filter_database}"
|
|
32 #end if
|
|
33
|
|
34
|
|
35 </command>
|
|
36
|
|
37 <inputs>
|
9
|
38 <param format="fastq,fastq.gz" type="data" name="A" label="Reads in FASTQ format" />
|
0
|
39 <conditional name="sampling">
|
9
|
40 <param name="sequence_sampling" type="boolean" truevalue="true" falsevalue="false" checked="False" label="Read sampling"/>
|
0
|
41 <when value="false">
|
|
42 <!-- do nothing here -->
|
|
43 </when>
|
|
44 <when value="true">
|
9
|
45 <param name="sample_size" type="integer" label="Sample size (number of reads)" help="How many reads should be sampled" value="500000" min="0"/>
|
0
|
46 </when>
|
|
47 </conditional>
|
|
48
|
10
|
49 <param type="integer" name="cut_off" label="Quality cutoff" value="10" min="0" help="See below how to correctly set the quality cutoff" />
|
9
|
50 <param type="integer" name="percent_above" label="Percent above cutoff" value="95" min="0"
|
10
|
51 help="Percentage of bases in the read that must have quality equal to or higher than the cutoff value" />
|
0
|
52
|
|
53 <conditional name="trimming">
|
9
|
54 <param name="sequence_trimming" type="boolean" truevalue="true" falsevalue="false" checked="False" label="Trim reads"/>
|
0
|
55 <when value="false">
|
|
56 <!-- do nothing here -->
|
|
57 </when>
|
|
58 <when value="true">
|
9
|
59 <param type="integer" name="trim_start" label="Start position" value="1" min="1"
|
|
60 help="Reads are trimmed at the specified start" />
|
|
61 <param type="integer" name="trim_end" label="End position" value="100" min="1"
|
|
62 help="Reads are trimmed to the specified end position, shorted sequences are discarded" />
|
0
|
63 </when>
|
|
64
|
|
65 </conditional>
|
9
|
66 <param name="max_n" type="integer" label="maximum Ns" help="Maximal number of Ns allowed in reads" value="0" min="0" max="10"/>
|
0
|
67
|
|
68 <conditional name="cutadapt">
|
9
|
69 <param name="use_custom" type="boolean" truevalue="true" falsevalue="false" checked="False" label="Custom cutadapt options"/>
|
0
|
70 <when value="false">
|
|
71 <!-- do nothing here -->
|
|
72 </when>
|
|
73 <when value="true">
|
9
|
74 <param name="custom_options" type="text" area="True" size="8x30" label="Custom options" help="Consult cutadapt for usage" value="">
|
0
|
75 <sanitizer sanitize="False"/>
|
|
76 </param>>
|
|
77 </when>
|
|
78 </conditional>
|
|
79
|
|
80 <conditional name="similarity_filtering">
|
|
81 <param name="include" type="boolean" truevalue="true" falsevalue="false" checked="False" label="Use similarity search filtering"/>
|
|
82 <when value="false">
|
|
83 <!-- do nothing here -->
|
|
84 </when>
|
|
85 <when value="true">
|
|
86
|
9
|
87 <param name="filter_database" format="fasta" type="data" label="Sequence filter database" help="Provide DNA sequences in FASTA format. Reads that have at least 90% similarity over 90% of their length to sequence in the filter database will be removed. This option is suitable for removing organellar or other contaminating sequences."/>
|
0
|
88 </when>
|
|
89 </conditional>
|
|
90
|
|
91 </inputs>
|
|
92
|
|
93
|
|
94 <outputs>
|
9
|
95 <data format="fasta" name="output" label="Filtered FASTA reads from datasets ${A.hid}"/>
|
|
96 <data format="png" name="png_output" label="Nucleotide composition after filtering of ${A.hid}"/>"
|
0
|
97 </outputs>
|
|
98
|
|
99 <tests>
|
|
100 <test>
|
|
101 <param name="A" value="ERR215189_1_part.fastq.gz" />
|
|
102 <param name="max_n" value="0"/>
|
|
103 <param name="cut_off" value="10" />
|
|
104 <param name="percent_above" value="95" />
|
|
105 <output name="output" value="single_output.fasta" />
|
|
106 <output name="png_output" value="single_output.png" />
|
|
107 </test>
|
|
108 </tests>
|
|
109
|
|
110 <help>
|
|
111 **What it does**
|
|
112
|
|
113 This tool is designed to perform preprocessing of fastq file. Input files can be
|
|
114 in GNU zipped archive (.gz extension). Reads are filtered based on the quality,
|
|
115 presence of N bases and adapters. All reads which pass the quality filter fill
|
|
116 be writen into output files. If sampling is specified, only sample of sequences
|
|
117 will be returned.
|
|
118
|
|
119 Cutadapt us run with this options::
|
|
120
|
|
121 --anywhere='AATGATACGGCGACCACCGAGATCTACACTCTTTCCCTACACGACGCTCTTCCGATCT'
|
|
122 --anywhere='AGATCGGAAGAGCGTCGTGTAGGGAAAGAGTGTAGATCTCGGTGGTCGCCGTATCATT'
|
|
123 --anywhere='GATCGGAAGAGCACACGTCTGAACTCCAGTCAC'
|
|
124 --anywhere='ATCTCGTATGCCGTCTTCTGCTTG'
|
|
125 --anywhere='CAAGCAGAAGACGGCATACGAGAT'
|
|
126 --anywhere='GTGACTGGAGTTCAGACGTGTGCTCTTCCGATC'
|
|
127 --error-rate=0.05
|
|
128 --times=1 --overlap=15 --discard
|
|
129
|
|
130
|
|
131 **Order of fastq files processing**
|
|
132
|
|
133 1. Trimming (optional)
|
|
134 #. Filter by quality
|
|
135 #. Cutadapt filtering
|
|
136 #. Sampling (optional)
|
|
137 #. Interlacing two fasta files
|
|
138
|
10
|
139 **Quality setting cutoff**
|
0
|
140
|
10
|
141 To correctly set quality cutoff, you need to know how the quality is encoded in your fastq file, default
|
0
|
142 filtering which is suitable for Sanger and Illumina 1.8 encoding is shown below::
|
|
143
|
|
144
|
10
|
145 Default filtering cutoff
|
0
|
146 |
|
|
147 |
|
|
148 V
|
|
149 SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS.....................................................
|
|
150 ..........................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX......................
|
|
151 ...............................IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII......................
|
|
152 .................................JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJ......................
|
|
153 LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL....................................................
|
|
154 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~
|
|
155 | | | | | |
|
|
156 33 59 64 73 104 126
|
|
157 0........................26...31.......40
|
|
158 -5....0........9.............................40
|
|
159 0........9.............................40
|
|
160 3.....9.............................40
|
|
161 0.2......................26...31........41
|
|
162
|
|
163 S - Sanger Phred+33, raw reads typically (0, 40)
|
|
164 X - Solexa Solexa+64, raw reads typically (-5, 40)
|
|
165 I - Illumina 1.3+ Phred+64, raw reads typically (0, 40)
|
|
166 J - Illumina 1.5+ Phred+64, raw reads typically (3, 40)
|
|
167 with 0=unused, 1=unused, 2=Read Segment Quality Control Indicator (bold)
|
|
168 (Note: See discussion above).
|
|
169 L - Illumina 1.8+ Phred+33, raw reads typically (0, 41)
|
|
170
|
|
171 </help>
|
|
172 </tool>
|
|
173
|