Galaxy | Tool Preview

ivar trim (version 1.4.4+galaxy0)
Aligned reads, to trim primers and quality
When you select Yes, 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. Info on amplicons can be computed from suitable primer BED files (see tool help below) or provided by the user.
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)
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.

iVar uses primer positions supplied in a BED file to soft clip primer sequences from an aligned and sorted BAM file. Following this, the reads are trimmed further based on a quality threshold.

Primer and Amplicon info

The tool requires information about primers and their binding sites in 6-column BED format. The information from this file is used to decide whether any mapped read in the BAM input ends with a primer sequence and should, thus, be soft-clipped.

Optionally, the tool can also discard reads that do not fully map to within any amplicon. Such reads are likely to be wet-lab or mapping artefacts and removing them can increase variant calling precision. To calculate the extent of expected amplicons the tool needs to know which primers work together to form an amplicon. The tool can try to deduce this info from the names of the primers found in the primer info dataset. This will require a primer naming scheme following the regex pattern:

.*_(?P<amplicon_number>\d+).*_(?P<primer_orientation>L(?:EFT)?|R(?:IGHT)?)

i.e., the following schemes will work (and get parsed as):

Alternatively, you can specify the amplicon information explicitly through a dataset that lists the names of primers that together form any given amplicon. In it, primer names (exactly matching those in the primer info dataset) need to be TAB-separated with one line per amplicon. If the primer scheme has more than two primers contributing to a given amplicon (in schemes using alternate primers), you can (in this Galaxy tool only) specify all of them on one line and the tool will calculate the maximum extent of the amplicon.

Quality trimming details and final length filtering

To do the quality trimming, iVar uses a sliding window approach. The window slides from the 5' end to the 3' end and if at any point the average base quality in the window falls below the threshold, the remaining read is soft clipped.

Finally, the trimmed length threshold gets applied if specified, and fully trimmed surviving reads are written to the BAM output.

Documentation can be found at https://andersen-lab.github.io/ivar/html/manualpage.html.