Learn R Programming

Gviz (version 1.16.1)

AlignedReadTrack-class: AlignedReadTrack class and methods (NOTE: THIS IS STILL IN DEVELOPMENT AND SUBJECT TO CHANGE)

Description

A class to represent short sequences that have been aligned to a reference genome as they are typically generated in a next generation sequencing experiment.

Usage

AlignedReadTrack(range=NULL, start=NULL, end=NULL, width=NULL, chromosome, strand, genome,
stacking="squish", name="AlignedReadTrack", coverageOnly=FALSE, ...)

Arguments

range
An object of class GRanges, or a data.frame which will be coerced into one in which case it needs to contain at least the three columns: [object Object],[object Object] Alternatively, the range argument may be missing, in which case the relevant information has to be provided as individual function arguments (see below).
start, end, width
Integer vectors, giving the start and the end end coordinates for the individual track items, or their width. Two of the three need to be specified, and have to be of equal length or of length one, in which case this value will be recycled. Otherwise, the usual R recycling rules for vectors do not apply.
strand
Character vector, the strand information for the individual track items. Needs to be of equal length as the start, end or width vectors, or of length 1. Please note that grouped items need to be on the same strand, and erroneous entries will result in casting of an error.
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.
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.
name
Character scalar of the track's name used in the title panel when plotting.
coverageOnly
Instead of storing individual reads, just compute the coverage and store the resulting coverage vector.
...
Additional items which will all be interpreted as further display parameters.

Value

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

Objects from the Class

Objects can be created using the constructor function AlignedReadTrack.

Extends

Class "StackedTrack", directly. Class "RangeTrack", by class "StackedTrack", distance2. Class "GdObject", by class "StackedTrack", distance3.

See Also

AnnotationTrack

DataTrack

DisplayPars

GdObject

GeneRegionTrack

GRanges

ImageMap

IRanges

RangeTrack

StackedTrack

collapsing

grouping

panel.grid

plotTracks

settings

Examples

Run this code
## Construct from individual arguments
arTrack <- AlignedReadTrack(start=runif(1000, 100, 200), width=24,
genome="mm9", chromosome=7, strand=sample(c("+", "-"), 1000, TRUE))

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

## Plotting
plotTracks(arTrack)

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

## Subsetting and splitting
subTrack <- subset(arTrack, from=110, to=130)
length(subTrack)
subTrack[1:2]
split(arTrack, strand(arTrack))

## Accessors
start(arTrack)
end(arTrack)
width(arTrack)
position(arTrack)
width(subTrack) <- 30

strand(arTrack)
strand(subTrack) <- "-"

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

genome(arTrack)
genome(subTrack) <- "mm9"

range(arTrack)
ranges(arTrack)

coverage(arTrack)

## Annotation
values(arTrack)

## Stacking
stacking(arTrack)
stacking(arTrack) <- "dense"

## coercion
as(arTrack, "data.frame")

Run the code above in your browser using DataLab