Learn R Programming

Gviz (version 1.16.1)

GenomeAxisTrack-class: GenomeAxisTrack class and methods

Description

A class representing a customizable genomic axis.

Usage

GenomeAxisTrack(range=NULL, name="Axis", id, ...)

Arguments

range
Optional GRanges or IRanges object to highlight certain regions on the axis.
name
Character scalar of the track's name used in the title panel when plotting.
id
A character vector of the same length as range containing identifiers for the ranges. If missing, the constructor will try to extract the ids from names(range).
...
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 GenomeAxisTrack.

Objects from the class

Objects can be created using the constructor function GenomeAxisTrack.

Extends

Class "GdObject", directly.

Details

A GenomeAxisTrack can be customized using the familiar display parameters. By providing a GRanges or IRanges object to the constructor, ranges on the axis can be further highlighted.\ With the scale display parameter, a small scale indicator can be shown instead of the entire genomic axis. The scale can either be provided as a fraction of the plotting region (it will be rounded to the nearest human readable absolute value) or as an absolute value and is always displayed in bp, kb, mb or gb units. Note that most display parameters for the GenomeAxisTrack are ignored when a scale is used insterad of the full axis. In particular, only the parameters exponent, alpha, lwd, col, cex, distFromAxis and labelPos are used.

See Also

AnnotationTrack

DisplayPars

GdObject

GRanges

ImageMap

IRanges

RangeTrack

StackedTrack

collapsing

DataTrack

grouping

panel.grid

plotTracks

settings

Examples

Run this code
## Construct object
axTrack <- GenomeAxisTrack(name="Axis",
range <- IRanges(start=c(100, 300, 800), end=c(150, 400, 1000)))

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


## Plotting
plotTracks(axTrack, from=0, to=1100)

## Track names
names(axTrack)
names(axTrack) <- "foo"

## Subsetting and splitting
subTrack <- subset(axTrack, from=0, to=500)
length(subTrack)
subTrack[1]
split(axTrack, c(1,1,2))

## Accessors
start(axTrack)
end(axTrack)
width(axTrack)

strand(axTrack)

range(axTrack)
ranges(axTrack)

## Annotation
values(axTrack)

## Grouping
group(axTrack)

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

## adding an axis to another track
data(cyp2b10)
grTrack <- GeneRegionTrack(start=26682683, end=26711643,
		rstart=cyp2b10$start, rends=cyp2b10$end, chromosome=7, genome="mm9",
		transcript=cyp2b10$transcript, gene=cyp2b10$gene, symbol=cyp2b10$symbol,
		name="Cyp2b10", strand=cyp2b10$strand)
		
plotTracks(list(grTrack, GenomeAxisTrack()))
plotTracks(list(grTrack, GenomeAxisTrack(scale=0.1)))
plotTracks(list(grTrack, GenomeAxisTrack(scale=5000)))
plotTracks(list(grTrack, GenomeAxisTrack(scale=0.5, labelPos="below")))

Run the code above in your browser using DataLab