Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save stephenturner/895767 to your computer and use it in GitHub Desktop.
Save stephenturner/895767 to your computer and use it in GitHub Desktop.
2011-03-30 igf1 stufy maf vs 1000g maf.r
d=query("-- DISCOVERED IN STUDY, BUT SOME MIGHT NOT BE IN 1000 GENOMES
select distinct *, CASE WHEN refvar_study!=refvar_1000g and maf1000g IS NOT NULL THEN 1 ELSE 0 END as mismatch from
(SELECT a.chr, a.pos18, c.pos19, a.major||a.minor AS refvar_study, a.maxpoolmaf, c.major||c.minor AS refvar_1000g, c.maf as maf1000g
FROM igf1_pooledmaf a
LEFT JOIN igf1_map1819 b ON a.pos18=b.hg18
LEFT JOIN igf1_1000g_freq c ON b.hg19=c.pos19);")
nrow(d)
ht(d)
require(ggplot2)
p=qplot(maf1000g,maxpoolmaf, data=d, xlab="1000 Genomes MAF", ylab="Study MAF", main="Study MAF vs 1000G MAF") + geom_smooth(method="lm")
ggsave("2011-03-30 study maf vs 1000G maf.png", p, w=6, h=6, dpi=100)
#what's that odd point down there?
subset(d,maf1000g>.5&maxpoolmaf<.2)
d[d$mismatch==1,]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment