Commit f378830d authored by E.L.Cortegano's avatar E.L.Cortegano

Fixed coancestry for poliploids

parent 572f3090
Pipeline #151334226 passed with stages
in 3 minutes and 23 seconds
......@@ -497,11 +497,7 @@ void Metapop::coancestry_from_freq () {
if (!(*eval_ind_locus[i][ind_i])[k]) { all_loci = false; break; }
else if (!(*eval_ind_locus[j][ind_j])[k]) { all_loci = false; break; }
else if ((*ind_freq[i][ind_i])[k][a]== 0.0 || (*ind_freq[j][ind_j])[k][a] == 0.0) continue;
else if ((*ind_freq[i][ind_i])[k][a] == 1.0 && (*ind_freq[j][ind_j])[k][a] == 1.0) tmpf += 1.0;
else if ((*ind_freq[i][ind_i])[k][a] == 0.5 && (*ind_freq[j][ind_j])[k][a] == 0.5) tmpf += 0.25;
else if ((*ind_freq[i][ind_i])[k][a] == 0.5 || (*ind_freq[j][ind_j])[k][a] == 0.5) {
tmpf += 0.5;
}
else tmpf += (*ind_freq[i][ind_i])[k][a] * (*ind_freq[j][ind_j])[k][a];
}
if (!all_loci) --eval_loci; // If no allele, no calculation for that loci
else f += tmpf;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment