Dear Experts,
I have a "GRangesList" object like this:
GRangesList of length 1:
$TYPE1
GRanges with 700000 ranges and 1 metadata column:
seqnames ranges strand | id
<Rle> <IRanges> <Rle> | <factor>
[1] chr1 [ 0, 10000] * | Factor1
[2] chr1 [ 9600, 20000] * | Factor2
[3] chr1 [ 24000, 30000] * | Factor2
And I am trying to overlap each row of this List to a each row of a GRanges object like this:
GRanges with 200 ranges and 1 metadata column:
seqnames ranges strand | name
<Rle> <IRanges> <Rle> | <factor>
rs1 chr1 [0, 1] * | rs1
rs2 chr1 [9700, 9701] * | rs2
My goal is to get a data frame containing a count for the overlap of each of the GRanges object with each of the GRangesList like this:
rs1_Factor1 0 0 0
rs_Factor2 0 1 0
I can do this for one value at a time of the Factors of GRangesList like this:
hits=countOverlaps(obj1, objList[1], type=c("within"))
But how do I apply this to each row of GRangesList?
I have tried unsuccessfully with mapply (Error in (function (query, subject, maxgap = 0L, minoverlap = 1L, type = c("any") error in evaluating the argument 'query' in selecting a method for function 'countOverlaps': Error in dots[[1L]][[1L]] : this S4 class is not subsettable)
Thanks so much!
-fra
I have a "GRangesList" object like this:
GRangesList of length 1:
$TYPE1
GRanges with 700000 ranges and 1 metadata column:
seqnames ranges strand | id
<Rle> <IRanges> <Rle> | <factor>
[1] chr1 [ 0, 10000] * | Factor1
[2] chr1 [ 9600, 20000] * | Factor2
[3] chr1 [ 24000, 30000] * | Factor2
And I am trying to overlap each row of this List to a each row of a GRanges object like this:
GRanges with 200 ranges and 1 metadata column:
seqnames ranges strand | name
<Rle> <IRanges> <Rle> | <factor>
rs1 chr1 [0, 1] * | rs1
rs2 chr1 [9700, 9701] * | rs2
My goal is to get a data frame containing a count for the overlap of each of the GRanges object with each of the GRangesList like this:
rs1_Factor1 0 0 0
rs_Factor2 0 1 0
I can do this for one value at a time of the Factors of GRangesList like this:
hits=countOverlaps(obj1, objList[1], type=c("within"))
But how do I apply this to each row of GRangesList?
I have tried unsuccessfully with mapply (Error in (function (query, subject, maxgap = 0L, minoverlap = 1L, type = c("any") error in evaluating the argument 'query' in selecting a method for function 'countOverlaps': Error in dots[[1L]][[1L]] : this S4 class is not subsettable)
Thanks so much!
-fra
Comment