GenomeData-class {BSgenome}R Documentation

Data on the genome

Description

GenomeData formally represents genomic data as a list, with one element per chromosome in the genome.

Details

This class facilitates storing data on the genome by formalizing a set of metadata fields for storing the organism (e.g. Mmusculus), genome build provider (e.g. UCSC), and genome build version (e.g. mm9).

The data is represented as a list, with one element per chromosome (or really any sequence, like a gene). There are no constraints as to the data type of the elements.

Note that as an AnnotatedList, it is possible to store chromosome-level data (e.g. the lengths) in the elementMetadata slot. The organism, provider and providerVersion are all stored in the the AnnotatedList metadata, so they may be retrieved in list form by calling metadata(x).

Accessor methods

In the code snippets below, x is a GenomeData object.

organism(x): Get the single string indicating the organism, if specified, otherwise NULL.
provider(x): Get the single string indicating the genome build provider, if specified, otherwise NULL.
providerVersion(x): Get the single string indicating the genome build version, if specified, otherwise NULL.

Constructor

GenomeData(elements = list(), providerVersion = NULL, organism = NULL, provider = NULL, metadata = list(), elementMetadata = NULL, ...): Creates a GenomeData with the elements from the elements parameter, a list. The other arguments correspond to the metadata fields, and, with the exception of elementMetadata, should all be either single strings or NULL (unspecified). Additional global metadata elements may be passed in metadata, in list-form, and via .... The elements in metadata are always overridden by the explicit arguments, like organism and those in .... elementMetadata should be an XDataFrame or NULL.

Coercion

as(from, "data.frame"): Coerces each subelement to a data frame, and binds them into a single data frame with an additional column indicating chromosome

Author(s)

Michael Lawrence

See Also

GenomeDataList, a container of this class and useful for storing data on multiple samples.

AnnotatedList, the base of this class.

Examples

gd <- GenomeData(list(chr1 = IRanges(1, 10), chrX = IRanges(2, 5)),
                 organism = "Mmusculus", provider = "UCSC",
                 providerVersion = "mm9")
organism(gd)
providerVersion(gd)
provider(gd)
gd[["chr1"]] # get data for chromsome 1

[Package BSgenome version 1.12.3 Index]