Learn R Programming

Gviz (version 1.16.1)

BiomartGeneRegionTrack-class: BiomartGeneRegionTrack class and methods

Description

A class to hold gene model data for a genomic region fetched dynamically from EBI's Biomart Ensembl data source.

Usage

BiomartGeneRegionTrack(start, end, biomart, chromosome, strand, genome,
  stacking="squish", filters=list(), featureMap=NULL,
  name="BiomartGeneRegionTrack", symbol=NULL, gene=NULL, entrez=NULL,
  transcript=NULL, ...)

Arguments

start
An integer scalar with the genomic start coordinates for the gene model range.
end
An integer scalar with the genomic end coordinates for the gene model range.
biomart
An optional Mart object providing access to the EBI Biomart webservice. As default the appropriate Ensembl data source is selected based on the provided genome and chromosome.
strand
Character scalar, the strand for which to fetch gene information from Biomart. One in +, -, or +-.
chromosome
The chromosome on which the track's genomic ranges are defined. A valid UCSC chromosome identifier. Please note that at this stage only syntactic checking takes place, i.e., the argument value needs to be a single integer, numeric character or a character of the form chrx, where x may be any possible string. The user has to make sure that the respective chromosome is indeed defined for the the track's genome.
genome
The genome on which the track's ranges are defined. Usually this is a valid UCSC genome identifier, however this is not being formally checked at this point. If no mapping from genome to Biomart Ensembl data source is possible, the biomart argument needs to be provided by the user.
stacking
The stacking type for overlapping items of the track. One in c(hide, dense, squish, pack,full). Currently, only hide (don't show the track items, squish (make best use of the available space) and dense (no stacking at all) are implemented.
filters
A list of additional filters to be applied in the Biomart query. See getBM for details.
featureMap
Named character vector to map between the fields in the Biomart data base and the features as they are used to construct the track.
name
Character scalar of the track's name used in the title panel when plotting.
symbol,transcript,gene,entrez
Character vector giving one or several gene symbols, Ensembl transcript identifiers, Ensembl gene identifiers, or ENTREZ gene identifiers, respectively. The genomic locus of their gene model will be fetch from Biomart instead of providing explicit start and end coordinates.
...
Additional items which will all be interpreted as further display parameters. See settings and the "Display Parameters" section below for details.

Value

  • The return value of the constructor function is a new object of class BiomartGeneRegionTrack.

Objects from the class

Objects can be created using the constructor function BiomartGeneRegionTrack.

Extends

Class "GeneRegionTrack", directly.

Class "AnnotationTrack", by class "GeneRegionTrack", distance 2.

Class "StackedTrack", by class "GeneRegionTrack", distance 3.

Class "RangeTrack", by class "GeneRegionTrack", distance 4.

Class "GdObject", by class "GeneRegionTrack", distance 5.

Details

A track containing all gene models in a particular region as fetched from EBI's Biomart service. Usually the user does not have to take care of the Biomart connection, which will be established automatically based on the provided genome and chromosome information. However, for full flexibility a valid Mart object may be passed on to the constructor. Please note that this assumes a connection to one of the Ensembl gene data sources, mapping the available query data back to the internal object slots.

References

EBI Biomart webservice at http://www.biomart.org.

See Also

AnnotationTrack

DisplayPars

GdObject

GeneRegionTrack

GRanges

ImageMap

IRanges

Mart

RangeTrack

StackedTrack

collapsing

DataTrack

getBM

grouping

panel.grid

plotTracks

settings

useMart

Examples

Run this code
## Load some sample data
data(bmTrack)

## Construct the object
bmTrack <- BiomartGeneRegionTrack(start=26682683, end=26711643,
chromosome=7, genome="mm9")

## For some annoying reason the postscript device does not know about
## the sans font
if(!interactive())
{
font <- ps.options()$family
displayPars(bmTrack) <- list(fontfamily=font, fontfamily.title=font)
}

## Plotting
plotTracks(bmTrack)

## Track names
names(bmTrack)
names(bmTrack) <- "foo"
plotTracks(bmTrack)

## Subsetting and splitting
subTrack <- subset(bmTrack, from=26700000, to=26705000)
length(subTrack)
subTrack <- bmTrack[transcript(bmTrack)=="ENSMUST00000144140"]
split(bmTrack, transcript(bmTrack))

## Accessors
start(bmTrack)
end(bmTrack)
width(bmTrack)
position(bmTrack)
width(subTrack) <- width(subTrack)+100

strand(bmTrack)
strand(subTrack) <- "-"

chromosome(bmTrack)
chromosome(subTrack) <- "chrX"

genome(bmTrack)
genome(subTrack) <- "hg19"

range(bmTrack)
ranges(bmTrack)

## Annotation
identifier(bmTrack)
identifier(bmTrack, "lowest")
identifier(subTrack) <- "bar"

feature(bmTrack)
feature(subTrack) <- "foo"

exon(bmTrack)
exon(subTrack) <- letters[1:2]

gene(bmTrack)
gene(subTrack) <- "bar"

symbol(bmTrack)
symbol(subTrack) <- "foo"

transcript(bmTrack)
transcript(subTrack) <- c("foo", "bar")
chromosome(subTrack) <- "chr7"
plotTracks(subTrack)

values(bmTrack)

## Grouping
group(bmTrack)
group(subTrack) <- "Group 1"
transcript(subTrack)
plotTracks(subTrack)

## Stacking
stacking(bmTrack)
stacking(bmTrack) <- "dense"
plotTracks(bmTrack)

## coercion
as(bmTrack, "data.frame")
as(bmTrack, "UCSCData")

## HTML image map
coords(bmTrack)
tags(bmTrack)
bmTrack <- plotTracks(bmTrack)$foo
coords(bmTrack)
tags(bmTrack)

Run the code above in your browser using DataLab