annotate fastq_manipulation.xml @ 0:de14b969d713 draft

Imported from capsule None
author devteam
date Thu, 23 Jan 2014 12:31:03 -0500
parents
children b50aeae8bcaa
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
1 <tool id="fastq_manipulation" name="Manipulate FASTQ" version="1.0.1">
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
2 <options sanitize="False" /> <!-- This tool uses a file to rely all parameter information (actually a dynamically generated python module), we can safely not sanitize any parameters -->
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
3 <requirements>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
4 <requirement type="package" version="1.0.0">galaxy_sequence_utils</requirement>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
5 </requirements>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
6 <description>reads on various attributes</description>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
7 <command interpreter="python">fastq_manipulation.py $input_file $fastq_manipulation_file $output_file $output_file.files_path '${input_file.extension[len( 'fastq' ):]}'</command>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
8 <inputs>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
9 <!-- This tool is purposely over-engineered (e.g. Single option conditionals) to allow easy enhancement with workflow/rerun compatibility -->
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
10 <page>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
11 <param name="input_file" type="data" format="fastqsanger,fastqcssanger" label="FASTQ File" help="Requires groomed data: if your data does not appear here try using the FASTQ groomer."/>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
12 <!-- Match Reads -->
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
13 <repeat name="match_blocks" title="Match Reads">
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
14 <conditional name="match_type">
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
15 <param name="match_type_selector" type="select" label="Match Reads by">
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
16 <option value="identifier">Name/Identifier</option>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
17 <option value="sequence">Sequence Content</option>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
18 <option value="quality">Quality Score Content</option>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
19 </param>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
20 <when value="identifier">
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
21 <conditional name="match">
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
22 <param name="match_selector" type="select" label="Identifier Match Type">
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
23 <option value="regex">Regular Expression</option>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
24 </param>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
25 <when value="regex">
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
26 <param type="text" name="match_by" label="Match by" value=".*" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
27 </when>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
28 </conditional>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
29 </when>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
30 <when value="sequence">
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
31 <conditional name="match">
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
32 <param name="match_selector" type="select" label="Sequence Match Type">
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
33 <option value="regex">Regular Expression</option>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
34 </param>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
35 <when value="regex">
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
36 <param type="text" name="match_by" label="Match by" value=".*" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
37 </when>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
38 </conditional>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
39 </when>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
40 <when value="quality">
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
41 <conditional name="match">
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
42 <param name="match_selector" type="select" label="Quality Match Type">
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
43 <option value="regex">Regular Expression</option>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
44 </param>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
45 <when value="regex">
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
46 <param type="text" name="match_by" label="Match by" value=".*" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
47 </when>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
48 </conditional>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
49 </when>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
50 </conditional>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
51 </repeat>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
52 <!-- Manipulate Matched Reads -->
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
53 <repeat name="manipulate_blocks" title="Manipulate Reads">
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
54 <conditional name="manipulation_type">
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
55 <param name="manipulation_type_selector" type="select" label="Manipulate Reads on">
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
56 <option value="identifier">Name/Identifier</option>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
57 <option value="sequence">Sequence Content</option>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
58 <option value="quality">Quality Score Content</option>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
59 <option value="miscellaneous">Miscellaneous Actions</option>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
60 </param>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
61 <when value="identifier">
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
62 <conditional name="manipulation">
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
63 <param name="manipulation_selector" type="select" label="Identifier Manipulation Type">
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
64 <option value="translate">String Translate</option>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
65 </param>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
66 <when value="translate">
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
67 <param name="from" type="text" label="From" value="" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
68 <param name="to" type="text" label="To" value="" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
69 </when>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
70 </conditional>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
71 </when>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
72 <when value="sequence">
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
73 <conditional name="manipulation">
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
74 <param name="manipulation_selector" type="select" label="Sequence Manipulation Type">
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
75 <option value="rev_comp">Reverse Complement</option>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
76 <option value="rev_no_comp">Reverse, No Complement</option>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
77 <option value="no_rev_comp">Complement, No Reverse</option>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
78 <option value="trim">Trim</option>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
79 <option value="dna_to_rna">DNA to RNA</option>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
80 <option value="rna_to_dna">RNA to DNA</option>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
81 <option value="translate">String Translate</option>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
82 <option value="change_adapter">Change Adapter Base</option>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
83 </param>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
84 <when value="rev_comp">
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
85 <!-- no extra settings -->
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
86 </when>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
87 <when value="rev_no_comp">
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
88 <!-- no extra settings -->
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
89 </when>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
90 <when value="no_rev_comp">
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
91 <!-- no extra settings -->
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
92 </when>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
93 <when value="trim">
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
94 <conditional name="offset_type">
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
95 <param name="base_offset_type" type="select" label="Define Base Offsets as" help="Use Absolute for fixed length reads (Illumina, SOLiD)&lt;br&gt;Use Percentage for variable length reads (Roche/454)">
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
96 <option value="offsets_absolute" selected="true">Absolute Values</option>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
97 <option value="offsets_percent">Percentage of Read Length</option>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
98 </param>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
99 <when value="offsets_absolute">
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
100 <param name="left_column_offset" label="Offset from 5' end" value="0" type="integer" help="Values start at 0, increasing from the left">
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
101 <validator type="in_range" message="Base Offsets must be positive" min="0" max="inf"/>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
102 <validator type="expression" message="An integer is required.">int( float( value ) ) == float( value )</validator>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
103 </param>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
104 <param name="right_column_offset" label="Offset from 3' end" value="0" type="integer" help="Values start at 0, increasing from the right">
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
105 <validator type="in_range" message="Base Offsets must be positive" min="0" max="inf"/>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
106 <validator type="expression" message="An integer is required.">int( float( value ) ) == float( value )</validator>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
107 </param>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
108 </when>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
109 <when value="offsets_percent">
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
110 <param name="left_column_offset" label="Offset from 5' end" value="0" type="float">
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
111 <validator type="in_range" message="Base Offsets must be between 0 and 100" min="0" max="100"/>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
112 </param>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
113 <param name="right_column_offset" label="Offset from 3' end" value="0" type="float">
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
114 <validator type="in_range" message="Base Offsets must be between 0 and 100" min="0" max="100"/>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
115 </param>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
116 </when>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
117 </conditional>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
118 <param name="keep_zero_length" label="Keep reads with zero length" type="boolean" truevalue="keep_zero_length" falsevalue="exclude_zero_length" selected="False"/>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
119 </when>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
120 <when value="dna_to_rna">
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
121 <!-- no extra settings -->
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
122 </when>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
123 <when value="rna_to_dna">
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
124 <!-- no extra settings -->
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
125 </when>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
126 <when value="translate">
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
127 <param name="from" type="text" label="From" value="" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
128 <param name="to" type="text" label="To" value="" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
129 </when>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
130 <when value="change_adapter">
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
131 <param name="new_adapter" label="New Adapter" type="text" value="G" help="An empty string will remove the adapter base" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
132 </when>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
133 </conditional>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
134 </when>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
135 <when value="quality">
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
136 <conditional name="manipulation">
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
137 <param name="manipulation_selector" type="select" label="Quality Manipulation Type">
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
138 <option value="translate">String Translate</option>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
139 <!-- <option value="modify_each_score">Apply Transformation to each Score</option> Not enabled yet-->
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
140 </param>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
141 <when value="translate">
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
142 <param name="from" type="text" label="From" value="" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
143 <param name="to" type="text" label="To" value="" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
144 </when>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
145 <when value="modify_each_score">
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
146 <param name="map_score" type="text" label="Modify Score by" value="$score + 1" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
147 </when>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
148 </conditional>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
149 </when>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
150 <when value="miscellaneous">
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
151 <conditional name="manipulation">
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
152 <param name="manipulation_selector" type="select" label="Miscellaneous Manipulation Type">
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
153 <option value="remove">Remove Read</option>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
154 </param>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
155 <when value="remove">
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
156 <!-- no extra settings -->
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
157 </when>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
158 </conditional>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
159 </when>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
160 </conditional>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
161 </repeat>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
162 </page>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
163 </inputs>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
164 <configfiles>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
165 <configfile name="fastq_manipulation_file">##create an importable module
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
166 #import binascii
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
167 import re
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
168 import binascii
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
169 from string import maketrans
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
170 ##does read match
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
171 def match_read( fastq_read ):
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
172 #for $match_block in $match_blocks:
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
173 #if $match_block['match_type']['match_type_selector'] == 'identifier':
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
174 search_target = fastq_read.identifier[1:] ##don't include @
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
175 #elif $match_block['match_type']['match_type_selector'] == 'sequence':
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
176 search_target = fastq_read.sequence
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
177 #elif $match_block['match_type']['match_type_selector'] == 'quality':
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
178 search_target = fastq_read.quality
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
179 #else:
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
180 #continue
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
181 #end if
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
182 if not re.search( binascii.unhexlify( "${ binascii.hexlify( str( match_block['match_type']['match']['match_by'] ) ) }" ), search_target ):
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
183 return False
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
184 #end for
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
185 return True
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
186 ##modify matched reads
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
187 def manipulate_read( fastq_read ):
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
188 new_read = fastq_read.clone()
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
189 #for $manipulate_block in $manipulate_blocks:
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
190 #if $manipulate_block['manipulation_type']['manipulation_type_selector'] == 'identifier':
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
191 #if $manipulate_block['manipulation_type']['manipulation']['manipulation_selector'] == 'translate':
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
192 new_read.identifier = "@%s" % new_read.identifier[1:].translate( maketrans( binascii.unhexlify( "${ binascii.hexlify( str( manipulate_block['manipulation_type']['manipulation']['from'] ) ) }" ), binascii.unhexlify( "${ binascii.hexlify( str( manipulate_block['manipulation_type']['manipulation']['to'] ) ) }" ) ) )
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
193 #end if
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
194 #elif $manipulate_block['manipulation_type']['manipulation_type_selector'] == 'sequence':
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
195 #if $manipulate_block['manipulation_type']['manipulation']['manipulation_selector'] == 'translate':
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
196 new_read.sequence = new_read.sequence.translate( maketrans( binascii.unhexlify( "${ binascii.hexlify( str( manipulate_block['manipulation_type']['manipulation']['from'] ) ) }" ), binascii.unhexlify( "${ binascii.hexlify( str( manipulate_block['manipulation_type']['manipulation']['to'] ) ) }" ) ) )
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
197 #elif $manipulate_block['manipulation_type']['manipulation']['manipulation_selector'] == 'rev_comp':
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
198 new_read = new_read.reverse_complement()
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
199 #elif $manipulate_block['manipulation_type']['manipulation']['manipulation_selector'] == 'rev_no_comp':
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
200 new_read = new_read.reverse()
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
201 #elif $manipulate_block['manipulation_type']['manipulation']['manipulation_selector'] == 'no_rev_comp':
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
202 new_read = new_read.complement()
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
203 #elif $manipulate_block['manipulation_type']['manipulation']['manipulation_selector'] == 'trim':
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
204 #if $manipulate_block['manipulation_type']['manipulation']['offset_type']['base_offset_type'] == 'offsets_percent':
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
205 left_column_offset = int( round( float( ${ manipulate_block['manipulation_type']['manipulation']['offset_type']['left_column_offset'] } ) / 100.0 * float( len( new_read ) ) ) )
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
206 right_column_offset = int( round( float( ${ manipulate_block['manipulation_type']['manipulation']['offset_type']['right_column_offset'] } ) / 100.0 * float( len( new_read ) ) ) )
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
207 #else
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
208 left_column_offset = ${ manipulate_block['manipulation_type']['manipulation']['offset_type']['left_column_offset'] }
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
209 right_column_offset = ${ manipulate_block['manipulation_type']['manipulation']['offset_type']['right_column_offset'] }
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
210 #end if
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
211 if right_column_offset > 0:
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
212 right_column_offset = -right_column_offset
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
213 else:
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
214 right_column_offset = None
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
215 new_read = new_read.slice( left_column_offset, right_column_offset )
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
216 if not ( ${str( manipulate_block['manipulation_type']['manipulation']['keep_zero_length'] ) == 'keep_zero_length'} or len( new_read ) ):
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
217 return None
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
218 #elif $manipulate_block['manipulation_type']['manipulation']['manipulation_selector'] == 'dna_to_rna':
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
219 new_read = new_read.sequence_as_DNA()
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
220 #elif $manipulate_block['manipulation_type']['manipulation']['manipulation_selector'] == 'rna_to_dna':
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
221 new_read = new_read.sequence_as_RNA()
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
222 #elif $manipulate_block['manipulation_type']['manipulation']['manipulation_selector'] == 'change_adapter':
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
223 if new_read.sequence_space == 'color':
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
224 new_read = new_read.change_adapter( binascii.unhexlify( "${ binascii.hexlify( str( manipulate_block['manipulation_type']['manipulation']['new_adapter'] ) ) }" ) )
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
225 #end if
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
226 #elif $manipulate_block['manipulation_type']['manipulation_type_selector'] == 'quality':
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
227 #if $manipulate_block['manipulation_type']['manipulation']['manipulation_selector'] == 'translate':
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
228 new_read.quality = new_read.quality.translate( maketrans( binascii.unhexlify( "${ binascii.hexlify( str( manipulate_block['manipulation_type']['manipulation']['from'] ) ) }" ), binascii.unhexlify( "${ binascii.hexlify( str( manipulate_block['manipulation_type']['manipulation']['to'] ) ) }" ) ) )
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
229 #elif $manipulate_block['manipulation_type']['manipulation']['manipulation_selector'] == 'map_score':
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
230 def score_method( score ):
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
231 raise Exception, "Unimplemented" ##This option is not yet available, need to abstract out e.g. column adding tool action: preventing users from using 'harmful' actions
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
232 new_read.quality_map( score_method )
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
233 #end if
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
234 #elif $manipulate_block['manipulation_type']['manipulation_type_selector'] == 'miscellaneous':
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
235 #if $manipulate_block['manipulation_type']['manipulation']['manipulation_selector'] == 'remove':
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
236 return None
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
237 #end if
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
238 #else:
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
239 #continue
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
240 #end if
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
241 #end for
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
242 if new_read.description != "+":
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
243 new_read.description = "+%s" % new_read.identifier[1:] ##ensure description is still valid
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
244 return new_read
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
245 def match_and_manipulate_read( fastq_read ):
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
246 new_read = fastq_read
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
247 if match_read( fastq_read ):
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
248 new_read = manipulate_read( fastq_read )
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
249 return new_read
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
250 </configfile>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
251 </configfiles>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
252 <outputs>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
253 <data format="input" name="output_file" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
254 </outputs>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
255 <tests>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
256 <!-- match all and do nothing -->
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
257 <test>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
258 <param name="input_file" value="sanger_full_range_original_sanger.fastqsanger" ftype="fastqsanger" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
259 <param name="match_type_selector" value="identifier" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
260 <param name="match_selector" value="regex" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
261 <param name="match_by" value=".*" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
262 <param name="manipulation_type_selector" value="identifier" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
263 <param name="manipulation_selector" value="translate" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
264 <param name="from" value="" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
265 <param name="to" value="" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
266 <output name="output_file" file="sanger_full_range_original_sanger.fastqsanger" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
267 </test>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
268 <!-- match None and do nothing -->
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
269 <test>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
270 <param name="input_file" value="sanger_full_range_original_sanger.fastqsanger" ftype="fastqsanger" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
271 <param name="match_type_selector" value="identifier" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
272 <param name="match_selector" value="regex" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
273 <param name="match_by" value="STRINGDOESNOTEXIST" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
274 <param name="manipulation_type_selector" value="identifier" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
275 <param name="manipulation_selector" value="translate" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
276 <param name="from" value="" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
277 <param name="to" value="" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
278 <output name="output_file" file="sanger_full_range_original_sanger.fastqsanger" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
279 </test>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
280 <!-- match all and remove -->
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
281 <test>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
282 <param name="input_file" value="sanger_full_range_original_sanger.fastqsanger" ftype="fastqsanger" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
283 <param name="match_type_selector" value="identifier" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
284 <param name="match_selector" value="regex" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
285 <param name="match_by" value=".*" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
286 <param name="manipulation_type_selector" value="miscellaneous" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
287 <param name="manipulation_selector" value="remove" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
288 <output name="output_file" file="empty_file.dat" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
289 </test>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
290 <!-- match None and remove -->
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
291 <test>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
292 <param name="input_file" value="sanger_full_range_original_sanger.fastqsanger" ftype="fastqsanger" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
293 <param name="match_type_selector" value="identifier" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
294 <param name="match_selector" value="regex" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
295 <param name="match_by" value="STRINGDOESNOTEXIST" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
296 <param name="manipulation_type_selector" value="miscellaneous" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
297 <param name="manipulation_selector" value="remove" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
298 <output name="output_file" file="sanger_full_range_original_sanger.fastqsanger" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
299 </test>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
300 <!-- match all and trim to 4 inner-most bases -->
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
301 <test>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
302 <param name="input_file" value="sanger_full_range_original_sanger.fastqsanger" ftype="fastqsanger" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
303 <param name="match_type_selector" value="identifier" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
304 <param name="match_selector" value="regex" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
305 <param name="match_by" value=".*" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
306 <param name="manipulation_type_selector" value="sequence" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
307 <param name="manipulation_selector" value="trim" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
308 <param name="base_offset_type" value="offsets_absolute"/>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
309 <param name="left_column_offset" value="45"/>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
310 <param name="right_column_offset" value="45"/>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
311 <param name="keep_zero_length" value="true" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
312 <output name="output_file" file="fastq_trimmer_out1.fastqsanger" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
313 </test>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
314 <test>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
315 <param name="input_file" value="sanger_full_range_original_sanger.fastqsanger" ftype="fastqsanger" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
316 <param name="match_type_selector" value="identifier" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
317 <param name="match_selector" value="regex" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
318 <param name="match_by" value=".*" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
319 <param name="manipulation_type_selector" value="sequence" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
320 <param name="manipulation_selector" value="trim" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
321 <param name="base_offset_type" value="offsets_percent"/>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
322 <param name="left_column_offset" value="47.87"/>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
323 <param name="right_column_offset" value="47.87"/>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
324 <param name="keep_zero_length" value="true" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
325 <output name="output_file" file="fastq_trimmer_out1.fastqsanger" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
326 </test>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
327 <!-- match all and rev comp -->
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
328 <test>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
329 <param name="input_file" value="sanger_full_range_original_sanger.fastqsanger" ftype="fastqsanger" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
330 <param name="match_type_selector" value="identifier" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
331 <param name="match_selector" value="regex" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
332 <param name="match_by" value=".*" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
333 <param name="manipulation_type_selector" value="sequence" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
334 <param name="manipulation_selector" value="rev_comp" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
335 <output name="output_file" file="sanger_full_range_rev_comp.fastqsanger" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
336 </test>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
337 <!-- match all and rev comp, with ambiguous DNA -->
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
338 <test>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
339 <param name="input_file" value="misc_dna_original_sanger.fastqsanger" ftype="fastqsanger" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
340 <param name="match_type_selector" value="identifier" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
341 <param name="match_selector" value="regex" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
342 <param name="match_by" value=".*" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
343 <param name="manipulation_type_selector" value="sequence" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
344 <param name="manipulation_selector" value="rev_comp" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
345 <output name="output_file" file="misc_dna_as_sanger_rev_comp_1.fastqsanger" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
346 </test>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
347 <!-- match all and rev comp, with ambiguous RNA -->
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
348 <test>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
349 <param name="input_file" value="misc_rna_original_sanger.fastqsanger" ftype="fastqsanger" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
350 <param name="match_type_selector" value="identifier" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
351 <param name="match_selector" value="regex" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
352 <param name="match_by" value=".*" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
353 <param name="manipulation_type_selector" value="sequence" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
354 <param name="manipulation_selector" value="rev_comp" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
355 <output name="output_file" file="misc_rna_as_sanger_rev_comp_1.fastqsanger" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
356 </test>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
357 <!-- match first seq and rev comp -->
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
358 <test>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
359 <param name="input_file" value="sanger_full_range_original_sanger.fastqsanger" ftype="fastqsanger" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
360 <param name="match_type_selector" value="identifier" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
361 <param name="match_selector" value="regex" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
362 <param name="match_by" value="FAKE0001" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
363 <param name="manipulation_type_selector" value="sequence" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
364 <param name="manipulation_selector" value="rev_comp" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
365 <output name="output_file" file="sanger_full_range_rev_comp_1_seq.fastqsanger" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
366 </test>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
367 <!-- match first seq and rev comp: i.e. undo above -->
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
368 <test>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
369 <param name="input_file" value="sanger_full_range_rev_comp_1_seq.fastqsanger" ftype="fastqsanger" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
370 <param name="match_type_selector" value="identifier" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
371 <param name="match_selector" value="regex" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
372 <param name="match_by" value="FAKE0001" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
373 <param name="manipulation_type_selector" value="sequence" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
374 <param name="manipulation_selector" value="rev_comp" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
375 <output name="output_file" file="sanger_full_range_original_sanger.fastqsanger" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
376 </test>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
377 <!-- match all and DNA to RNA -->
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
378 <test>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
379 <param name="input_file" value="sanger_full_range_original_sanger.fastqsanger" ftype="fastqsanger" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
380 <param name="match_type_selector" value="identifier" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
381 <param name="match_selector" value="regex" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
382 <param name="match_by" value=".*" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
383 <param name="manipulation_type_selector" value="sequence" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
384 <param name="manipulation_selector" value="dna_to_rna" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
385 <output name="output_file" file="sanger_full_range_as_rna.fastqsanger" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
386 </test>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
387 <!-- match all and RNA to DNA -->
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
388 <test>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
389 <param name="input_file" value="sanger_full_range_as_rna.fastqsanger" ftype="fastqsanger" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
390 <param name="match_type_selector" value="identifier" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
391 <param name="match_selector" value="regex" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
392 <param name="match_by" value=".*" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
393 <param name="manipulation_type_selector" value="sequence" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
394 <param name="manipulation_selector" value="rna_to_dna" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
395 <output name="output_file" file="sanger_full_range_original_sanger.fastqsanger" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
396 </test>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
397 </tests>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
398 <help>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
399 This tool allows you to build complex manipulations to be applied to each matching read in a FASTQ file. A read must match all matching directives in order for it to be manipulated; if a read does not match, it is output in a non-modified manner. All reads matching will have each of the specified manipulations performed upon them, in the order specified.
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
400
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
401 Regular Expression Matches are made using re.search, see http://docs.python.org/library/re.html for more information.
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
402 All matching is performed on a single line string, regardless if e.g. the sequence or quality score spans multiple lines in the original file.
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
403
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
404 String translations are performed using string.translate, see http://docs.python.org/library/string.html#string.translate and http://docs.python.org/library/string.html#string.maketrans for more information.
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
405
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
406 .. class:: warningmark
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
407
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
408 Only color space reads can have adapter bases substituted.
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
409
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
410
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
411 -----
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
412
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
413 **Example**
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
414
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
415 Suppose you have a color space sanger formatted sequence (fastqcssanger) and you want to double-encode the color space into psuedo-nucleotide space (this is different from converting) to allow these reads to be used in tools which do not natively support it (using specially designed indexes). This tool can handle this manipulation, however, this is generally not recommended as results tend to be poorer than those produced from tools which are specially designed to handle color space data.
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
416
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
417 Steps:
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
418
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
419 1. Click **Add new Match Reads** and leave the matching options set to the default (Matching by sequence name/identifier using the regular expression "\*."; thereby matching all reads).
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
420 2. Click **Add new Manipulate Reads**, change **Manipulate Reads on** to "Sequence Content", set **Sequence Manipulation Type** to "Change Adapter Base" and set **New Adapter** to "" (an empty text field).
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
421 3. Click **Add new Manipulate Reads**, change **Manipulate Reads on** to "Sequence Content", set **Sequence Manipulation Type** to "String Translate" and set **From** to "0123." and **To** to "ACGTN".
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
422 4. Click Execute. The new history item will contained double-encoded psuedo-nucleotide space reads.
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
423
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
424 ------
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
425
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
426 **Citation**
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
427
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
428 If you use this tool, please cite `Blankenberg D, Gordon A, Von Kuster G, Coraor N, Taylor J, Nekrutenko A; Galaxy Team. Manipulation of FASTQ data with Galaxy. Bioinformatics. 2010 Jul 15;26(14):1783-5. &lt;http://www.ncbi.nlm.nih.gov/pubmed/20562416&gt;`_
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
429
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
430
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
431 </help>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
432 </tool>