reverseComplement: Reverse-complementation of DNA

View source: R/dnaManipulate.R

reverseComplementR Documentation

Reverse-complementation of DNA

Description

The standard reverse-complement of nucleotide sequences.

Usage

reverseComplement(nuc.sequences, reverse = TRUE)

Arguments

nuc.sequences

Character vector containing the nucleotide sequences.

reverse

Logical indicating if complement should be reversed.

Details

With ‘⁠reverse = FALSE⁠’ the DNA sequence is only complemented, not reversed.

This function will handle the IUPAC ambiguity symbols, i.e. ‘⁠R⁠’ is reverse-complemented to ‘⁠Y⁠’ etc.

Value

A character vector of reverse-complemented sequences.

Author(s)

Lars Snipen and Kristian Hovde Liland.

See Also

iupac2regex, regex2iupac.

Examples

fa.file <- file.path(file.path(path.package("microseq"),"extdata"),"small.ffn")
fa <- readFasta(fa.file)
reverseComplement(fa$Sequence)

#' # Or, make use of dplyr to manipulate tables
readFasta(fa.file) %>%
  mutate(RevComp = reverseComplement(Sequence)) -> fa.tbl


microseq documentation built on Aug. 21, 2023, 5:10 p.m.