trackSet-class {rtracklayer}R Documentation

Class "trackSet"

Description

An object representing a genome annotation track. Based on eSet, with feature information (chrom, start, end, strand, ...) stored in the featureData and data values from experimental measurements stored in the assayData.

Objects from the Class

Objects of the class are generally created in two different ways, depending on how the experimental data are provided. The first way is to pass an instance of AssayData as the dataVals parameter in new("trackSet", assayData, phenoData = annotatedDataFrameFrom(assayData, byrow=FALSE), featureData = annotatedDataFrameFrom(assayData, byrow=TRUE), experimentData = new("MIAME"), annotation = character(), genome = "hg18"). The AssayData object must contain a matrix or data.frame named dataVals, which should contain the experimental measurements. Alternatively, the experimental measurements may be passed as the dataVals parameter in new("trackSet", phenoData = annotatedDataFrameFrom(assayData, byrow=FALSE), featureData = annotatedDataFrameFrom(assayData, byrow=TRUE), experimentData = new("MIAME"), annotation = character(), dataVals = matrix(), genome = "hg18").

Slots

genome:
Object of class "character" identifying the genome to which this track pertains. Should be specified according to the conventions of the UCSC browser (e.g. "hg18"), if possible.
assayData:
Object of class "AssayData" holding the experimental measurements.
phenoData:
Object of class "AnnotatedDataFrame" holding the experimental design matrix.
featureData:
Object of class "AnnotatedDataFrame" holding the feature information, generally including columns chrom (chromosome name), start (numeric start position), end (numeric end position) and strand (DNA strand: "+", "-" or NA). Note that the intervals are closed, i.e. the selected region is [start,stop].
experimentData:
Object of class "MIAME" with experimental metadata.
annotation:
Object of class "character" identifying the annotation resource.
.__classVersion__:
Object of class "Versions" specifying the version of the class.

Extends

Class "eSet", directly. Class "VersionedBiobase", by class "eSet", distance 2. Class "Versioned", by class "eSet", distance 3.

Methods

object[i, j]
Subsets an instance, where i is an feature index, feature name or chrid for selecting features and j is a sample index or name for selecting samples from the experimental data.
chrid(object)
Obtains an instance of chrid, which is a vector with an element representing the chromosome for each feature in this track.
dataVals(object)
Retrieves the matrix containing the experimental data values.
chrom(object)
Retrieves the chromosome identifiers of the features.
start(x)
Retrieves the start positions of the features.
end(x)
Retrieves the end positions of the features. Note that intervals are closed, so this should be the index of the last base to include in the feature.
strand(object)
Retrieves the strand ("+", "-" or NA) of the features.
genomeSegment(object)
obtain the genome segment spanned by this track (including gaps).
trackData(object)
Obtain a representation of this track as a data.frame. The result is the column-wise combination of the featureData slot with the dataVals matrix. The function also adds a seqMid column, which holds the mid-point of the segment of each feature. This is useful for e.g. plotting.
genome(object)
Get the genome slot.
as(trackSet, "data.frame")
Equivalent to trackData above.
trackSets(object)
Create a trackSets instance initially containing only this track.
export.bed(object, con, wig = FALSE)
Export track in Browser Extended Display (BED) format.
export.gff(object, con, version = c("1", "2", "3"), source = "rtracklayer")
Export track in General Feature Format (GFF).
export.ucsc(object, con, subformat = c("gff", "wig"), name = deparse(substitute(object)), ...)
Export track in the meta format of the (UCSC) browser.
export.wig(object, con, dataFormat = c("bed", "variableStep", "fixedStep"))
export track in Wiggle (WIG) format.

Author(s)

Michael Lawrence

See Also

layTrack for loading a track into a genome browser. import to create a trackSet from a file, export to write a trackSet to a file.


[Package rtracklayer version 1.2.2 Index]