Learn R Programming

DASiR (version 1.12.0)

plotFeatures: Basic plotting function for obtained features

Description

This functions creates a basic plot with the features retrieved by getDasFeature or adds them to an existing plot.

Usage

plotFeatures(df, col=NULL, col.start="start", col.end="end", col.id ="label", col.type="type", box.height=4, box.sep=2, pos.label=c("middle", "top", "bottom", "no"), new=TRUE, legend=TRUE, ...)

Arguments

df
data.frame with the features. Columns col.start, col.end, col.id and col.type must be present.
col
Vector of colors for each box in df. If NULL, automatic rainbow coloring for different types will be used.
col.start, col.end, col.id, col.type
Names of the columns of the data.frame from which retrieve the values
box.height, box.sep
Height and separation between boxes (in percentual points respect y-axis)
pos.label
Position of the label respect the box. If pos.label=="no", labels are disabled.
new
Open a new graphical device. If new=FALSE, boxes will be added to an existing plot (so, coordinate system must be consistent).
legend
Add legend to the plot
...
Other graphical parameters passed to plot.default

Value

(none)

Details

This function provides a quick way to view (non-overlapped) boxes in a new or an existing plot with the features retrieved.

Notice that boxes will can be plotted overlaping the current open graphical device, so the x-coordinates must match.

See Also

getDasFeature

Examples

Run this code
    # This is UCSC Genome browser
    setDasServer(server="http://genome.ucsc.edu/cgi-bin/das")

    # Note that id now changes, we can retrieve it from getDasDsn()
    source <- "sacCer3"
    range <- GRanges(c("I"), IRanges(start=1, end=2500))
    type <- c("sgdGene")

    # We want the official genes from 'sdgGene' in the range I:1-2500
    features <- getDasFeature(source, range, type)
    print(features)

    plotFeatures(features)

Run the code above in your browser using DataLab