Entering edit mode
Walter F. Baumann
▴
10
@walter-f-baumann-12439
Last seen 7.0 years ago
Hi,
I have to create some GRanges objects, which are located on the + and - strand (The features represent regions on transcripts.). Here a reproducible example:
GRanges(seqnames = Rle(c("chr1", "chr2", "chr3", "chr4")), ranges = IRanges(10:13, width=3), strand = Rle(c("+", "-", "+", "-")))
However, IRanges works strand independent, meaning that 10+3, 11+3... but on the "-" strand, the start should be 8 and the end 11. I looked at the vignette, but did not find any information. I know there are workarounds, but I wondered if this might be somewhere implemented?
I want:
seqnames ranges strand <Rle> <IRanges> <Rle> [1] chr1 [10, 12] + [2] chr2 [9, 11] - [3] chr3 [12, 14] + [4] chr4 [11, 13] -