find_primer_matches: Find primer matches for reads

View source: R/primers.R

find_primer_matchesR Documentation

Find primer matches for reads

Description

Returns a data frame of index values for the two input vectors for each match, along with start and stop positions within each read and a count of base mismatches. There may be zero, one, or multiple output rows per input read.

Usage

find_primer_matches(
  seqs_reads,
  seqs_primers,
  max_mismatches = cfg("max_mismatches")
)

Arguments

seqs_reads

character vector of read sequences

seqs_primers

character vector of primer sequences

max_mismatches

integer number of mismatches allowed when checking primers against reads, or NA to check all combinations

Details

Indels are not supported. Partial matches are supported at the 3' end and are counted as mismatches.

If max_mismatches is NA, the best match for every read and primer combination will be included in the output. If max_mismatches is an integer, at most one row will be provided for each read (for the first discovered primer at or below that number of mismatches). In this mode the primers are checked for perfect matches first and then re-checked in decreasing order of abundance to find any imperfect matches. This means that a search with a maximum mismatch count specified will be much faster than one without, but could give counterintuitive results for some edge cases. For example, with max mismatches of 10 and a read containing primer A at 5 mismatches and primer B at 8 mismatches, either A or B may be matched depending on the relative abundance of perfect matches found elsewhere. In practice, with dissimilar primer sequences and a low number of allowed mismatches, this is unlikely to be a problem.

Value

data frame of read and primer index pairs and match details


ShawHahnLab/microsat documentation built on Aug. 25, 2023, 11:16 p.m.