Count number of InDels per chromosome in Raw vcf file
1
1
Entering edit mode
6.3 years ago

Hello to all,

I want to count the number of InDels for each chromosome in the Raw VCF file.

What is the best idea?

Best Regard

Mostafa

SNP • 2.9k views
ADD COMMENT
0
Entering edit mode

many thanks for your reply,

Now, if i want to count the number of SNPs for each Breed, what is the best idea?

i have 5 breed in the my raw vcf.

ADD REPLY
0
Entering edit mode

I used these two scripts to count insertions and deletions, but the output was zero?

insertions:

awk '! /\#/' variants.vcf | awk '{if(length($4) > 1 ) print}' | wc -l

deletions:

awk '! /\#/' variants.vcf | awk '{if(length($5) > 1) print}' | wc -l
ADD REPLY
0
Entering edit mode

That is not the solution posted in A: How to count SNPs, InDels

ADD REPLY
0
Entering edit mode

That is not a good solution, as you might have variants with multiple alleles, see this example:

chr1    10812   rs1197106884    G       C,T     .       .       RS=1197106884;RSPOS=10812;dbSNPBuildID=151;SSR=0;SAO=0;VP=0x050000020005000002000100;GENEINFO=DDX11L1:100287102;WGT=1;VC=SNV;R5;ASP;TOPMED=0.99756307339449541,0.00242896279306829,0.00000796381243628

This would be a InDel count with your script, but is a SNP. Refer to the offered solutions.

ADD REPLY
2
Entering edit mode
6.3 years ago

Via BEDOPS convert2bed:

$ vcf2bed --snvs < foo.vcf | wc -l
$ vcf2bed --insertions < foo.vcf | wc -l
$ vcf2bed --deletions < foo.vcf | wc -l
ADD COMMENT

Login before adding your answer.

Traffic: 2481 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