gapToNoGap: Convenience function to convert gapped coordinates to what...

View source: R/plotDNA.R

gapToNoGapR Documentation

Convenience function to convert gapped coordinates to what the coordinates would be without gaps

Description

Take a reference sequence with gaps and coordinates in that gapped reference sequence and translate the coordinates to the corresponding positions in the gap free sequence. Note that positions landing on a gap are converted to the first 5' nongap position e.g. the fifth position of 'G—–G' is converted to 1 and the second position of '–G–GG' is converted to 0

Usage

gapToNoGap(refSeq, coords, gapChars = c("*", ".", "-"))

Arguments

refSeq

the sequence containing gaps

coords

coordinates on the gapped refSeq to be converted into equivalent nongap coordinates

gapChars

characters interpreted as gaps

Value

A vector of coordinates in the gap free reference sequence

Examples

gapToNoGap('AA--AA-A',c(1:8))

sherrillmix/dnaplotr documentation built on Oct. 29, 2022, 4:42 p.m.