Hi all,
I currently have a certain list of SNPs (chromosome and position). I need to check whether these SNPs fall into another list of gene regions (chr:start_position-end_position) that I have.
I was previously able to find overlaps between positions using findOverlaps in R and I also saw we can do something similar using bedtools intersect. But it seems like those tools are all for finding chr:start-end overlaps, whereas I want to see whether my SNP positions fall into my gene regions of interest.
Any suggestions would be greatly appreciated.
Thank you!
it seems like there was a discussion about this: A: How To Intersect A Range With Single Positions
Thanks, my search didn't even fall on that one. It seems I will go with Pierre's suggestion and turn the SNP position into a SNP region having basically the same start and end coordinates. And then do the overlap.
Good description of data. It would help if you can post input data and expected output SGMS
not clear. What is the difference ?
With SNPs, I only have a certain position whereas for the region I have chr:start-end. Do you think findOverlaps would work in this case too?
why don't you convert your positions into 1-base intervals ?
I thought so. You mean for example:
1:169549811-169549811
right?
It would be
1:169549810-169549811
, because the BED format is 0-based.Thanks. If I want to do that in R though, the positions will remain the same..
Yes, the overlap functions from IRanges/GenomicRanges assume 1-based coordinates.