This Galaxy tool combines the functionality of ivar getmasked and ivar removereads. No separate ivar getmasked step is required when using this tool.
The wrapper takes as input a BAM dataset of aligned and sorted reads, from which the primers listed in the primer binding sites BED input have been trimmed with ivar trim.
From this input it will remove reads that come from amplicons that have been generated with one or more primers that may have been affected in their binding by variants listed in the variants input file. To do its job, the 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.
Preprocessing of the BAM input with ivar trim is essential for this tool to work because only ivar trim can add required primer information to the BAM auxillary data of every read.
ivar documentation can be found at https://andersen-lab.github.io/ivar/html/manualpage.html.