Hi All,
I am a newbie in R language and need help with some suggestions for the following script I am working on.
So, the script checks if the genomic coordinate from BEDPE file1 (it has other info as well) are within a specific range of the genomic coordinates from another BEDPE file2. I want to merge the two data frames in to one if the file1 genome coordinates are within 150 bps upstream or downstream of the genome coordinates in the file2, I am comparing with. Is there any R function which can be used here to get what I want?
The output should be the genomic coordinates from first file which are within the range of second file.
So far I have tried merge and using by= "colname" but that does not allow the intersection within a range. It gives the output if the coordinates are matching exactly.
I forgot to mention, I am using BEDPE files.
Any help would be appreciated. Thanks!
Can you tell us why specifically an R based solution is required? Otherwise you can use bedtools pairtopair
I am processing the analysis using an R script, that's why it will be convenient for me to find an equivalent function to process the files rather separately use bedtools and then add the output file again in the Rscript for processing. Also, I have used bedtoolsr which can be used inside R. Just sharing:)! Thanks!