annotate fastq_manipulation.xml @ 2:16d28d67ebeb draft

planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tool_collections/galaxy_sequence_utils/fastq_manipulation commit de7140295cce07e1bc1697e51dab4271c8d7a8a6
author devteam
date Fri, 18 Dec 2015 19:28:39 -0500
parents b50aeae8bcaa
children 7ea141c4c834
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2
16d28d67ebeb planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tool_collections/galaxy_sequence_utils/fastq_manipulation commit de7140295cce07e1bc1697e51dab4271c8d7a8a6
devteam
parents: 1
diff changeset
1 <tool id="fastq_manipulation" name="Manipulate FASTQ" version="1.0.2">
0
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>
2
16d28d67ebeb planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tool_collections/galaxy_sequence_utils/fastq_manipulation commit de7140295cce07e1bc1697e51dab4271c8d7a8a6
devteam
parents: 1
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; use a negative value to remove everything to the right of the absolute value of the position">
0
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
105 <validator type="expression" message="An integer is required.">int( float( value ) ) == float( value )</validator>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
106 </param>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
107 </when>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
108 <when value="offsets_percent">
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
109 <param name="left_column_offset" label="Offset from 5' end" value="0" type="float">
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
110 <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
111 </param>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
112 <param name="right_column_offset" label="Offset from 3' end" value="0" type="float">
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
113 <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
114 </param>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
115 </when>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
116 </conditional>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
117 <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
118 </when>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
119 <when value="dna_to_rna">
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
120 <!-- no extra settings -->
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
121 </when>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
122 <when value="rna_to_dna">
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
123 <!-- no extra settings -->
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
124 </when>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
125 <when value="translate">
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
126 <param name="from" type="text" label="From" value="" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
127 <param name="to" type="text" label="To" value="" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
128 </when>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
129 <when value="change_adapter">
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
130 <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
131 </when>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
132 </conditional>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
133 </when>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
134 <when value="quality">
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
135 <conditional name="manipulation">
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
136 <param name="manipulation_selector" type="select" label="Quality Manipulation Type">
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
137 <option value="translate">String Translate</option>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
138 <!-- <option value="modify_each_score">Apply Transformation to each Score</option> Not enabled yet-->
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
139 </param>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
140 <when value="translate">
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
141 <param name="from" type="text" label="From" value="" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
142 <param name="to" type="text" label="To" value="" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
143 </when>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
144 <when value="modify_each_score">
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
145 <param name="map_score" type="text" label="Modify Score by" value="$score + 1" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
146 </when>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
147 </conditional>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
148 </when>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
149 <when value="miscellaneous">
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
150 <conditional name="manipulation">
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
151 <param name="manipulation_selector" type="select" label="Miscellaneous Manipulation Type">
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
152 <option value="remove">Remove Read</option>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
153 </param>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
154 <when value="remove">
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
155 <!-- no extra settings -->
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
156 </when>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
157 </conditional>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
158 </when>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
159 </conditional>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
160 </repeat>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
161 </page>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
162 </inputs>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
163 <configfiles>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
164 <configfile name="fastq_manipulation_file">##create an importable module
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
165 #import binascii
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
166 import re
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
167 import binascii
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
168 from string import maketrans
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
169 ##does read match
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
170 def match_read( fastq_read ):
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
171 #for $match_block in $match_blocks:
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
172 #if $match_block['match_type']['match_type_selector'] == 'identifier':
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
173 search_target = fastq_read.identifier[1:] ##don't include @
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
174 #elif $match_block['match_type']['match_type_selector'] == 'sequence':
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
175 search_target = fastq_read.sequence
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
176 #elif $match_block['match_type']['match_type_selector'] == 'quality':
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
177 search_target = fastq_read.quality
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
178 #else:
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
179 #continue
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
180 #end if
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
181 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
182 return False
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
183 #end for
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
184 return True
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
185 ##modify matched reads
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
186 def manipulate_read( fastq_read ):
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
187 new_read = fastq_read.clone()
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
188 #for $manipulate_block in $manipulate_blocks:
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
189 #if $manipulate_block['manipulation_type']['manipulation_type_selector'] == 'identifier':
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
190 #if $manipulate_block['manipulation_type']['manipulation']['manipulation_selector'] == 'translate':
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
191 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
192 #end if
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
193 #elif $manipulate_block['manipulation_type']['manipulation_type_selector'] == 'sequence':
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
194 #if $manipulate_block['manipulation_type']['manipulation']['manipulation_selector'] == 'translate':
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
195 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
196 #elif $manipulate_block['manipulation_type']['manipulation']['manipulation_selector'] == 'rev_comp':
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
197 new_read = new_read.reverse_complement()
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
198 #elif $manipulate_block['manipulation_type']['manipulation']['manipulation_selector'] == 'rev_no_comp':
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
199 new_read = new_read.reverse()
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
200 #elif $manipulate_block['manipulation_type']['manipulation']['manipulation_selector'] == 'no_rev_comp':
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
201 new_read = new_read.complement()
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
202 #elif $manipulate_block['manipulation_type']['manipulation']['manipulation_selector'] == 'trim':
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
203 #if $manipulate_block['manipulation_type']['manipulation']['offset_type']['base_offset_type'] == 'offsets_percent':
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
204 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
205 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
206 #else
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
207 left_column_offset = ${ manipulate_block['manipulation_type']['manipulation']['offset_type']['left_column_offset'] }
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
208 right_column_offset = ${ manipulate_block['manipulation_type']['manipulation']['offset_type']['right_column_offset'] }
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
209 #end if
2
16d28d67ebeb planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tool_collections/galaxy_sequence_utils/fastq_manipulation commit de7140295cce07e1bc1697e51dab4271c8d7a8a6
devteam
parents: 1
diff changeset
210 if right_column_offset != 0:
0
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
211 right_column_offset = -right_column_offset
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
212 else:
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
213 right_column_offset = None
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
214 new_read = new_read.slice( left_column_offset, right_column_offset )
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
215 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
216 return None
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
217 #elif $manipulate_block['manipulation_type']['manipulation']['manipulation_selector'] == 'dna_to_rna':
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
218 new_read = new_read.sequence_as_DNA()
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
219 #elif $manipulate_block['manipulation_type']['manipulation']['manipulation_selector'] == 'rna_to_dna':
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
220 new_read = new_read.sequence_as_RNA()
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
221 #elif $manipulate_block['manipulation_type']['manipulation']['manipulation_selector'] == 'change_adapter':
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
222 if new_read.sequence_space == 'color':
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
223 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
224 #end if
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
225 #elif $manipulate_block['manipulation_type']['manipulation_type_selector'] == 'quality':
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
226 #if $manipulate_block['manipulation_type']['manipulation']['manipulation_selector'] == 'translate':
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
227 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
228 #elif $manipulate_block['manipulation_type']['manipulation']['manipulation_selector'] == 'map_score':
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
229 def score_method( score ):
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
230 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
231 new_read.quality_map( score_method )
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
232 #end if
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
233 #elif $manipulate_block['manipulation_type']['manipulation_type_selector'] == 'miscellaneous':
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
234 #if $manipulate_block['manipulation_type']['manipulation']['manipulation_selector'] == 'remove':
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
235 return None
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
236 #end if
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
237 #else:
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
238 #continue
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
239 #end if
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
240 #end for
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
241 if new_read.description != "+":
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
242 new_read.description = "+%s" % new_read.identifier[1:] ##ensure description is still valid
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
243 return new_read
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
244 def match_and_manipulate_read( fastq_read ):
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
245 new_read = fastq_read
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
246 if match_read( fastq_read ):
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
247 new_read = manipulate_read( fastq_read )
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
248 return new_read
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
249 </configfile>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
250 </configfiles>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
251 <outputs>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
252 <data format="input" name="output_file" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
253 </outputs>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
254 <tests>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
255 <!-- match all and do nothing -->
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
256 <test>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
257 <param name="input_file" value="sanger_full_range_original_sanger.fastqsanger" ftype="fastqsanger" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
258 <param name="match_type_selector" value="identifier" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
259 <param name="match_selector" value="regex" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
260 <param name="match_by" value=".*" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
261 <param name="manipulation_type_selector" value="identifier" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
262 <param name="manipulation_selector" value="translate" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
263 <param name="from" value="" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
264 <param name="to" value="" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
265 <output name="output_file" file="sanger_full_range_original_sanger.fastqsanger" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
266 </test>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
267 <!-- match None and do nothing -->
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
268 <test>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
269 <param name="input_file" value="sanger_full_range_original_sanger.fastqsanger" ftype="fastqsanger" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
270 <param name="match_type_selector" value="identifier" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
271 <param name="match_selector" value="regex" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
272 <param name="match_by" value="STRINGDOESNOTEXIST" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
273 <param name="manipulation_type_selector" value="identifier" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
274 <param name="manipulation_selector" value="translate" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
275 <param name="from" value="" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
276 <param name="to" value="" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
277 <output name="output_file" file="sanger_full_range_original_sanger.fastqsanger" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
278 </test>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
279 <!-- match all and remove -->
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
280 <test>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
281 <param name="input_file" value="sanger_full_range_original_sanger.fastqsanger" ftype="fastqsanger" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
282 <param name="match_type_selector" value="identifier" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
283 <param name="match_selector" value="regex" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
284 <param name="match_by" value=".*" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
285 <param name="manipulation_type_selector" value="miscellaneous" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
286 <param name="manipulation_selector" value="remove" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
287 <output name="output_file" file="empty_file.dat" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
288 </test>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
289 <!-- match None and remove -->
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
290 <test>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
291 <param name="input_file" value="sanger_full_range_original_sanger.fastqsanger" ftype="fastqsanger" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
292 <param name="match_type_selector" value="identifier" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
293 <param name="match_selector" value="regex" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
294 <param name="match_by" value="STRINGDOESNOTEXIST" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
295 <param name="manipulation_type_selector" value="miscellaneous" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
296 <param name="manipulation_selector" value="remove" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
297 <output name="output_file" file="sanger_full_range_original_sanger.fastqsanger" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
298 </test>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
299 <!-- match all and trim to 4 inner-most bases -->
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
300 <test>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
301 <param name="input_file" value="sanger_full_range_original_sanger.fastqsanger" ftype="fastqsanger" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
302 <param name="match_type_selector" value="identifier" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
303 <param name="match_selector" value="regex" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
304 <param name="match_by" value=".*" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
305 <param name="manipulation_type_selector" value="sequence" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
306 <param name="manipulation_selector" value="trim" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
307 <param name="base_offset_type" value="offsets_absolute"/>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
308 <param name="left_column_offset" value="45"/>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
309 <param name="right_column_offset" value="45"/>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
310 <param name="keep_zero_length" value="true" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
311 <output name="output_file" file="fastq_trimmer_out1.fastqsanger" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
312 </test>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
313 <test>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
314 <param name="input_file" value="sanger_full_range_original_sanger.fastqsanger" ftype="fastqsanger" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
315 <param name="match_type_selector" value="identifier" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
316 <param name="match_selector" value="regex" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
317 <param name="match_by" value=".*" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
318 <param name="manipulation_type_selector" value="sequence" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
319 <param name="manipulation_selector" value="trim" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
320 <param name="base_offset_type" value="offsets_percent"/>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
321 <param name="left_column_offset" value="47.87"/>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
322 <param name="right_column_offset" value="47.87"/>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
323 <param name="keep_zero_length" value="true" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
324 <output name="output_file" file="fastq_trimmer_out1.fastqsanger" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
325 </test>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
326 <!-- match all and rev comp -->
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
327 <test>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
328 <param name="input_file" value="sanger_full_range_original_sanger.fastqsanger" ftype="fastqsanger" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
329 <param name="match_type_selector" value="identifier" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
330 <param name="match_selector" value="regex" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
331 <param name="match_by" value=".*" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
332 <param name="manipulation_type_selector" value="sequence" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
333 <param name="manipulation_selector" value="rev_comp" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
334 <output name="output_file" file="sanger_full_range_rev_comp.fastqsanger" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
335 </test>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
336 <!-- match all and rev comp, with ambiguous DNA -->
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
337 <test>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
338 <param name="input_file" value="misc_dna_original_sanger.fastqsanger" ftype="fastqsanger" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
339 <param name="match_type_selector" value="identifier" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
340 <param name="match_selector" value="regex" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
341 <param name="match_by" value=".*" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
342 <param name="manipulation_type_selector" value="sequence" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
343 <param name="manipulation_selector" value="rev_comp" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
344 <output name="output_file" file="misc_dna_as_sanger_rev_comp_1.fastqsanger" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
345 </test>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
346 <!-- match all and rev comp, with ambiguous RNA -->
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
347 <test>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
348 <param name="input_file" value="misc_rna_original_sanger.fastqsanger" ftype="fastqsanger" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
349 <param name="match_type_selector" value="identifier" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
350 <param name="match_selector" value="regex" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
351 <param name="match_by" value=".*" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
352 <param name="manipulation_type_selector" value="sequence" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
353 <param name="manipulation_selector" value="rev_comp" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
354 <output name="output_file" file="misc_rna_as_sanger_rev_comp_1.fastqsanger" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
355 </test>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
356 <!-- match first seq and rev comp -->
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
357 <test>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
358 <param name="input_file" value="sanger_full_range_original_sanger.fastqsanger" ftype="fastqsanger" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
359 <param name="match_type_selector" value="identifier" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
360 <param name="match_selector" value="regex" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
361 <param name="match_by" value="FAKE0001" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
362 <param name="manipulation_type_selector" value="sequence" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
363 <param name="manipulation_selector" value="rev_comp" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
364 <output name="output_file" file="sanger_full_range_rev_comp_1_seq.fastqsanger" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
365 </test>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
366 <!-- match first seq and rev comp: i.e. undo above -->
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
367 <test>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
368 <param name="input_file" value="sanger_full_range_rev_comp_1_seq.fastqsanger" ftype="fastqsanger" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
369 <param name="match_type_selector" value="identifier" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
370 <param name="match_selector" value="regex" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
371 <param name="match_by" value="FAKE0001" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
372 <param name="manipulation_type_selector" value="sequence" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
373 <param name="manipulation_selector" value="rev_comp" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
374 <output name="output_file" file="sanger_full_range_original_sanger.fastqsanger" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
375 </test>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
376 <!-- match all and DNA to RNA -->
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
377 <test>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
378 <param name="input_file" value="sanger_full_range_original_sanger.fastqsanger" ftype="fastqsanger" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
379 <param name="match_type_selector" value="identifier" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
380 <param name="match_selector" value="regex" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
381 <param name="match_by" value=".*" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
382 <param name="manipulation_type_selector" value="sequence" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
383 <param name="manipulation_selector" value="dna_to_rna" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
384 <output name="output_file" file="sanger_full_range_as_rna.fastqsanger" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
385 </test>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
386 <!-- match all and RNA to DNA -->
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
387 <test>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
388 <param name="input_file" value="sanger_full_range_as_rna.fastqsanger" ftype="fastqsanger" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
389 <param name="match_type_selector" value="identifier" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
390 <param name="match_selector" value="regex" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
391 <param name="match_by" value=".*" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
392 <param name="manipulation_type_selector" value="sequence" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
393 <param name="manipulation_selector" value="rna_to_dna" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
394 <output name="output_file" file="sanger_full_range_original_sanger.fastqsanger" />
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
395 </test>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
396 </tests>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
397 <help>
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
398 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
399
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
400 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
401 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
402
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
403 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
404
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
405 .. class:: warningmark
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
406
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
407 Only color space reads can have adapter bases substituted.
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
408
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 **Example**
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
413
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
414 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
415
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
416 Steps:
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
417
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
418 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
419 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
420 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
421 4. Click Execute. The new history item will contained double-encoded psuedo-nucleotide space reads.
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
422
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
423 </help>
1
b50aeae8bcaa planemo upload commit 33927a87ba2eee9bf0ecdd376a66241b17b3d734
devteam
parents: 0
diff changeset
424 <citations>
b50aeae8bcaa planemo upload commit 33927a87ba2eee9bf0ecdd376a66241b17b3d734
devteam
parents: 0
diff changeset
425 <citation type="doi">10.1093/bioinformatics/btq281</citation>
b50aeae8bcaa planemo upload commit 33927a87ba2eee9bf0ecdd376a66241b17b3d734
devteam
parents: 0
diff changeset
426 </citations>
0
de14b969d713 Imported from capsule None
devteam
parents:
diff changeset
427 </tool>