This function converts a multiple sequence alignment object to formats used in other sequence analysis packages.
1 2 3 4
an object of class
a character string specifying to which type of object
The function converts
x to the class of object as
specified by the
type argument. The values possible
type argument follow the same principle
x is converted to class
cl as defined in the pkg package.
The conversions for usage by the packages seqinr,
bios2mds, and ape work independently of these
packages and do not strictly require these packages. They
need not even be installed. This approach has been chosen
to avoid abundant dependencies and possible incompatibilities.
That is also why the standard S3/S4 mechanism of
as.class functions is not used.
The conversion to the
phyDat class can be done
easily using the
as.phyDat function from the
phangorn package. The
still provides this conversion for the sake of consistency.
However, this conversion is just a wrapper function around
as.phyDat function from the phangorn
package. Thus, the phangorn package needs to be installed.
only works for multiple alignments of amino acid sequences,
while the conversions
"phangorn::phyDat" only work for multiple alignments
of DNA sequences. When converting to
gaps/dashes are replaced by ‘X’. Moreover, conversions
"ape::DNAbin" also convert all characters to
lowercase and replace gaps/dashes by ‘n’.
The function returns an object of the class as specified by
Ulrich Bodenhofer <email@example.com>
U. Bodenhofer, E. Bonatesta, C. Horejs-Kainrath, and S. Hochreiter (2015). msa: an R package for multiple sequence alignment. Bioinformatics 31(24):3997-3999. DOI: 10.1093/bioinformatics/btv494.
1 2 3 4 5 6 7 8 9 10 11 12
## read sequences filepath <- system.file("examples", "exampleAA.fasta", package="msa") mySeqs <- readAAStringSet(filepath) ## perform multiple alignment myAlignment <- msa(mySeqs) ## convert to an object of class 'alignment' (package 'seqinr') msaConvert(myAlignment, "seqinr::alignment") ## convert to an object of class 'align' (package 'bios2mds') msaConvert(myAlignment, "bios2mds::align")