pal2nal | R Documentation |
This function takes an AAStringSet
alignment and
its corresponding coding sequences DNAStringSet
and converts
the protein alignment into a codon alignment.
pal2nal(pal, nal, remove.gaps = FALSE)
pal |
|
nal |
|
remove.gaps |
specify if gaps in the codon alignment should be removed [default: FALSE] |
codon alignment as DNAStringSet
Kristian K Ullrich
Pagès, H et al. (2014) Biostrings: Efficient manipulation of biological strings. R package version, 2(0).
pairwiseAlignment
## 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
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.