comparison ivar_trim.xml @ 15:a2b94388d00d draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ivar/ commit 3839802e0a790cb519cffdc2d8a6b92d73e4c9ef
author iuc
date Sat, 25 Mar 2023 12:53:12 +0000
parents bcaa0d571ce2
children 28e4bcbc86e7
comparison
equal deleted inserted replaced
14:bcaa0d571ce2 15:a2b94388d00d
29 #if $amplicons.filter_by == 'yes' or $amplicons.filter_by == 'yes_compute' 29 #if $amplicons.filter_by == 'yes' or $amplicons.filter_by == 'yes_compute'
30 -f amplicon_info.tsv 30 -f amplicon_info.tsv
31 #end if 31 #end if
32 -x $primer_pos_wiggle 32 -x $primer_pos_wiggle
33 $inc_primers 33 $inc_primers
34 -m $min_len 34 #if $trimmed_length.filter == 'off':
35 -m 0
36 #elif $trimmed_length.filter == 'auto':
37 -m -1
38 #else:
39 -m $trimmed_length.min_len
40 #end if
35 -q $min_qual 41 -q $min_qual
36 -s $window_width 42 -s $window_width
37 -p trimmed && 43 ## since v1.4 ivar trim *almost* supports piping its output, but
38 samtools sort -@ \${GALAXY_SLOTS:-1} -o trimmed.sorted.bam trimmed.bam 44 ## unfortunately still writes *some* regular messages to stdout,
39 ]]> </command> 45 ## so we need to stick writing to an intermediate file for now and
46 ## want to unify the output stream
47 -p trimmed 1>&2 &&
48 samtools sort -@ \${GALAXY_SLOTS:-1} -T "\${TMPDIR:-.}" -o trimmed.sorted.bam trimmed.bam
49 ]]></command>
40 <inputs> 50 <inputs>
41 <param name="input_bam" argument="-i" type="data" format="bam" label="Bam file" help="Aligned reads, to trim primers and quality"/> 51 <param name="input_bam" argument="-i" type="data" format="bam" label="Bam file" help="Aligned reads, to trim primers and quality"/>
42 <conditional name="primer"> 52 <conditional name="primer">
43 <param label="Source of primer information" name="source" type="select"> 53 <param label="Source of primer information" name="source" type="select">
44 <option value="history" selected="true">History</option> 54 <option value="history" selected="true">History</option>
72 </conditional> 82 </conditional>
73 <param name="primer_pos_wiggle" argument="-x" type="integer" min="0" value="0" 83 <param name="primer_pos_wiggle" argument="-x" type="integer" min="0" value="0"
74 label="Wiggling room for read ends relative to primer binding sites" 84 label="Wiggling room for read ends relative to primer binding sites"
75 help="Reads that occur at the specified offset positions relative to primer positions (as annotated in the primer information dataset) will also be trimmed (default: 0)" /> 85 help="Reads that occur at the specified offset positions relative to primer positions (as annotated in the primer information dataset) will also be trimmed (default: 0)" />
76 <param name="inc_primers" argument="-e" type="boolean" truevalue="-e" falsevalue="" checked="false" label="Include reads not ending in any primer binding sites?"/> 86 <param name="inc_primers" argument="-e" type="boolean" truevalue="-e" falsevalue="" checked="false" label="Include reads not ending in any primer binding sites?"/>
77 <param name="min_len" argument="-m" type="integer" min="0" value="30" label="Minimum length of read to retain after trimming"/>
78 <param name="min_qual" argument="-q" type="integer" min="0" max="255" value="20" label="Minimum quality threshold for sliding window to pass"/> 87 <param name="min_qual" argument="-q" type="integer" min="0" max="255" value="20" label="Minimum quality threshold for sliding window to pass"/>
79 <param name="window_width" argument="-s" type="integer" min="0" max="255" value="4" label="Width of sliding window"/> 88 <param name="window_width" argument="-s" type="integer" min="0" max="255" value="4" label="Width of sliding window"/>
89 <conditional name="trimmed_length">
90 <param name="filter" type="select" label="Require a minimum length for reads to retain them after any trimming?" help="The default automatic setting will determine the threshold as 50% of the mean length of the first 1000 raw input reads, which may or may not be adequate for your data. You can always make the outcome of filtering more predictable by specifying the threshold explicitly. You can also opt to retain reads independently of their trimmed length, but typically this only makes sense if you are performing additional read filtering with additional tools in your analysis pipeline.">
91 <option value="off">No, keep reads independently of their trimmed length (-m 0)</option>
92 <option value="auto" selected="true">Yes, and determine required length threshold automatically from input (-m -1)</option>
93 <option value="custom">Yes, and provide a custom threshold</option>
94 </param>
95 <when value="off" />
96 <when value="auto" />
97 <when value="custom">
98 <param name="min_len" argument="-m" type="integer" min="1" value="30" label="Minimum trimmed length threshold" help="Reads with a trimmed length shorter than this value will be discarded."/>
99 </when>
100 </conditional>
80 </inputs> 101 </inputs>
81 <outputs> 102 <outputs>
82 <data name="output_bam" format="bam" label="${tool.name} on ${on_string} Trimmed bam" from_work_dir="trimmed.sorted.bam"/> 103 <data name="output_bam" format="bam" label="${tool.name} on ${on_string} Trimmed bam" from_work_dir="trimmed.sorted.bam"/>
83 </outputs> 104 </outputs>
84 <tests> 105 <tests>
85 <!-- #1: SARS-Cov data--> 106 <!-- #1: SARS-Cov data-->
86 <test> 107 <test>
87 <param name="input_bam" value="covid19/PC00101P_sub.sorted.bam" /> 108 <param name="input_bam" value="covid19/PC00101P_sub.sorted.bam" />
88 <param name="input_bed" value="covid19/ARTIC-V1.bed" /> 109 <param name="input_bed" value="covid19/ARTIC-V1.bed" />
89 <param name="inc_primers" value="true" /> 110 <param name="inc_primers" value="true" />
111 <conditional name="trimmed_length">
112 <param name="filter" value="custom" />
113 <param name="min_len" value="30" />
114 </conditional>
90 <output name="output_bam" file="covid19/PC00101P_sub.sorted.bam" compare="sim_size" delta="300000"/> 115 <output name="output_bam" file="covid19/PC00101P_sub.sorted.bam" compare="sim_size" delta="300000"/>
91 </test> 116 </test>
92 <test> 117 <test>
93 <!-- Test with primer bed file that needs to be sanitized --> 118 <!-- Test with primer bed file that needs to be sanitized -->
94 <param name="input_bam" value="covid19/PC00101P_sub.sorted.bam" /> 119 <param name="input_bam" value="covid19/PC00101P_sub.sorted.bam" />
95 <param name="input_bed" value="covid19/ARTIC-V1-bad.bed" /> 120 <param name="input_bed" value="covid19/ARTIC-V1-bad.bed" />
96 <param name="inc_primers" value="true" /> 121 <param name="inc_primers" value="true" />
122 <conditional name="trimmed_length">
123 <param name="filter" value="custom" />
124 <param name="min_len" value="30" />
125 </conditional>
97 <output name="output_bam" file="covid19/PC00101P_sub.sorted.bam" compare="sim_size" delta="300000"/> 126 <output name="output_bam" file="covid19/PC00101P_sub.sorted.bam" compare="sim_size" delta="300000"/>
98 </test> 127 </test>
99 <!-- #1: Zika data--> 128 <!-- #1: Zika data-->
100 <test> 129 <test>
101 <conditional name="primer"> 130 <conditional name="primer">
102 <param name="source" value="history" /> 131 <param name="source" value="history" />
103 <param name="input_bed" value="zika/db/zika_primers.bed" /> 132 <param name="input_bed" value="zika/db/zika_primers.bed" />
104 </conditional> 133 </conditional>
105 <param name="input_bam" value="zika/Z52_a.sorted.bam" /> 134 <param name="input_bam" value="zika/Z52_a.sorted.bam" />
135 <conditional name="trimmed_length">
136 <param name="filter" value="custom" />
137 <param name="min_len" value="30" />
138 </conditional>
106 <output name="output_bam" file="zika/Z52_a.trimmed.sorted.bam" compare="sim_size" delta="100000"/> 139 <output name="output_bam" file="zika/Z52_a.trimmed.sorted.bam" compare="sim_size" delta="100000"/>
107 </test> 140 </test>
108 <test> 141 <test>
109 <conditional name="primer"> 142 <conditional name="primer">
110 <param name="source" value="history" /> 143 <param name="source" value="history" />
111 <param name="input_bed" value="zika/db/zika_primers.bed" /> 144 <param name="input_bed" value="zika/db/zika_primers.bed" />
112 </conditional> 145 </conditional>
113 <param name="input_bam" value="zika/Z52_b.sorted.bam" /> 146 <param name="input_bam" value="zika/Z52_b.sorted.bam" />
147 <conditional name="trimmed_length">
148 <param name="filter" value="auto" />
149 </conditional>
114 <output name="output_bam" ftype="bam"> 150 <output name="output_bam" ftype="bam">
115 <assert_contents> 151 <assert_contents>
116 <has_size value="4023965" delta="1000"/> 152 <has_size value="3373924" delta="1000"/>
117 </assert_contents> 153 </assert_contents>
118 </output> 154 </output>
119 <assert_stdout> 155 <assert_stderr>
120 <has_text text="Found 68 primers in BED file"/> 156 <has_text text="Found 68 primers in BED file"/>
121 <has_text text="Using Region: PRV"/> 157 <has_text text="reads were quality trimmed below the minimum length of 125 bp and were not written to file"/>
122 <has_text text="Found 40964 mapped reads"/>
123 <has_text text="reads were quality trimmed below the minimum length of 30 bp and were not written to file"/>
124 <has_text text="reads that started outside of primer regions were not written to file"/> 158 <has_text text="reads that started outside of primer regions were not written to file"/>
125 </assert_stdout> 159 </assert_stderr>
126 </test> 160 </test>
127 <test> 161 <test>
128 <conditional name="primer"> 162 <conditional name="primer">
129 <param name="source" value="cached" /> 163 <param name="source" value="cached" />
130 <param name="cached_bed" value="SARS-CoV-2-ARTICv1" /> 164 <param name="cached_bed" value="SARS-CoV-2-ARTICv1" />
131 </conditional> 165 </conditional>
132 <param name="input_bam" value="sars-cov-2/sars_cov2_untrimmed.bam" ftype="bam" /> 166 <param name="input_bam" value="sars-cov-2/sars_cov2_untrimmed.bam" ftype="bam" />
167 <conditional name="trimmed_length">
168 <param name="filter" value="custom" />
169 <param name="min_len" value="30" />
170 </conditional>
133 <output name="output_bam" file="sars-cov-2/sars_cov2_trimmed.bam" compare="sim_size" delta="100000"/> 171 <output name="output_bam" file="sars-cov-2/sars_cov2_trimmed.bam" compare="sim_size" delta="100000"/>
134 </test> 172 </test>
135 <test> 173 <test>
136 <conditional name="primer"> 174 <conditional name="primer">
137 <param name="source" value="cached" /> 175 <param name="source" value="cached" />
139 </conditional> 177 </conditional>
140 <conditional name="amplicons"> 178 <conditional name="amplicons">
141 <param name="filter_by" value="yes_compute" /> 179 <param name="filter_by" value="yes_compute" />
142 </conditional> 180 </conditional>
143 <param name="input_bam" value="sars-cov-2/sars_cov2_untrimmed.bam" ftype="bam" /> 181 <param name="input_bam" value="sars-cov-2/sars_cov2_untrimmed.bam" ftype="bam" />
182 <conditional name="trimmed_length">
183 <param name="filter" value="custom" />
184 <param name="min_len" value="30" />
185 </conditional>
144 <assert_command> 186 <assert_command>
145 <has_text text="write_amplicon_info_file" /> 187 <has_text text="write_amplicon_info_file" />
146 </assert_command> 188 </assert_command>
147 <output name="output_bam" file="sars-cov-2/sars_cov2_trimmed.bam" compare="sim_size" delta="100000"/> 189 <output name="output_bam" file="sars-cov-2/sars_cov2_trimmed.bam" compare="sim_size" delta="100000"/>
148 </test> 190 </test>
184 If the primer scheme has more than two primers contributing to a given amplicon 226 If the primer scheme has more than two primers contributing to a given amplicon
185 (in schemes using alternate primers), you can (in this Galaxy tool only) 227 (in schemes using alternate primers), you can (in this Galaxy tool only)
186 specify all of them on one line and the tool will calculate the maximum extent 228 specify all of them on one line and the tool will calculate the maximum extent
187 of the amplicon. 229 of the amplicon.
188 230
189 **Quality trimming details** 231 **Quality trimming details and final length filtering**
190 232
191 To do the quality trimming, iVar uses a sliding window approach. The window 233 To do the quality trimming, iVar uses a sliding window approach. The window
192 slides from the 5' end to the 3' end and if at any point the average base 234 slides from the 5' end to the 3' end and if at any point the average base
193 quality in the window falls below the threshold, the remaining read is soft 235 quality in the window falls below the threshold, the remaining read is soft
194 clipped. If after trimming, the length of the read is greater than the minimum 236 clipped.
195 length specified, the read is written to the new trimmed BAM file. 237
238 Finally, the trimmed length threshold gets applied if specified, and fully
239 trimmed surviving reads are written to the BAM output.
196 240
197 Documentation can be found at `<https://andersen-lab.github.io/ivar/html/manualpage.html>`_. 241 Documentation can be found at `<https://andersen-lab.github.io/ivar/html/manualpage.html>`_.
198 ]]></help> 242 ]]></help>
199 <expand macro="citations" /> 243 <expand macro="citations" />
200 </tool> 244 </tool>