annotate fastq_manipulation.xml @ 1:bb07615a5b6a draft

planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tool_collections/galaxy_sequence_utils/fastq_manipulation commit a1517c9d22029095120643bbe2c8fa53754dd2b7
author devteam
date Wed, 11 Nov 2015 12:41:10 -0500
parents 5d1e9e13e8db
children 4ac14b275aca
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
1 <tool id="fastq_manipulation" name="Manipulate FASTQ" version="1.0.1">
5d1e9e13e8db 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 -->
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
3 <requirements>
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
4 <requirement type="package" version="1.0.0">galaxy_sequence_utils</requirement>
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
5 </requirements>
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
6 <description>reads on various attributes</description>
5d1e9e13e8db 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>
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
8 <inputs>
5d1e9e13e8db 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 -->
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
10 <page>
5d1e9e13e8db 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."/>
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
12 <!-- Match Reads -->
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
13 <repeat name="match_blocks" title="Match Reads">
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
14 <conditional name="match_type">
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
15 <param name="match_type_selector" type="select" label="Match Reads by">
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
16 <option value="identifier">Name/Identifier</option>
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
17 <option value="sequence">Sequence Content</option>
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
18 <option value="quality">Quality Score Content</option>
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
19 </param>
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
20 <when value="identifier">
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
21 <conditional name="match">
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
22 <param name="match_selector" type="select" label="Identifier Match Type">
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
23 <option value="regex">Regular Expression</option>
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
24 </param>
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
25 <when value="regex">
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
26 <param type="text" name="match_by" label="Match by" value=".*" />
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
27 </when>
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
28 </conditional>
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
29 </when>
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
30 <when value="sequence">
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
31 <conditional name="match">
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
32 <param name="match_selector" type="select" label="Sequence Match Type">
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
33 <option value="regex">Regular Expression</option>
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
34 </param>
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
35 <when value="regex">
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
36 <param type="text" name="match_by" label="Match by" value=".*" />
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
37 </when>
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
38 </conditional>
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
39 </when>
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
40 <when value="quality">
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
41 <conditional name="match">
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
42 <param name="match_selector" type="select" label="Quality Match Type">
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
43 <option value="regex">Regular Expression</option>
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
44 </param>
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
45 <when value="regex">
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
46 <param type="text" name="match_by" label="Match by" value=".*" />
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
47 </when>
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
48 </conditional>
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
49 </when>
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
50 </conditional>
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
51 </repeat>
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
52 <!-- Manipulate Matched Reads -->
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
53 <repeat name="manipulate_blocks" title="Manipulate Reads">
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
54 <conditional name="manipulation_type">
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
55 <param name="manipulation_type_selector" type="select" label="Manipulate Reads on">
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
56 <option value="identifier">Name/Identifier</option>
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
57 <option value="sequence">Sequence Content</option>
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
58 <option value="quality">Quality Score Content</option>
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
59 <option value="miscellaneous">Miscellaneous Actions</option>
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
60 </param>
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
61 <when value="identifier">
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
62 <conditional name="manipulation">
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
63 <param name="manipulation_selector" type="select" label="Identifier Manipulation Type">
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
64 <option value="translate">String Translate</option>
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
65 </param>
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
66 <when value="translate">
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
67 <param name="from" type="text" label="From" value="" />
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
68 <param name="to" type="text" label="To" value="" />
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
69 </when>
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
70 </conditional>
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
71 </when>
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
72 <when value="sequence">
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
73 <conditional name="manipulation">
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
74 <param name="manipulation_selector" type="select" label="Sequence Manipulation Type">
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
75 <option value="rev_comp">Reverse Complement</option>
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
76 <option value="rev_no_comp">Reverse, No Complement</option>
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
77 <option value="no_rev_comp">Complement, No Reverse</option>
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
78 <option value="trim">Trim</option>
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
79 <option value="dna_to_rna">DNA to RNA</option>
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
80 <option value="rna_to_dna">RNA to DNA</option>
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
81 <option value="translate">String Translate</option>
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
82 <option value="change_adapter">Change Adapter Base</option>
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
83 </param>
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
84 <when value="rev_comp">
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
85 <!-- no extra settings -->
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
86 </when>
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
87 <when value="rev_no_comp">
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
88 <!-- no extra settings -->
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
89 </when>
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
90 <when value="no_rev_comp">
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
91 <!-- no extra settings -->
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
92 </when>
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
93 <when value="trim">
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
94 <conditional name="offset_type">
5d1e9e13e8db 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)">
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
96 <option value="offsets_absolute" selected="true">Absolute Values</option>
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
97 <option value="offsets_percent">Percentage of Read Length</option>
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
98 </param>
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
99 <when value="offsets_absolute">
5d1e9e13e8db 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">
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
101 <validator type="in_range" message="Base Offsets must be positive" min="0" max="inf"/>
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
102 <validator type="expression" message="An integer is required.">int( float( value ) ) == float( value )</validator>
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
103 </param>
5d1e9e13e8db 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">
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
105 <validator type="in_range" message="Base Offsets must be positive" min="0" max="inf"/>
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
106 <validator type="expression" message="An integer is required.">int( float( value ) ) == float( value )</validator>
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
107 </param>
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
108 </when>
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
109 <when value="offsets_percent">
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
110 <param name="left_column_offset" label="Offset from 5' end" value="0" type="float">
5d1e9e13e8db 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"/>
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
112 </param>
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
113 <param name="right_column_offset" label="Offset from 3' end" value="0" type="float">
5d1e9e13e8db 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"/>
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
115 </param>
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
116 </when>
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
117 </conditional>
5d1e9e13e8db 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"/>
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
119 </when>
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
120 <when value="dna_to_rna">
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
121 <!-- no extra settings -->
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
122 </when>
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
123 <when value="rna_to_dna">
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
124 <!-- no extra settings -->
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
125 </when>
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
126 <when value="translate">
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
127 <param name="from" type="text" label="From" value="" />
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
128 <param name="to" type="text" label="To" value="" />
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
129 </when>
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
130 <when value="change_adapter">
5d1e9e13e8db 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" />
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
132 </when>
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
133 </conditional>
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
134 </when>
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
135 <when value="quality">
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
136 <conditional name="manipulation">
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
137 <param name="manipulation_selector" type="select" label="Quality Manipulation Type">
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
138 <option value="translate">String Translate</option>
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
139 <!-- <option value="modify_each_score">Apply Transformation to each Score</option> Not enabled yet-->
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
140 </param>
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
141 <when value="translate">
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
142 <param name="from" type="text" label="From" value="" />
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
143 <param name="to" type="text" label="To" value="" />
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
144 </when>
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
145 <when value="modify_each_score">
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
146 <param name="map_score" type="text" label="Modify Score by" value="$score + 1" />
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
147 </when>
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
148 </conditional>
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
149 </when>
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
150 <when value="miscellaneous">
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
151 <conditional name="manipulation">
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
152 <param name="manipulation_selector" type="select" label="Miscellaneous Manipulation Type">
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
153 <option value="remove">Remove Read</option>
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
154 </param>
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
155 <when value="remove">
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
156 <!-- no extra settings -->
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
157 </when>
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
158 </conditional>
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
159 </when>
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
160 </conditional>
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
161 </repeat>
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
162 </page>
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
163 </inputs>
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
164 <configfiles>
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
165 <configfile name="fastq_manipulation_file">##create an importable module
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
166 #import binascii
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
167 import re
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
168 import binascii
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
169 from string import maketrans
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
170 ##does read match
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
171 def match_read( fastq_read ):
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
172 #for $match_block in $match_blocks:
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
173 #if $match_block['match_type']['match_type_selector'] == 'identifier':
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
174 search_target = fastq_read.identifier[1:] ##don't include @
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
175 #elif $match_block['match_type']['match_type_selector'] == 'sequence':
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
176 search_target = fastq_read.sequence
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
177 #elif $match_block['match_type']['match_type_selector'] == 'quality':
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
178 search_target = fastq_read.quality
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
179 #else:
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
180 #continue
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
181 #end if
5d1e9e13e8db 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 ):
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
183 return False
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
184 #end for
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
185 return True
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
186 ##modify matched reads
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
187 def manipulate_read( fastq_read ):
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
188 new_read = fastq_read.clone()
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
189 #for $manipulate_block in $manipulate_blocks:
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
190 #if $manipulate_block['manipulation_type']['manipulation_type_selector'] == 'identifier':
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
191 #if $manipulate_block['manipulation_type']['manipulation']['manipulation_selector'] == 'translate':
5d1e9e13e8db 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'] ) ) }" ) ) )
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
193 #end if
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
194 #elif $manipulate_block['manipulation_type']['manipulation_type_selector'] == 'sequence':
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
195 #if $manipulate_block['manipulation_type']['manipulation']['manipulation_selector'] == 'translate':
5d1e9e13e8db 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'] ) ) }" ) ) )
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
197 #elif $manipulate_block['manipulation_type']['manipulation']['manipulation_selector'] == 'rev_comp':
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
198 new_read = new_read.reverse_complement()
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
199 #elif $manipulate_block['manipulation_type']['manipulation']['manipulation_selector'] == 'rev_no_comp':
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
200 new_read = new_read.reverse()
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
201 #elif $manipulate_block['manipulation_type']['manipulation']['manipulation_selector'] == 'no_rev_comp':
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
202 new_read = new_read.complement()
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
203 #elif $manipulate_block['manipulation_type']['manipulation']['manipulation_selector'] == 'trim':
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
204 #if $manipulate_block['manipulation_type']['manipulation']['offset_type']['base_offset_type'] == 'offsets_percent':
5d1e9e13e8db 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 ) ) ) )
5d1e9e13e8db 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 ) ) ) )
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
207 #else
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
208 left_column_offset = ${ manipulate_block['manipulation_type']['manipulation']['offset_type']['left_column_offset'] }
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
209 right_column_offset = ${ manipulate_block['manipulation_type']['manipulation']['offset_type']['right_column_offset'] }
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
210 #end if
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
211 if right_column_offset > 0:
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
212 right_column_offset = -right_column_offset
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
213 else:
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
214 right_column_offset = None
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
215 new_read = new_read.slice( left_column_offset, right_column_offset )
5d1e9e13e8db 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 ) ):
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
217 return None
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
218 #elif $manipulate_block['manipulation_type']['manipulation']['manipulation_selector'] == 'dna_to_rna':
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
219 new_read = new_read.sequence_as_DNA()
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
220 #elif $manipulate_block['manipulation_type']['manipulation']['manipulation_selector'] == 'rna_to_dna':
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
221 new_read = new_read.sequence_as_RNA()
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
222 #elif $manipulate_block['manipulation_type']['manipulation']['manipulation_selector'] == 'change_adapter':
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
223 if new_read.sequence_space == 'color':
5d1e9e13e8db 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'] ) ) }" ) )
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
225 #end if
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
226 #elif $manipulate_block['manipulation_type']['manipulation_type_selector'] == 'quality':
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
227 #if $manipulate_block['manipulation_type']['manipulation']['manipulation_selector'] == 'translate':
5d1e9e13e8db 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'] ) ) }" ) ) )
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
229 #elif $manipulate_block['manipulation_type']['manipulation']['manipulation_selector'] == 'map_score':
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
230 def score_method( score ):
5d1e9e13e8db 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
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
232 new_read.quality_map( score_method )
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
233 #end if
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
234 #elif $manipulate_block['manipulation_type']['manipulation_type_selector'] == 'miscellaneous':
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
235 #if $manipulate_block['manipulation_type']['manipulation']['manipulation_selector'] == 'remove':
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
236 return None
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
237 #end if
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
238 #else:
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
239 #continue
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
240 #end if
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
241 #end for
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
242 if new_read.description != "+":
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
243 new_read.description = "+%s" % new_read.identifier[1:] ##ensure description is still valid
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
244 return new_read
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
245 def match_and_manipulate_read( fastq_read ):
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
246 new_read = fastq_read
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
247 if match_read( fastq_read ):
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
248 new_read = manipulate_read( fastq_read )
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
249 return new_read
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
250 </configfile>
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
251 </configfiles>
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
252 <outputs>
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
253 <data format="input" name="output_file" />
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
254 </outputs>
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
255 <tests>
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
256 <!-- match all and do nothing -->
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
257 <test>
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
258 <param name="input_file" value="sanger_full_range_original_sanger.fastqsanger" ftype="fastqsanger" />
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
259 <param name="match_type_selector" value="identifier" />
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
260 <param name="match_selector" value="regex" />
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
261 <param name="match_by" value=".*" />
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
262 <param name="manipulation_type_selector" value="identifier" />
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
263 <param name="manipulation_selector" value="translate" />
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
264 <param name="from" value="" />
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
265 <param name="to" value="" />
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
266 <output name="output_file" file="sanger_full_range_original_sanger.fastqsanger" />
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
267 </test>
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
268 <!-- match None and do nothing -->
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
269 <test>
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
270 <param name="input_file" value="sanger_full_range_original_sanger.fastqsanger" ftype="fastqsanger" />
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
271 <param name="match_type_selector" value="identifier" />
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
272 <param name="match_selector" value="regex" />
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
273 <param name="match_by" value="STRINGDOESNOTEXIST" />
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
274 <param name="manipulation_type_selector" value="identifier" />
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
275 <param name="manipulation_selector" value="translate" />
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
276 <param name="from" value="" />
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
277 <param name="to" value="" />
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
278 <output name="output_file" file="sanger_full_range_original_sanger.fastqsanger" />
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
279 </test>
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
280 <!-- match all and remove -->
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
281 <test>
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
282 <param name="input_file" value="sanger_full_range_original_sanger.fastqsanger" ftype="fastqsanger" />
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
283 <param name="match_type_selector" value="identifier" />
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
284 <param name="match_selector" value="regex" />
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
285 <param name="match_by" value=".*" />
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
286 <param name="manipulation_type_selector" value="miscellaneous" />
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
287 <param name="manipulation_selector" value="remove" />
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
288 <output name="output_file" file="empty_file.dat" />
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
289 </test>
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
290 <!-- match None and remove -->
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
291 <test>
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
292 <param name="input_file" value="sanger_full_range_original_sanger.fastqsanger" ftype="fastqsanger" />
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
293 <param name="match_type_selector" value="identifier" />
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
294 <param name="match_selector" value="regex" />
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
295 <param name="match_by" value="STRINGDOESNOTEXIST" />
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
296 <param name="manipulation_type_selector" value="miscellaneous" />
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
297 <param name="manipulation_selector" value="remove" />
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
298 <output name="output_file" file="sanger_full_range_original_sanger.fastqsanger" />
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
299 </test>
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
300 <!-- match all and trim to 4 inner-most bases -->
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
301 <test>
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
302 <param name="input_file" value="sanger_full_range_original_sanger.fastqsanger" ftype="fastqsanger" />
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
303 <param name="match_type_selector" value="identifier" />
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
304 <param name="match_selector" value="regex" />
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
305 <param name="match_by" value=".*" />
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
306 <param name="manipulation_type_selector" value="sequence" />
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
307 <param name="manipulation_selector" value="trim" />
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
308 <param name="base_offset_type" value="offsets_absolute"/>
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
309 <param name="left_column_offset" value="45"/>
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
310 <param name="right_column_offset" value="45"/>
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
311 <param name="keep_zero_length" value="true" />
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
312 <output name="output_file" file="fastq_trimmer_out1.fastqsanger" />
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
313 </test>
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
314 <test>
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
315 <param name="input_file" value="sanger_full_range_original_sanger.fastqsanger" ftype="fastqsanger" />
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
316 <param name="match_type_selector" value="identifier" />
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
317 <param name="match_selector" value="regex" />
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
318 <param name="match_by" value=".*" />
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
319 <param name="manipulation_type_selector" value="sequence" />
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
320 <param name="manipulation_selector" value="trim" />
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
321 <param name="base_offset_type" value="offsets_percent"/>
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
322 <param name="left_column_offset" value="47.87"/>
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
323 <param name="right_column_offset" value="47.87"/>
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
324 <param name="keep_zero_length" value="true" />
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
325 <output name="output_file" file="fastq_trimmer_out1.fastqsanger" />
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
326 </test>
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
327 <!-- match all and rev comp -->
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
328 <test>
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
329 <param name="input_file" value="sanger_full_range_original_sanger.fastqsanger" ftype="fastqsanger" />
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
330 <param name="match_type_selector" value="identifier" />
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
331 <param name="match_selector" value="regex" />
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
332 <param name="match_by" value=".*" />
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
333 <param name="manipulation_type_selector" value="sequence" />
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
334 <param name="manipulation_selector" value="rev_comp" />
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
335 <output name="output_file" file="sanger_full_range_rev_comp.fastqsanger" />
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
336 </test>
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
337 <!-- match all and rev comp, with ambiguous DNA -->
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
338 <test>
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
339 <param name="input_file" value="misc_dna_original_sanger.fastqsanger" ftype="fastqsanger" />
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
340 <param name="match_type_selector" value="identifier" />
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
341 <param name="match_selector" value="regex" />
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
342 <param name="match_by" value=".*" />
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
343 <param name="manipulation_type_selector" value="sequence" />
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
344 <param name="manipulation_selector" value="rev_comp" />
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
345 <output name="output_file" file="misc_dna_as_sanger_rev_comp_1.fastqsanger" />
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
346 </test>
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
347 <!-- match all and rev comp, with ambiguous RNA -->
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
348 <test>
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
349 <param name="input_file" value="misc_rna_original_sanger.fastqsanger" ftype="fastqsanger" />
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
350 <param name="match_type_selector" value="identifier" />
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
351 <param name="match_selector" value="regex" />
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
352 <param name="match_by" value=".*" />
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
353 <param name="manipulation_type_selector" value="sequence" />
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
354 <param name="manipulation_selector" value="rev_comp" />
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
355 <output name="output_file" file="misc_rna_as_sanger_rev_comp_1.fastqsanger" />
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
356 </test>
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
357 <!-- match first seq and rev comp -->
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
358 <test>
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
359 <param name="input_file" value="sanger_full_range_original_sanger.fastqsanger" ftype="fastqsanger" />
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
360 <param name="match_type_selector" value="identifier" />
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
361 <param name="match_selector" value="regex" />
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
362 <param name="match_by" value="FAKE0001" />
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
363 <param name="manipulation_type_selector" value="sequence" />
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
364 <param name="manipulation_selector" value="rev_comp" />
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
365 <output name="output_file" file="sanger_full_range_rev_comp_1_seq.fastqsanger" />
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
366 </test>
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
367 <!-- match first seq and rev comp: i.e. undo above -->
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
368 <test>
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
369 <param name="input_file" value="sanger_full_range_rev_comp_1_seq.fastqsanger" ftype="fastqsanger" />
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
370 <param name="match_type_selector" value="identifier" />
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
371 <param name="match_selector" value="regex" />
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
372 <param name="match_by" value="FAKE0001" />
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
373 <param name="manipulation_type_selector" value="sequence" />
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
374 <param name="manipulation_selector" value="rev_comp" />
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
375 <output name="output_file" file="sanger_full_range_original_sanger.fastqsanger" />
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
376 </test>
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
377 <!-- match all and DNA to RNA -->
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
378 <test>
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
379 <param name="input_file" value="sanger_full_range_original_sanger.fastqsanger" ftype="fastqsanger" />
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
380 <param name="match_type_selector" value="identifier" />
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
381 <param name="match_selector" value="regex" />
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
382 <param name="match_by" value=".*" />
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
383 <param name="manipulation_type_selector" value="sequence" />
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
384 <param name="manipulation_selector" value="dna_to_rna" />
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
385 <output name="output_file" file="sanger_full_range_as_rna.fastqsanger" />
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
386 </test>
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
387 <!-- match all and RNA to DNA -->
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
388 <test>
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
389 <param name="input_file" value="sanger_full_range_as_rna.fastqsanger" ftype="fastqsanger" />
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
390 <param name="match_type_selector" value="identifier" />
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
391 <param name="match_selector" value="regex" />
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
392 <param name="match_by" value=".*" />
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
393 <param name="manipulation_type_selector" value="sequence" />
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
394 <param name="manipulation_selector" value="rna_to_dna" />
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
395 <output name="output_file" file="sanger_full_range_original_sanger.fastqsanger" />
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
396 </test>
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
397 </tests>
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
398 <help>
5d1e9e13e8db 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.
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
400
5d1e9e13e8db 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.
5d1e9e13e8db 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.
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
403
5d1e9e13e8db 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.
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
405
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
406 .. class:: warningmark
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
407
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
408 Only color space reads can have adapter bases substituted.
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
409
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
410
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
411 -----
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
412
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
413 **Example**
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
414
5d1e9e13e8db 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.
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
416
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
417 Steps:
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
418
5d1e9e13e8db 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).
5d1e9e13e8db 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).
5d1e9e13e8db 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".
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
422 4. Click Execute. The new history item will contained double-encoded psuedo-nucleotide space reads.
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
423
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
424 </help>
1
bb07615a5b6a planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tool_collections/galaxy_sequence_utils/fastq_manipulation commit a1517c9d22029095120643bbe2c8fa53754dd2b7
devteam
parents: 0
diff changeset
425 <citations>
bb07615a5b6a planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tool_collections/galaxy_sequence_utils/fastq_manipulation commit a1517c9d22029095120643bbe2c8fa53754dd2b7
devteam
parents: 0
diff changeset
426 <citation type="doi">10.1093/bioinformatics/btq281</citation>
bb07615a5b6a planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tool_collections/galaxy_sequence_utils/fastq_manipulation commit a1517c9d22029095120643bbe2c8fa53754dd2b7
devteam
parents: 0
diff changeset
427 </citations>
0
5d1e9e13e8db Imported from capsule None
devteam
parents:
diff changeset
428 </tool>