Entering edit mode
4.1 years ago
zizigolu
★
4.3k
Hello
I have a big data like
> head(r@data)
Tumor_Sample_Barcode Chromosome Start_Position End_Position Reference_Allele
1: LP6005334-DNA_H01 chr1 89616151 89616151 -
2: LP6005334-DNA_H01 chr6 51909815 51909815 A
3: LP6005334-DNA_H01 chr16 20556547 20556547 -
4: LP6005334-DNA_H01 chr17 66992092 66992092 -
5: LP6005334-DNA_H01 chr20 13251339 13251339 -
6: LP6005334-DNA_H01 chr20 35929770 35929771
> dim(r@data)
[1] 6461 141
>
I also have a bed file like
1 11866 12229
1 12610 12723
1 13218 14411
1 30363 30505
1 34551 35176
How I can subset
my first data to this BED regions in R?
Search for "merge by range overlap", related SO post: https://stackoverflow.com/q/24480031/680068
And see my example answer here: A: Subsetting large list of SNPs with R
Thank you so much
I used your example answer without error