Skip to content

Instantly share code, notes, and snippets.

@explodecomputer
Last active December 7, 2015 17:39
Show Gist options
  • Save explodecomputer/f1132f98f3d3de874474 to your computer and use it in GitHub Desktop.
Save explodecomputer/f1132f98f3d3de874474 to your computer and use it in GitHub Desktop.
SNP lookup with ld proxies
# In R:
load("/panfs/panasas01/shared/alspac/deprecated/gib/aries_renormalised/condanal_results.RData")
mprobes <- c("cg06500161", "cg11024682", "cg07094298", "cg04011474", "cg10192877", "cg17782974", "cg20496314", "cg07202479", "cg09494176", "cg17501210", "cg21139312", "cg26403843")
b <- subset(condres, CPG %in% mprobes)
write.table(unique(b$SNP), file="~/snplist.txt", row=F, col=F, qu=F)
# In Terminal:
# This is the summary stats for the most recent GWAS on BMI
bmifile="/projects/MRC-IEU/publicdata/GWAS_summary_data/GIANT_2014_2015/BMI2015/All_ancestries_SNP_gwas_mc_merge_nogc.tbl.uniq.gz"
zcat ${bmifile} | wc -l
# Find all rows that have the snp names in snplist.txt
zfgrep -wf snplist.txt ${bmifile} > foundsnps.txt
wc -l foundsnps.txt
# None found!
# Get LD proxies:
plink1.90 \
--bfile /panfs/panasas01/shared/alspac/studies/latest/alspac/genetic/variants/arrays/gwas/imputed/1000genomes/released/2015-10-30/data/derived/filtered/bestguess/maf0.01_info0.8/combined/data \
--show-tags snplist.txt \
--list-all \
--out snptags
# Try again with new snplilst
zfgrep -wf snptags.tags ${bmifile} > foundsnps.txt
zcat ${bmifile} | head -n 1 > header
cat header foundsnps.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment