Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

reverseComplement

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

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

Basic Biological Sequence Handling

v2.1.4
GPL-2
Authors
Lars Snipen, Kristian Hovde Liland
Initial release
2021-01-25

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.