Summary from a vcf file
I have a single vcf file with snps from 10 cultivars. After running snpeff, how could i get summary information such as how many exons, introns, intergenic regions etc do i have for each cultivar?
• 2,195 views
•
link
1 answer
Extract the genotype and annotation files using SnpSift and then summerise with R or Python to get the total count of SNP types per sample.
Extracting annotations fields using SnpSift:
java -jar SnpSift.jar extractFields annotated.vcf CHROM POS REF ALT ANN[*].GENE EFF[*].EFFECT "GEN[*].GT" > results.tsv
Ref:http://snpeff.sourceforge.net/SnpSift.html#Extract
Annotation summary example:
library(dplyr)
summary<-results[,c(Effect Column, Columns containing genotype data)] %>% group_by(Effect Column) %>% summerise_all(funs(sum))
• 0 views
•
link
Log in to answer this question.
As far as I know, you need to first split the VCF files, so there is a single VCF file per sample (i.e., cultivar in this case) and eventually merge them after running snpEff. A snpEff-annotated VCF file can give information on things such as
SNPEFF_EFFECT=INTRONandSNPEFF_EFFECT=INTERGENIC, exons are little more complicated if I remember correctly. You would probably usegrep -c SNPEFF_EFFECT=INTRON,grep -c SNPEFF_EFFECT=INTERGENICand not sure about exons. I would recommend reading more aboutsnpEffon biostars.org as well as from the developer's website.