fix: COI correctly calculates parent×offspring and direct-relation pairings #47
Reference in New Issue
Block a user
Delete Branch "fix/coi-direct-relation"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
calculateCOIwas returning0.00%for parent×offspring pairings (e.g. River × Dog2 where River is Dog2's sire).Root Cause
The
commonIdsfilter had:Because
getAncestorMapincludes the dog itself atgen 0, River (the sire,sid) appears in Dog2'sdamMapat generation 1 — exactly the signal we want. Butid !== sidwas filtering it out, silently zeroing the COI.Fix
Removed
id !== sidfrom the filter. Onlyid !== didis kept to prevent the dam itself appearing as its own common ancestor on the sire's side (a genuine reflexive loop).Expected Results
Testing