gravatar for simplitia

4 hours ago by

Hi suppose I have a grange object as such,

g <- GRanges(seqnames=c(rep("Chr1",3)), strand=rep("+",3), ranges=IRanges(start=c(10,2,2), end=c(24,27,30)))

this produces a grange that looks like this.

GRanges object with 3 ranges and 0 metadata columns:
      seqnames    ranges strand
         <Rle> <IRanges>  <Rle>
  [1]     Chr1     10-24      +
  [2]     Chr1      2-27      +
  [3]     Chr1      2-30      +

so if you look carefully, bot line 1 and line 2 ( 10-24 and 2-27) falls within line 3 ( 2-30), is there a way I can get rid of any of any ranges that falls under a larger range. So the table above, line 1 and line 2 should be removed since both fall within line 3.

thanks!



Source link