Question: Count number of InDels per chromosome in Raw vcf file
0
gravatar for mostafarafiepour
6 months ago by
mostafarafiepour60 wrote:

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 • 263 views
ADD COMMENTlink modified 6 months ago by Alex Reynolds27k • written 6 months ago by mostafarafiepour60
1

see How to count SNPs, InDels , Count Of Variants , SNP,INDEL counting per chromosomes in vcf

ADD REPLYlink modified 6 months ago • written 6 months ago by Pierre Lindenbaum118k

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 REPLYlink written 6 months ago by mostafarafiepour60

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 REPLYlink written 6 months ago by mostafarafiepour60

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

ADD REPLYlink written 6 months ago by genomax63k

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 REPLYlink modified 6 months ago • written 6 months ago by ATpoint14k
2
gravatar for Alex Reynolds
6 months ago by
Alex Reynolds27k
Seattle, WA USA
Alex Reynolds27k wrote:

Via BEDOPS convert2bed:

$ vcf2bed --snvs < foo.vcf | wc -l
$ vcf2bed --insertions < foo.vcf | wc -l
$ vcf2bed --deletions < foo.vcf | wc -l
ADD COMMENTlink written 6 months ago by Alex Reynolds27k
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: 1105 users visited in the last hour