scan_seq: Sequence scanner

Description Usage Arguments Details Value Examples

View source: R/scan_seq.R


Scans over sequences finding changes around given patterns


scan_seq(cons, the_seq, fix_with = FALSE)



The ancestral sequences to compare against


The query sequence


Either false or a single letter. If not FALSE, then replace the hypermutated base with the letter indicated.


The scan_seq function simultaneously passes two sliding windows along the ancestral and query sequences. The sliding window is of length 3, corresponding to the potentially hypermutated position and the 2 downstream positions. At each position, the size of the window is increased until it covers 3 non-gap characters in the query sequence. If a G is located at the first position of the window, the position is considered a position of interest and the query sequence is inspected to classify it as either a hypermutation or control position, incrementing either the num_potential_mut variable or the num_potential_control variable. The query sequence is checked next and if the G mutated to an A, then the tally of the number of possible hypermutations (num_mut) or the number of control mutations (num_control) is incremented.


The return value from scan_seq is a list that contains the number of mutated hypermutation and control positions, the total number of potential hypermutation and control positions, the p-value of the one-sided Fischer exact test, the (possibly corrected) query sequence and the data.frame that catalogs each individual position.


scan_seq(paste(as.character(hd_seqs[1][[1]]), collapse = ''), paste(as.character(hd_seqs[2][[1]]), collapse = ''))

philliplab/hypermutR documentation built on Sept. 2, 2020, 2:51 p.m.