Skip to content

Instantly share code, notes, and snippets.

@aaronwolen
Created August 14, 2017 19:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aaronwolen/7166011e8704b8f5ba355753cecb1517 to your computer and use it in GitHub Desktop.
Save aaronwolen/7166011e8704b8f5ba355753cecb1517 to your computer and use it in GitHub Desktop.
Joining GWAS data tables
alspac <- alspac %>%
mutate(allele_key = if_else(
A1 < A2,
paste0(A1, A2),
paste0(A2, A1)
))
s4s <- s4s %>%
mutate(allele_key = if_else(
alleleA < alleleB,
paste0(alleleA, alleleB),
paste0(alleleB, alleleA)
))
s4s.only <-
anti_join(s4s,
alspac,
by = c(
chromosome = "chr",
position = "position",
allele_key = "allele_key"
))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment