| seqinfo {GenomicRanges} | R Documentation |
A set of generic functions for getting/setting sequence information from/on an object.
seqinfo(x) seqinfo(x, new2old=NULL) <- value seqnames(x) seqnames(x) <- value seqlevels(x) seqlevels(x) <- value seqlengths(x) seqlengths(x) <- value isCircular(x) isCircular(x) <- value isCircularWithKnownLength(x)
x |
The object from/on which to get/set the sequence information. |
new2old |
The new2old argument allows the user to rename, drop, add and/or
reorder the "sequence levels" in x.
If |
value |
Typically a Seqinfo object for the seqinfo setter.
Either a named or unnamed character vector for the A vector containing the sequence information to store for the other setters. |
Various classes implement methods for those generic functions.
The Seqinfo class plays a central role for those generics because:
seqinfo. That is, the seqnames, seqlevels,
seqlengths, isCircular and
isCircularWithKnownLength getters are defined
for Seqinfo objects.
seqinfo getter are typically
expected to return a Seqinfo object.
seqlevels, seqlengths, isCircular
and isCircularWithKnownLength getters and setters are provided.
By default, seqlevels(x) does seqlevels(seqinfo(x)),
seqlengths(x) does seqlengths(seqinfo(x)),
isCircular(x) does isCircular(seqinfo(x)),
and isCircularWithKnownLength(x) does
isCircularWithKnownLength(seqinfo(x)).
So any class with a seqinfo getter that returns a
Seqinfo object also has all those getters working
out-of-the-box.
See the GRanges, GRangesList and GappedAlignments
classes as examples of such classes (those 3 classes are defined
in the GenomicRanges package).
The full list of methods defined for a given generic can
be seen with e.g. showMethods("seqinfo") or
showMethods("seqnames") (for the getters),
and showMethods("seqinfo<-") or showMethods("seqnames<-")
(for the setters aka replacement methods).
Please be aware that this shows only methods defined in packages
that are currently attached.
Seqinfo-class, GRanges-class, GRangesList-class, GappedAlignments-class
showMethods("seqinfo")
showMethods("seqinfo<-")
showMethods("seqnames")
showMethods("seqnames<-")
if (interactive())
?`GRanges-class`