This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Is the heterozygosity flag (--het) in vcftools calculate observed and expected heterozygosity?

Hi All,

I am still beginner in this field, I just want to make sure about what I am doing. I have used vcftools to calculate heterozygosity of my vcf file, which contains one population, please see the command below.

vcftools --vcf input.vcf --het --out output.het

what I have got is the file below:

INDV    O(HOM)  E(HOM)          N_SITES            F
1   8292008 8649694.8   12260583    -0.09906
10  8675596 8649619.3   12260443    0.00719
11  8874072 8648987.5   12259527    0.06234
13a  8874825    8648830.1   12259283    0.06259
14  8893536 8649143.0   12259772    0.06769
2   8439004 8648868.3   12259414    -0.05813
3   8687517 8649371.6   12260068    0.01056
4   8483412 8649541.0   12260342    -0.04601
5   9064207 8648823.1   12259333    0.11505
6   8512310 8649564.9   12260422    -0.03801
7   9065816 8648660.4   12259099    0.11554
8b  8990089 8649252.6   12259906    0.09440
9   8710054 8649450.6   12260170    0.01678f

If you notice from the result, it is HOM not Het from the head of the file.

my question ((is this homozygosity or heterozygosity)) if is it homo, how can I calculate expected and observed heterozygosity.

Thank you all,

Ahmed

vcftools vcf

Dear All,

Is there any explanation for the above please?

Thanks,

Ahmed

I am having the same question. Can somebody answer here. I did the same using --het command of plink and get the same output mentioned above.What next should i do to reach to observed and expected heterozygosity

Did you find an answer? I'm stuck on this too

1 answer

From one of the VCFtools authors:

The output of the --het function is a summary for each individual of the observed number of homozygous sites ( O(hom) ) and the expected number of homozygous sites ( E(hom) ). It also includes the total number of sites that the individual has data for and the inbreeding coefficient F.

[source: https://sourceforge.net/p/vcftools/mailman/message/33590266/]

Kevin

Thank you for this, Kevin. We are also trying to wrap our minds around the best diversity descriptive statistics to provide for high-throughput sequencing data. Observed and expected heterozygosity have been staple descriptive statistics for microsatellite data sets for a long time, which may be why some are keen to figure this one out!

With that said, I'm having trouble understanding the formula on observed heterozygosity above. Although I'm still pretty new to this, wouldn't the following formula be more indicative of proportion of observed heterozygosity?

N_Sites - O(HOM) = O(HET)

N_Sites - E(HOM) = E(HET)

Then, after that, you can do the following formula to provide an individual proportion of expected and observed heterozygous sites:

O(HET) / N_Sites = Proportion Observed Heterozygous Sites

E(HET) / N_Sites = Proportion Expected Heterozygous Sites

All thoughts welcome if I'm far off base here.

E(HOM) - O(HOM) = O(HET)

This looks wrong, shouldn't it be:

#Sites - O(HOM) = O(HET)

?

I have edited out my formula.

Heys, I'm interested in calculating genome-wide heterozygosity. How did you solve it?

Log in to answer this question.