how to add annotation on individual track
1
0
Entering edit mode
@xiaofeiwang18266-13498
Last seen 8 months ago
Singapore

From here , I see the annotation track can be added above by this:

plotTracks(list(detesTrack, dmrTrack),  legend = TRUE, groupAnnotation="id", just.group = "above")

My question is that how could I just add annotation to one track when there are multiple.

If I used the codes above, it will add annotation to all track as below. But, I only want to keep the annotation for DETEs not the "unknown" ones for DMRs.

Thanks a lot!

enter image description here

Gviz • 533 views
ADD COMMENT
0
Entering edit mode
Robert Ivanek ▴ 730
@robert-ivanek-5892
Last seen 4 months ago
Switzerland

You have to specify the arguments groupAnnotation="id", just.group = "above" while you create the track object itself and not later when you call the plotTracks function. If you specify it in plotTracks function, it is applied to all the tracks.

In your case set it once you create the "DETEs" object and then call plotTracks function without those parameters. Something along these lines:

dmrTrack <- AnnotationTrack(...)
detesTrack <- AnnotationTrack(..., groupAnnotation="id", just.group = "above")

plotTracks(list(detesTrack, dmrTrack),  legend =TRUE)
ADD COMMENT
0
Entering edit mode

Works, and thanks a lot!

ADD REPLY

Login before adding your answer.

Traffic: 687 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