I'm currently trying to plot a couple of transcripts along with their properties and I want to highlight the type of transcript (Type 1 vs Type2). Since I'm already using color for something else (and cannot seem to get any parsing of a alpha value to work) the remaining (and nice) choice is to use facttes to distinguish the transcript types.
The problem/bug is easily illustrated by this small example:
### Generate test data
grl <- GRangesList(
A=GRanges(seqnames = "chr1", ranges = IRanges(c(1, 10), end = c(4,20)), strand ='+', class=rep('Type 1',2) ),
B=GRanges("chr1", IRanges(15, end = 20), strand='+', class='Type 2')
### Plot it - including facette
tracks('Test' =ggplot() + geom_alignment(grl) + facet_wrap(~class, ncol=1, scales='free_y' ) )
From the resulting plot: https://www.dropbox.com/s/73cb1r6hban6ccw/transcript_plot.png?dl=0
It looks like the "gap" (intron), which is calculated internally, does not contain the "class" column, whereby it is added to both facettes.
Would it be possible to fix this? Or is there a way I can specify gaps myself?
In advance - thanks!