Question: Legend color mix-up in grouped Gviz plot
0
gravatar for Robert
12 weeks ago by
Robert10
Robert10 wrote:

I have a GRanges object with two metadata columns, which I plot in the same Gviz plot using the groups argument:

library(Gviz)

gr <- GRanges(seqnames = "chrI", ranges = IRanges(start = 1:6, width = 1), strand = "*",
              fw = c(0, 0, 0, 1, 2, 1.5), rev = c(1.75, 2.25, 1, 0, 0, 0))

dt1 <- DataTrack(range = gr, groups = c("fw", "rev"), col = c("red", "blue"), type = "h")

at <- GenomeAxisTrack()

plotTracks(trackList = list(at, dt1), from = 1, to = 7)

Img1

When I change the order of the groups and col vector elements, the colors in the legend get mixed up.

dt2 <- DataTrack(range = gr, groups = c("rev", "fw"), col = c("blue", "red"), type = "h")

plotTracks(trackList = list(at, dt2), from = 1, to = 7)

enter image description here

Is this a bug or did I miss something about how the groups and col arguments are used?

gviz • 68 views
ADD COMMENTlink modified 12 weeks ago • written 12 weeks ago by Robert10

Hi, thanks for pointing that out. It should be fixed in both (release and development) versions in next few days.

ADD REPLYlink written 11 weeks ago by Robert Ivanek660
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 16.09
Traffic: 201 users visited in the last hour