plot the tracks

Share:

Description

A function to plot the data for given range

Usage

1
2
3
4
viewTracks(trackList, chromosome, start, end, strand, gr=GRanges(),
           ignore.strand=TRUE,
           viewerStyle=trackViewerStyle(), autoOptimizeStyle=FALSE,
           newpage=TRUE, operator=NULL)

Arguments

trackList

an object of trackList

chromosome

chromosome

start

start position

end

end position

strand

strand

gr

an object of GRanges

ignore.strand

ignore the strand or not when do filter. default TRUE

viewerStyle

an object of trackViewerStyle

autoOptimizeStyle

should use optimizeStyle to optimize style

newpage

should be draw on a new page?

operator

operator, could be +, -, *, /, ^, %%. "-" means dat - dat2, and so on.

Value

An object of viewport for addGuideLine

Author(s)

Jianhong Ou

See Also

See Also as addGuideLine, addArrowMark

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
    extdata <- system.file("extdata", package="trackViewer",
                       mustWork=TRUE)
    files <- dir(extdata, "-.wig")
    tracks <- lapply(paste(extdata, files, sep="/"), 
                        importScore, format="WIG")
    tracks <- lapply(tracks, function(.ele) {strand(.ele@dat) <- "-"; .ele})
    fox2 <- importScore(paste(extdata, "fox2.bed", sep="/"), format="BED")
    dat <- coverageGR(fox2@dat)
    fox2@dat <- dat[strand(dat)=="+"]
    fox2@dat2 <- dat[strand(dat)=="-"]
    gr <- GRanges("chr11", IRanges(122929275, 122930122), strand="-")
    viewTracks(trackList(tracks, fox2), gr=gr, autoOptimizeStyle=TRUE)