Multiple Sequence (MS) Objects


Creates a new Multiple Sequences (MS) object to hold given sequences.


ms(seqs, names = NULL, offsets = NULL, pointer.only = FALSE)



A character vector containing sequences, one per sample


A character vector identifying the sample name for each sequence. If NULL, use "seq1", "seq2", ...


List of integers giving the offset for each sequences from the start of its unsplit sequence. If NULL, offsets of zero are assumed for each sequence.


a boolean indicating whether returned alignment object should be stored by reference (see Details)


Make a new multiple sequence (MS) object given a vector of character strings. They can be optionally annotated with sample names.

The number of elements in names (if provided) must match the number of elements in seqs.

An alphabet (valid non-missing characters) of "ACGT" is automatically assumed for all sequences that RTFBS operates on.

About storing objects as pointers: If pointer.only==FALSE, the MS object will be stored in R and can be viewed and modified by base R code as well as RTFBS functions. Setting pointer.only=TRUE will cause the object to be stored by reference, as an external pointer to an object created by C code. This may be necessary to improve performance, but the object can then only be viewed/manipulated via RTFBS functions. Furthermore, if an object is stored as a pointer, then its value is liable to be changed when passed as an argument to a function.


An ms object. These are stored in an array-like format, so that they can be subsetted with the [] operator.


Nick Peterson

See Also

Functions for accessing/viewing ms objects:,,,,,,, [.ms,,,

Questions? Problems? Suggestions? or email at

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.