Mercurial > repos > iuc > ivar_trim
comparison ivar_trim.xml @ 5:cf65217ad61c draft
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ivar/ commit a5ff06c631a2a5a0d5d44edd6cb58a599d50918b"
author | iuc |
---|---|
date | Wed, 19 May 2021 16:51:27 +0000 |
parents | db536ad45f28 |
children | 397e5f0eb3ef |
comparison
equal
deleted
inserted
replaced
4:db536ad45f28 | 5:cf65217ad61c |
---|---|
1 <tool id="ivar_trim" name="ivar trim" version="@VERSION@+galaxy1"> | 1 <tool id="ivar_trim" name="ivar trim" version="@VERSION@+galaxy0"> |
2 <description>Trim reads in aligned BAM</description> | 2 <description>Trim reads in aligned BAM</description> |
3 <macros> | 3 <macros> |
4 <import>macros.xml</import> | 4 <import>macros.xml</import> |
5 </macros> | 5 </macros> |
6 <expand macro="requirements"> | 6 <expand macro="requirements"> |
7 <requirement type="package" version="3.8.1">python</requirement> | 7 <requirement type="package" version="3.8.1">python</requirement> |
8 </expand> | 8 </expand> |
9 <expand macro="version_command" /> | 9 <expand macro="version_command" /> |
10 <command detect_errors="exit_code"><![CDATA[ | 10 <command detect_errors="exit_code"><![CDATA[ |
11 #if $primer.source == "history" | 11 #if $primer.source == 'history' |
12 cp '$primer.input_bed' bed.bed && | 12 cp '$primer.input_bed' bed.bed && |
13 #else | 13 #else |
14 cp '$primer.cached_bed.fields.path' bed.bed && | 14 cp '$primer.cached_bed.fields.path' bed.bed && |
15 #end if | 15 #end if |
16 python '$__tool_directory__/sanitize_bed.py' bed.bed && | 16 python '$__tool_directory__/sanitize_bed.py' bed.bed && |
17 | 17 #if $amplicons.filter_by == 'yes' |
18 python '$__tool_directory__/prepare_amplicon_info.py' bed.bed '$amplicons.amplicon_info' amplicon_info.tsv && | |
19 #end if | |
18 ln -s '$input_bam' sorted.bam && | 20 ln -s '$input_bam' sorted.bam && |
19 ln -s '${input_bam.metadata.bam_index}' sorted.bam.bai && | 21 ln -s '${input_bam.metadata.bam_index}' sorted.bam.bai && |
20 | 22 |
21 ivar trim | 23 ivar trim |
22 -i sorted.bam | 24 -i sorted.bam |
23 -b bed.bed | 25 -b bed.bed |
26 #if $amplicons.filter_by == 'yes' | |
27 -f amplicon_info.tsv | |
28 #end if | |
29 -x $primer_pos_wiggle | |
30 $inc_primers | |
24 -m $min_len | 31 -m $min_len |
25 -q $min_qual | 32 -q $min_qual |
26 -s $window_width | 33 -s $window_width |
27 $inc_primers | |
28 -p trimmed && | 34 -p trimmed && |
29 samtools sort -@ \${GALAXY_SLOTS:-1} -o trimmed.sorted.bam trimmed.bam | 35 samtools sort -@ \${GALAXY_SLOTS:-1} -o trimmed.sorted.bam trimmed.bam |
30 ]]> </command> | 36 ]]> </command> |
31 <inputs> | 37 <inputs> |
32 <param name="input_bam" argument="-i" type="data" format="bam" label="Bam file" help="Aligned reads, to trim primers and quality"/> | 38 <param name="input_bam" argument="-i" type="data" format="bam" label="Bam file" help="Aligned reads, to trim primers and quality"/> |
45 <validator type="no_options" message="No primer schemes are available" /> | 51 <validator type="no_options" message="No primer schemes are available" /> |
46 </options> | 52 </options> |
47 </param> | 53 </param> |
48 </when> | 54 </when> |
49 </conditional> | 55 </conditional> |
56 <conditional name="amplicons"> | |
57 <param name="filter_by" type="select" | |
58 label="Filter reads based on amplicon info" | |
59 help="When you select Yes you will need to provide an additional amplicon info dataset. Reads that are not fully contained in any amplicon will be dropped before primer trimming. This option is currently marked as [Experimental] in ivar, but nevertheless recommended here."> | |
60 <option value="">No, allow reads to extend beyond amplicon boundaries</option> | |
61 <option value="yes">Yes, drop reads that extend beyond amplicon boundaries</option> | |
62 </param> | |
63 <when value="yes"> | |
64 <param name="amplicon_info" argument="-f" type="data" format="tabular" /> | |
65 </when> | |
66 <when value="" /> | |
67 </conditional> | |
68 <param name="primer_pos_wiggle" argument="-x" type="integer" min="0" value="0" | |
69 label="Wiggling room for read ends relative to primer binding sites" | |
70 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)" /> | |
71 <param name="inc_primers" argument="-e" type="boolean" truevalue="-e" falsevalue="" checked="false" label="Include reads not ending in any primer binding sites?"/> | |
50 <param name="min_len" argument="-m" type="integer" min="0" value="30" label="Minimum length of read to retain after trimming"/> | 72 <param name="min_len" argument="-m" type="integer" min="0" value="30" label="Minimum length of read to retain after trimming"/> |
51 <param name="min_qual" argument="-q" type="integer" min="0" value="20" label="Minimum quality threshold for sliding window to pass"/> | 73 <param name="min_qual" argument="-q" type="integer" min="0" value="20" label="Minimum quality threshold for sliding window to pass"/> |
52 <param name="window_width" argument="-s" type="integer" min="0" value="4" label="Width of sliding window"/> | 74 <param name="window_width" argument="-s" type="integer" min="0" value="4" label="Width of sliding window"/> |
53 <param name="inc_primers" argument="-e" type="boolean" truevalue="-e" falsevalue="" checked="false" label="Include reads with no primers"/> | |
54 </inputs> | 75 </inputs> |
55 <outputs> | 76 <outputs> |
56 <data name="output_bam" format="bam" label="${tool.name} on ${on_string} Trimmed bam" from_work_dir="trimmed.sorted.bam"/> | 77 <data name="output_bam" format="bam" label="${tool.name} on ${on_string} Trimmed bam" from_work_dir="trimmed.sorted.bam"/> |
57 </outputs> | 78 </outputs> |
58 <tests> | 79 <tests> |
91 <conditional name="primer"> | 112 <conditional name="primer"> |
92 <param name="source" value="cached" /> | 113 <param name="source" value="cached" /> |
93 <param name="cached_bed" value="SARS-CoV-2-ARTICv1" /> | 114 <param name="cached_bed" value="SARS-CoV-2-ARTICv1" /> |
94 </conditional> | 115 </conditional> |
95 <param name="input_bam" value="sars-cov-2/sars_cov2_untrimmed.bam" ftype="bam" /> | 116 <param name="input_bam" value="sars-cov-2/sars_cov2_untrimmed.bam" ftype="bam" /> |
96 <output name="output_bam" file="sars-cov-2/sars_cov2_trimmed.bam" /> | 117 <output name="output_bam" file="sars-cov-2/sars_cov2_trimmed.bam" compare="sim_size" delta="100000"/> |
97 </test> | 118 </test> |
98 </tests> | 119 </tests> |
99 <help><![CDATA[ | 120 <help><![CDATA[ |
100 iVar uses primer positions supplied in a BED file to soft clip primer | 121 iVar uses primer positions supplied in a BED file to soft clip primer |
101 sequences from an aligned and sorted BAM file. Following this, the reads are | 122 sequences from an aligned and sorted BAM file. Following this, the reads are |
102 trimmed based on a quality threshold(Default: 20). To do the quality | 123 trimmed further based on a quality threshold. |
103 trimming, iVar uses a sliding window approach(Default: 4). The windows | 124 |
104 slides from the 5' end to the 3' end and if at any point the average base | 125 **Primer and Amplicon info** |
105 quality in the window falls below the threshold, the remaining read is soft | 126 |
106 clipped. If after trimming, the length of the read is greater than the | 127 The tool requires information about primers and their binding sites in 6-column |
107 minimum length specified(Default: 30), the read is written to the new | 128 BED format. The information from this file is used to decide whether any mapped |
108 trimmed BAM file | 129 read in the BAM input ends with a primer sequence and should, thus, be |
109 | 130 soft-clipped. |
110 Documentation can be found at `<https://andersen-lab.github.io/ivar/html/manualpage.html>`_. | 131 |
111 ]]> </help> | 132 Optionally, the tool can also discard reads that do not fully map to within any |
133 amplicon. Such reads are likely to be wet-lab or mapping artefacts and removing | |
134 them can increase variant calling precision. To calculate the extent of | |
135 expected amplicons the tool requires an additional amplicon info dataset that | |
136 lists the names of primers that together form any given amplicon. Primer names | |
137 (exactly matching those in the primer info dataset) need to be TAB-separated | |
138 with one line per amplicon. | |
139 If the primer scheme has more than two primers contributing to a given amplicon | |
140 (in schemes using alternate primers), you can (in this Galaxy tool only) | |
141 specify all of them on one line and the tool will calculate the maximum extent | |
142 of the amplicon. | |
143 | |
144 **Quality trimming details** | |
145 | |
146 To do the quality trimming, iVar uses a sliding window approach. The window | |
147 slides from the 5' end to the 3' end and if at any point the average base | |
148 quality in the window falls below the threshold, the remaining read is soft | |
149 clipped. If after trimming, the length of the read is greater than the minimum | |
150 length specified, the read is written to the new trimmed BAM file. | |
151 | |
152 Documentation can be found at `<https://andersen-lab.github.io/ivar/html/manualpage.html>`_. | |
153 ]]></help> | |
112 <expand macro="citations" /> | 154 <expand macro="citations" /> |
113 </tool> | 155 </tool> |