Entering edit mode
7.1 years ago
woofung
•
0
Hello,
I am a R beginner, and I have a stupid question that if I have a data frame like this, represents the chromosome position of 9 exons of a gene.
exon_chrom_start exon_chrom_end
1 61955718 61955951
2 61956844 61956998
3 61957387 61957464
4 61958146 61958298
5 61959498 61959578
6 61959892 61960043
7 61950370 61950427
8 61955107 61955201
9 61962255 61965515
And I have another list of the positions of a batch of SNPs, for example, like
61948834
61958130
61956083
61948922
61950242
61950134
61956819
Is there a easy way to check if any of the SNP falls in the exons or not?
I tried to use match function but it didn't work for ranges set by two vectors( exon_chrom_start:exon_chrom_end)
Thank you,
I've been looking for this R code for such a long time!! Thanks @cpad0112!!