chasewnelson / SNPGenie

Program for estimating πN/πS, dN/dS, and other diversity measures from next-generation sequencing data
GNU General Public License v3.0
102 stars 37 forks source link

Gene diversity (observed heterozygosity) #21

Closed mullerbsf closed 5 years ago

mullerbsf commented 5 years ago

Dear Chase,

What does the asterisk (*) symbol mean in the output results of gene diversity (mean_gdiv_polymorphic, mean_N_gdiv and mean_S_gdiv)?

What is the difference between zero values (0) to the asterisks (*) symbols?

For some products (product_result) I have zero values for nucleotide diversity; but, I do get non-zero values for the number of sites (N_sites and S_sites). How can SNPGenie assess the number of sites, but not the other estimates (e.g. number of nucleotide substitutions per site [d] = N_diffs and S_diffs; and nucleotide diversity [pi] = piN and piS) for a specific product?

I appreciate your help! Barbara.

singing-scientist commented 5 years ago

Thanks very much for using SNPGenie, @mullerbsf!

An asterisk () symbol typically means an undefined value, which can occur if there are no instances of a case (e.g., if there are no polymorphic nonsynonymous sites, N_gdiv would be ), or if a denominator is 0 (e.g., a number of sites). In order to assess exactly what is happening in your instance, I would need a specific example.

A protein-coding gene always has some finite number of nonsynonymous and synonymous sites. However, if there is no variation, there will be 0 differences. For example, consider the following two sequences:

ATGCAGAAA ATGCAGAAA

ATG has 3 N sites (i.e., all possible changes are nonsynonymous), CAG has 2+2/3 N sites and 1/3 S sites, and AAA has 2+2/3 N sites and 1/3 S sites. The sequence are identical, so averaging the number of sites results in the same values. Thus, on average, there is a total of 8.33 N sites and 0.67 S sites (summing to 9 sites in all). However, because there are no differences between the two sequences, N_diffs and S_diffs are both 0. As a result, πN = 0 / 8.33 = 0, and πS = 0 / 0.67 = 0.

Let me know if this helps.

singing-scientist commented 5 years ago

I will close this issue now. Please re-open if there are any follow-up questions.