-
-
Save kindlychung/14a2a8e61e8ff28e918cfaf187119221 to your computer and use it in GitHub Desktop.
This file contains 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
filter_by_corr = function(correlation_thresh, geno_cor) { | |
geno_cor_filter = abs(geno_cor) < correlation_thresh | |
diag(geno_cor_filter) = TRUE | |
i = 0 | |
while(TRUE) { | |
i = i + 1 | |
if(i > length(ordered_pairs)) break | |
pair = ordered_pairs[i] | |
if(! (pair %in% colnames(geno_cor_filter))) { | |
next | |
} | |
filter_by_ith_col = geno_cor_filter[, pair] | |
geno_cor_filter = geno_cor_filter[filter_by_ith_col, filter_by_ith_col] | |
} | |
geno_cor_filter | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment