rc | R Documentation |
Reverse, complement or reverse-complement of DNA sequences.
rc(seqs, i, complement = TRUE, reverse = TRUE, delete.gaps = FALSE)
seqs |
An object of class |
i |
Logical or numeric index to indicate a subset of sequences to manipulate. If not given the entire set of sequences will be manipulated. |
complement |
Logical, indicating if sequences will be turned into their complement. |
reverse |
Logical, indication if sequences will be reversed. |
delete.gaps |
Logical, indicating if gap character will be removed prior to sequence manipulation. |
An object of the same class and dimension as seqs
.
## A minimal sequence alignment:
x <- list(
seqA = c("a", "a", "c", "c", "g", "t"),
seqB = c("n", "-", "r", "y", "g", "t"))
x <- as.DNAbin(x)
## Three choices of manipulation:
as.character(x)
as.character(rc(x)) ## reverse-complement
as.character(rc(x, complement = FALSE)) ## only reverse
as.character(rc(x, reverse = FALSE)) ## only complement
## You can remove gaps:
as.character(rc(x, delete.gaps = TRUE)) ## gaps/indels removed
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.