Is it possible to count the number of loci in a VCF file?
1
1
Entering edit mode
7.4 years ago
beausoleilmo ▴ 580

I'm wondering if in my VCF file, I can count the number of loci.

I would count the number of SNPs with

egrep -v "^#" input.vcf | wc -l

But what about the number of loci? If I have 55 individuals in my VCF file, does this is an issue?

VCF SNP Loci • 3.8k views
ADD COMMENT
1
Entering edit mode
7.4 years ago

use option -c to count:

grep  -c -v "^#" input.vcf
ADD COMMENT
0
Entering edit mode

I know that a SNP can be accounted as a locus, but do you know if there is a way to know how many SNPs I called in the different genes on my reference genome. I have he annotation file "GFF". Is there a tool that can map the number of SNPs to the genes?

ADD REPLY
0
Entering edit mode

convert the vcf to bed and then use bedtools intersect...

ADD REPLY
0
Entering edit mode

I used this code to intersect the GFF and the bed files, but how do you count the number of SNPs per gene in the GFF? bedtools intersect -a gene.gff \ -b output.bed

This is just, I think, giving the similarities in the 2 documents. Right?

ADD REPLY

Login before adding your answer.

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