Which tool to calculate per site stats on vcf file?
2
0
Entering edit mode
6.8 years ago
Ayité K ▴ 50

Hello, Does anyone know a tool to calculate per site stats ( nb Homozygous Ref, nb Homozygous Alt , nb Heterozygous , nb NA ) on SNPs data in vcf formats?

snp vcf • 2.7k views
ADD COMMENT
1
Entering edit mode
6.8 years ago
rbagnall ★ 1.8k

bcftools with the fill-tags plugin will add this info to the vcf file.

ADD COMMENT
0
Entering edit mode
6.8 years ago

using bioalcidaejdk : http://lindenb.github.io/jvarkit/BioAlcidaeJdk.html

 java -jar dist/bioalcidaejdk.jar -e 'out.print("POS\t");for(GenotypeType GT : GenotypeType.values()) out.print("\t"+GT); out.println(); stream().forEach(V->{out.print(V.getContig()+":"+V.getStart()+":"+V.getReference().getDisplayString());for(GenotypeType GT : GenotypeType.values()) out.print("\t"+V.getGenotypes().stream().filter(G->G.getType()==GT).count()); out.println();});' in.vcf | column -t

POS               NO_CALL  HOM_REF  HET  HOM_VAR  UNAVAILABLE  MIXED
rotavirus:51:A    0        3        0    1        0            0
rotavirus:91:A    0        3        1    0        0            0
rotavirus:130:T   0        3        1    0        0            0
rotavirus:232:T   0        3        1    0        0            0
rotavirus:267:C   0        3        1    0        0            0
rotavirus:424:A   0        3        1    0        0            0
rotavirus:520:T   0        3        1    0        0            0
rotavirus:536:A   0        3        0    1        0            0
rotavirus:562:A   0        3        1    0        0            0
rotavirus:583:G   0        3        1    0        0            0
rotavirus:661:T   0        3        1    0        0            0
rotavirus:693:T   0        3        0    1        0            0
rotavirus:738:T   0        2        2    0        0            0
rotavirus:799:A   0        3        0    1        0            0
rotavirus:812:G   0        3        0    1        0            0
rotavirus:833:G   0        3        0    1        0            0
rotavirus:916:A   0        3        0    1        0            0
rotavirus:946:C   0        3        1    0        0            0
rotavirus:961:T   0        3        1    0        0            0
rotavirus:1044:A  0        3        0    1        0            0
rotavirus:1045:C  0        3        0    1        0            0
rotavirus:1054:C  0        3        0    1        0            0
rotavirus:1064:G  0        3        0    1        0            0
rotavirus:1064:G  0        3        0    1        0            0
rotavirus:1064:G  4        0        0    0        0            0
ADD COMMENT

Login before adding your answer.

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