Skip to content

Instantly share code, notes, and snippets.

@stephenturner
Created April 4, 2011 21:58
Show Gist options
  • Save stephenturner/902545 to your computer and use it in GitHub Desktop.
Save stephenturner/902545 to your computer and use it in GitHub Desktop.
snp distribution histograms.r
myquery="SELECT * FROM igf1_union_nomismatch WHERE highqual=1 OR (highqual IS NULL AND maf1000g>0.01);"
d=query(myquery)
main <- paste(nrow(d),"SNPs")
p=qplot(d$pos18, binw=2000, xlab="Chromosome 12 position (hg18)", ylab="SNP Density", main=main)
ggsave("2011-04-04 SNP Density 728 SNPs.png", p, w=6, h=6, dpi=100)
myquery="SELECT * FROM igf1_union_nomismatch WHERE maxmaf>=0.05 OR (meanmaf IS NULL AND maf1000g>0.01);"
d=query(myquery)
main <- paste(nrow(d),"SNPs")
p=qplot(d$pos18, binw=2000, xlab="Chromosome 12 position (hg18)", ylab="SNP Density", main=main)
ggsave("2011-04-04 SNP Density 875 SNPs.png", p, w=6, h=6, dpi=100)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment