SNP density
0
0
Entering edit mode
2.2 years ago
Shin Taguchi ▴ 40

Hi, everyone.

I would like to create a figure plotting SNP density for each chromosome from a vcf file. All I have on hand now is the vcf file after the SNP call. If anyone knows of any software suitable for this, please tell me.

Otherwise, any help or advice would be much appreciated. It must be doable because I see plenty of published papers with SNP density plotted against chromosome position, but I can't figure out how to do it myself.

Thank you very mach.

Taguchi

snp • 2.6k views
ADD COMMENT
1
Entering edit mode

Hi, Pierre

I thought this post is nearest to my situation and need. snp density plot

And I have another question about the script in this post. What does it mean "data.txt" in this script ? Is it name of input vcf file ?

library(karyoploteR)

#Read the data
vars <- read.table("data.txt", comment.char = "", header = TRUE)

#Build a GRanges and convert chromosome names from "1" to "chr1" 
vars <- toGRanges(vars[,c(1,2,2,3:length(vars))])
seqlevelsStyle(vars) <- "UCSC"

#Plot SNPs as Points
kp <- plotKaryotype(genome="hg19")
kpPoints(kp, data=vars, y=0.5)

#Plot SNPs as density
kp <- plotKaryotype(genome="hg19")
kpPlotDensity(kp, data=vars)
ADD REPLY
0
Entering edit mode

@Pierre Lindenbaum Thank you for your advice !

ADD REPLY

Login before adding your answer.

Traffic: 1606 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6