Question: Good way to graph allele frequency of different SNPs along chromosomes
0
gravatar for devenvyas
4.2 years ago by
devenvyas650
Stony Brook
devenvyas650 wrote:

I have allele frequencies for the Neanderthal allele at sites where both Neanderthal genomes are homozygous and overlap with putative introgressed haplotypes in the form of Plink frequency output (--freq --missing --within cluster --out output).

I want to plot the allele frequencies along the SNPs' genomic coordinates.

Basically, I want to generate something like this Figure 1A from Sankararaman et al. (2014) (http://www.nature.com/nature/journal/v507/n7492/fig_tab/nature12961_F1.html) except the Y-axis would be frequency.

Anyone know how I could do this?

snp allele • 3.8k views
ADD COMMENTlink modified 4.2 years ago • written 4.2 years ago by devenvyas650
3
gravatar for devenvyas
4.2 years ago by
devenvyas650
Stony Brook
devenvyas650 wrote:

I figured out how to modify Isran's code. In case anyone else needs/wants it, here it is.

snps<-read.table("filename.txt",header=T)

goodChrOrder <- c(1:22,"X","Y")
snps$CHR <- factor(snps$CHR,levels=goodChrOrder)

library(ggplot2)
freq = ggplot(snps,aes(COORD,MAF, colour=CLST)) + geom_point() +
  facet_wrap(~ CHR,ncol=2) + # separate plots for each chr, x-scales can differ from chr to chr
  ggtitle("Distribution of allele frequency across genome") +
  xlab("Position in the genome") + 
  ylab("SNP frequency") + 


pdf("filename.pdf",20,20)
print(freq)
dev.off()
ADD COMMENTlink modified 4.2 years ago • written 4.2 years ago by devenvyas650
0
gravatar for John
4.2 years ago by
John12k
Germany
John12k wrote:

I often use Irsan's solution from Plotting Density Of Snps On Chromosomes Works for me :)

ADD COMMENTlink written 4.2 years ago by John12k

Is there anyway to modify the code to display allele frequencies instead of density? Also, what about display frequencies in multiple populations?

ADD REPLYlink written 4.2 years ago by devenvyas650
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 2247 users visited in the last hour