find_primer: Find the best location for a primer sequence in a gappy...

View source: R/amplicon_extract.R

find_primerR Documentation

Find the best location for a primer sequence in a gappy alignment

Description

This is a relatively simple algorithm which aligns the primer sequences to each sequence in the alignment, maps the aligned locations into the alignment, and takes the most frequent location. A warning is issued if more than 10% of the sequences in the alignment have non-consensus primer positions; a frequent cause of this is if some of the sequences are fragmentary and do not actually include the primer site, but in any case it is recommended to manually check results.

Usage

find_primer(ungapped, gaps, primer)

Arguments

ungapped

(DNAStringSet object) The unaligned, gap-free sequences in the alignment.

gaps

(list of IRanges objects) The locations of gaps in each sequence of ungapped when aligned.

primer

(DNAString object) The primer sequence to search for. It should be in the orientation which matches the sequences in the alignment. (I.e., reverse primer sequences should be reverse complemented prior to calling find_primer().)

Value

named integer of length two, with elements start and end giving the best fit range for the primer in the alignment.


brendanf/LSUx documentation built on Oct. 10, 2024, 1:31 p.m.