I have two GRanges objects, one with the (large) ranges of peaks I called in a ChIP experiment, and one that has information about those ranges (such as gene symbol, GC%, # of transcripts, as well as the Chr Start and End positions for each gene within the region, that I generated from Biomart). I would like to 'merge' the two datasets such that I end up with something like this:
Larger peak region ---- Genes --------- GC% ---- etc.
peak region 1 ------------- Gene 1 -------- 57.6
peak region 1 ------------- Gene 2 -------- 46.9
peak region 1 ------------- Gene 3 -------- 43.2
peak region 2 ------------- Gene 4 -------- 54.3
peak region 3 ------------- Gene 5 -------- 51.5
peak region 3 ------------- Gene 6 -------- 46.6
peak region 5 ------------- Gene 7 -------- 48.5
etc.
These were originally Excel sheets, so I don't necessarily need to use Genomic Ranges for this, I just thought it might be the right way to go about it. I attempted to do this with GRanges functions like subsetByOverlaps, mergeByOverlaps, findOverlaps, etc., but none of these have worked for me so far. Any ideas on the best way to do this?
0 answers
No answers yet.
Log in to answer this question.
You seem to be on the right way, and using
GRangeswould be the principled way to do this in R. It would be helpful to provide what you have tried already, and ideally a sample of theGRangesobjects that you would like to merge (you can do that usingdput())