Created
August 17, 2022 20:37
-
-
Save nievergeltlab/b7d82627e3c825d023a6eac6d4b476ce to your computer and use it in GitHub Desktop.
Determine if a SNP is within a locus by applying a TRUE/FALSE criteria to each required bound. If all bounds are true, the SNP is within a given locus..
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
d1$replicated <- NA | |
#All 3 must be true | |
for (i in 1:dim(d1)[1]) | |
{ | |
d1[i,]$replicated <- any(d1[i,]$chr == d2$CHR & d1[i,]$pos >= d2$START & d1[i,]$pos <= d2$STOP) | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment