pal2nal: pal2nal

View source: R/pal2nal.R

pal2nalR Documentation

pal2nal

Description

This function takes an AAStringSet alignment and its corresponding coding sequences DNAStringSet and converts the protein alignment into a codon alignment.

Usage

pal2nal(pal, nal, remove.gaps = FALSE)

Arguments

pal

AAStringSet [mandatory]

nal

DNAStringSet [mandatory]

remove.gaps

specify if gaps in the codon alignment should be removed [default: FALSE]

Value

codon alignment as DNAStringSet

Author(s)

Kristian K Ullrich

References

Pagès, H et al. (2014) Biostrings: Efficient manipulation of biological strings. R package version, 2(0).

See Also

pairwiseAlignment

Examples

## define two cds sequences
cds <- Biostrings::DNAStringSet(c("ATGCAACATTGC", "ATGCATTGC"))
names(cds) <- c("cds1", "cds2")
## get protein alignment
aa <- MSA2dist::cds2aa(cds)
msa <- makePostalignedSeqs(pwalign::pairwiseAlignment(aa[1], aa[2]))[[1L]]
names(msa) <- names(aa)
## get codon alignment
nal <- MSA2dist::pal2nal(pal=msa, nal=cds)
nal

kullrich/MSA2dist documentation built on April 26, 2024, 4:43 p.m.