plotGRanges | R Documentation |
Plot GRanges of several queries on the same reference, with one y-axis line per query. Each alignment can have a different color, specified via the "col" column of mcols(gr)
. If this column doesn't exist, it will be black by default.
plotGRanges(
gr,
main = "Alignments",
xlab = NULL,
xlim = NULL,
col.qry.lab = "black",
shape = "segments"
)
gr |
GRanges |
main |
main title |
xlab |
label of the x-axis (by default, will be the first level of |
xlim |
x-axis limits |
col.qry.lab |
color for the query labels used along the y-axis |
shape |
shape used to represent the alignments (segments/arrows) |
nothing
Timothee Flutre
plotAligns
## Not run: ## make fake coordinates to be plotted with a single color
library(GenomicRanges)
gr <- GRanges(seqnames=c("chr1"),
ranges=IRanges(start=c(1, 15, 6), end=c(10, 20, 12)),
strand=c("+", "-", "+"))
names(gr) <- c("qry1", "qry1", "qry2")
plotGRanges(gr)
plotGRanges(gr, shape="arrows")
## use color to distinguish different alignments of the same query
mcols(gr)["col"] <- c("black", "red", "black")
plotGRanges(gr, shape="arrows")
## outside of this function, one can always add other things to the plot
legend("right", legend=c("a", "b"), col=c("black", "red"), lwd=2, bty="n")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.