replaceOuterGaps: Convenience function to replace gaps at the start and end of...

View source: R/plotDNA.R

replaceOuterGapsR Documentation

Convenience function to replace gaps at the start and end of a sequence with a different character

Description

Replace gaps at the start and/or end of a sequence with another character (e.g. —A-A–A— to ...A-A–A...). This can be used to indicate the difference between indels within known sequences and unknown sequence surrounding a sequence.

Usage

replaceOuterGaps(
  seqs,
  leftEnd = TRUE,
  rightEnd = TRUE,
  gapChars = c("*", "-"),
  replaceChar = "."
)

Arguments

seqs

a character vector of sequences

leftEnd

logical indicating whether gaps should be replaced at the start of the sequence

rightEnd

logical indicating whether gaps should be replaced at the end of the sequence

gapChars

a vector of single characters that count as gaps

replaceChar

character to replace start/end gaps with

Value

A character vector of sequences with start and/or end gaps replaced with replaceChar

Examples

replaceOuterGaps(c('--A-A--','AAA--AAA','--A-A','A-A--'))

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