Legend color mix-up in grouped Gviz plot
1
0
Entering edit mode
Robert ▴ 10
@robert-21245
Last seen 2.2 years ago
United States

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 • 833 views
ADD COMMENT
0
Entering edit mode
Robert Ivanek ▴ 730
@robert-ivanek-5892
Last seen 5 months ago
Switzerland

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

ADD COMMENT

Login before adding your answer.

Traffic: 1062 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6