Entering edit mode
Radhouane Aniba
▴
240
@radhouane-aniba-4409
Last seen 8.6 years ago
Hello
I have a Granges object that is like this (used along with ggbio) :
GRanges with 6 ranges and 6 metadata columns:
seqnames ranges strand | score id
highlight
<rle> <iranges> <rle> | <numeric> <factor>
<logical>
[1] 1 [ 4793, 227744] * | -0.17 DAH115
FALSE
[2] 1 [ 522302, 558478] * | -0.03 DAH115
FALSE
[3] 1 [ 695745, 978366] * | -0.06 DAH115
FALSE
[4] 1 [1055159, 1231946] * | 0.24 DAH115
FALSE
[5] 1 [1239050, 1589751] * | -0.05 DAH115
FALSE
[6] 1 [1593026, 1610764] * | 0.25 DAH115
FALSE
I am basically plotting a bar plot with x : genome coordinates, and y
:
score
I would like to know how can I add segments (Start and End) that map
IRanges that correspond to a certain value of the object.
Example : if values(myobject)$id = DAH115 plot the correspondant
(horizontal line) segments (start - end) on top of the final
histogram.
I think we can use geom_segment but I am not sure how to extract the
ranges, I extracted them into a dataframe but I am not sure what would
be
the method to append the plot
Thanks
Rad
[[alternative HTML version deleted]]