Question: Gviz data track - how to color points, add horizontal line?
1
gravatar for bsmith030465
3.8 years ago by
bsmith030465150
United States
bsmith030465150 wrote:

Hi,

I was trying to color code the data points in the DataTrack, and add a horizontal line. I couldn't find the information in the vignette. Here is what I want to do:

======

library(Gviz)
values <- runif(15,0,1)
gr <- GRanges(seqnames=rep('chr1',15),ranges=IRanges(start=1:15,end=1:15))
mcols(gr) <- values
colnames(mcols(gr)) <- 'values'
mycols <- ifelse(values < 0.5,"red","blue")
dtrack <- DataTrack(gr,col=mycols)
plotTracks(dtrack)

==========

I only get one color for all the dots. Also, how can I add a horizontal line in this track?

many thanks!

gviz • 3.2k views
ADD COMMENTlink modified 3.8 years ago by WouterDeCoster43k • written 3.8 years ago by bsmith030465150

Hopefully it will help:

http://watson.nci.nih.gov/bioc_mirror/packages/release/bioc/manuals/Gviz/man/Gviz.pdf

"

col="#0080FF": Integer or character scalar. Default line color setting for all plotting ele-

ments, unless there is a more specific control defined elsewhere.

col.axis="white": Integer or character scalar. The font and line color for the y axis, if any.

col.frame="lightgray": Integer or character scalar. The line color used for the panel frame, if frame==TRUE

col.grid="#808080": Integer or character scalar. Default line color for grid lines, both

when type=="g" in DataTracks and when display parameter grid==TRUE.

col.line=NULL: Integer or character scalar. Default colors for plot lines. Usually the same as the global col parameter

"

ADD REPLYlink modified 3.8 years ago • written 3.8 years ago by natasha.sernova3.7k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1227 users visited in the last hour