The SegSiteStructure objects (defined here) look like they're intended to hold the lists of ordered IBD segments in a dictionary object called seg_map. It looks like the updateSegs method (defined here) can be used to populate this segment map. At the moment, I don't think it's being used anywhere. (Searching for 'updateSegs didn't yield any hits in the script)). Because of this, the seg_map object appears to be empty at all parts of the algorithm. ( I've made a branch called seg-map with some print statements that show this behaviour.)
This impacts the log-likelihood calculation via the is_ibd method of the SegSiteStructure objects defined here. It looks like this method is used to check whether the focal sample, original_id, shares any IBD segments with other samples in the 'inner pedigree', and if true, the ibd_probability is calculated differently. The print statements that I've put in the new branch show that, at the moment, this function is only ever returning True when you pass the an identical sample and haplotype into the method. It appears to be missing all of the genuine IBD segments relating different samples to each other.
Two related but possibly smaller points:
it's not clear to me that anything should be contributed to the log-likelihood terms when the algorithm is comparing identical samples and haplotypes?
It looks like the inner_pedigree object is just a list of all of the nodes rather than a local marginal gene tree -- at this point that's okay, because I think this is likely to just introduce inefficiency rather than error.
The
SegSiteStructure
objects (defined here) look like they're intended to hold the lists of ordered IBD segments in a dictionary object calledseg_map
. It looks like theupdateSegs
method (defined here) can be used to populate this segment map. At the moment, I don't think it's being used anywhere. (Searching for 'updateSegs
didn't yield any hits in the script)). Because of this, theseg_map
object appears to be empty at all parts of the algorithm. ( I've made a branch calledseg-map
with some print statements that show this behaviour.)This impacts the log-likelihood calculation via the
is_ibd
method of theSegSiteStructure
objects defined here. It looks like this method is used to check whether the focal sample,original_id
, shares any IBD segments with other samples in the 'inner pedigree', and if true, theibd_probability
is calculated differently. The print statements that I've put in the new branch show that, at the moment, this function is only ever returningTrue
when you pass the an identical sample and haplotype into the method. It appears to be missing all of the genuine IBD segments relating different samples to each other.Two related but possibly smaller points:
inner_pedigree
object is just a list of all of the nodes rather than a local marginal gene tree -- at this point that's okay, because I think this is likely to just introduce inefficiency rather than error.