maskSeqGaps function

Masks gap characters in DNA sequences

Masks gap characters in DNA sequences

maskSeqGaps substitutes gap characters, c("-", "."), with "N"

in a vector of DNA sequences.

maskSeqGaps(seq, mask_char = "N", outer_only = FALSE)

Arguments

  • seq: character vector of DNA sequence strings.
  • mask_char: character to use for masking.
  • outer_only: if TRUE replace only contiguous leading and trailing gaps; if FALSE replace all gap characters.

Returns

A modified seq vector with "N" in place of c("-", ".")

characters.

Examples

# Mask with Ns maskSeqGaps(c("ATG-C", "CC..C")) maskSeqGaps("--ATG-C-") maskSeqGaps("--ATG-C-", outer_only=TRUE) # Mask with dashes maskSeqGaps(c("ATG-C", "CC..C"), mask_char="-")

See Also

See maskSeqEnds for masking ragged edges.

  • Maintainer: Susanna Marquez
  • License: AGPL-3
  • Last published: 2023-09-30