Skip to content
Snippets Groups Projects
Unverified Commit 61f2438d authored by Laurent Modolo's avatar Laurent Modolo
Browse files

intersect_SNP.R: small script to return SNP in arg2 not found in arg1

parent c72c554d
No related branches found
No related tags found
No related merge requests found
#!/usr/bin/Rscript
library("tidyverse")
args <- commandArgs(trailingOnly = TRUE)
snp_a <- read_delim(args[1], delim = "\t") %>%
mutate(cords = paste0(CHROM, POS))
snp_b <- read_delim(args[2], delim = "\t") %>%
mutate(cords = paste0(CHROM, POS))
only_b <- snp_b %>%
select(cords) %>%
setdiff(snp_a %>% select(cords)) %>%
pull(cords)
snp_b %>%
filter(cords %in% only_b) %>%
write_csv(paste0("only_", args[2]))
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment