Learn R Programming

msa (version 1.4.3)

msaConvert: Convert Multiple Sequence Alignment for Other Packages

Description

This function converts a multiple sequence alignment object to formats used in other sequence analysis packages.

Usage

msaConvert(x, type=c("seqinr::alignment", "bios2mds::align"))

Arguments

x
an object of class MultipleAlignment (which includes objects of classes MsaAAMultipleAlignment, MsaDNAMultipleAlignment, and MsaRNAMultipleAlignment)
type
a character string specifying to which type of object x should be converted; currently, the two values "seqinr::alignment" and "bios2mds::align" are supported, i.e. an object of class "alignment" as defined by the seqinr package or an object of class "align" as defined in the bios2mds package.

Value

The function returns an object of the class as specified by the type argument.

Details

The function converts x to the class of object as specified by the type argument. Note that this conversion happens independently of the packages seqinr and bios2mds. More specifically, lists with the respective class attributes are returned without actually loading any of the two 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/as.class functions is not used.

References

http://www.bioinf.jku.at/software/msa 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.

See Also

msa, MsaAAMultipleAlignment, MsaDNAMultipleAlignment, MsaRNAMultipleAlignment, MsaMetaData

Examples

Run this code
## 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")

Run the code above in your browser using DataLab