seqinfo {GenomicRanges}R Documentation

Accessing sequence information

Description

A set of generic functions for getting/setting sequence information from/on an object.

Usage

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)

Arguments

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.

new2old can be NULL or an integer vector with one element per row in Seqinfo object value (i.e. new2old and value must have the same length) describing how the "new" sequence levels should be mapped to the "old" sequence levels, that is, how the rows in value should be mapped to the rows in seqinfo(x). The values in new2old must be >= 1 and <= length(seqinfo(x)). NAs are allowed and indicate sequence levels that are being added. Old sequence levels that are not represented in new2old will be dropped, but this will fail if those levels are in use (e.g. if x is a GRanges object with ranges defined on those sequence levels).

If new2old=NULL, then sequence levels can only be added to the existing ones, that is, value must have at least as many rows as seqinfo(x) (i.e. length(values) >= length(seqinfo(x))) and also seqlevels(values)[seq_len(length(seqlevels(x)))] must be identical to seqlevels(x).

value Typically a Seqinfo object for the seqinfo setter.

Either a named or unnamed character vector for the seqlevels setter.

A vector containing the sequence information to store for the other setters.

Details

Various classes implement methods for those generic functions.

The Seqinfo class plays a central role for those generics because:

Note

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.

See Also

Seqinfo-class, GRanges-class, GRangesList-class, GappedAlignments-class

Examples

  showMethods("seqinfo")
  showMethods("seqinfo<-")

  showMethods("seqnames")
  showMethods("seqnames<-")

  if (interactive())
    ?`GRanges-class`

[Package GenomicRanges version 1.4.6 Index]