AlphaGenes / AlphaPeel

AlphaPeel: calling, phasing, and imputing genotype and sequence data in pedigrees
MIT License
2 stars 11 forks source link

Estimation of allele freq with metafounders #148

Open XingerTang opened 6 months ago

XingerTang commented 6 months ago

@gregorgorjanc @RosCraddock Originally, while estimating the alternative allele frequency of the whole population, the algorithm looped over the genotypes of all the individuals to calculate the most likely alternative allele frequency.

Now, to estimate the alternative allele frequency of the metafounder, we need to loop over the genotypes of the progeny of the metafounder. Then we need to make a list of progeny for each metafounder.

One way to do that is by going through the pedigree to check the ancestors of each individual, but we might lose some information if we don't do it in the correct order. Is there any better way to do it?

XingerTang commented 6 months ago

In PeelingUpdates.getNewtonUpdate

gregorgorjanc commented 6 months ago

As discussed today there might be multiple ways to handle this so let's get back to this once we have other engineering done;)

gregorgorjanc commented 6 months ago

A note. I recall that AW reported that estimating allele freq sometimes made genome-wide imputation worse. I find this surprising. After our look at the code yesterday, I think that maybe this observation was/is due to the way AF is estimated - we collect information from any pedigree member and find AF that would best explain their observed genotype status (via Newton optimisation). This approach ignores that some of these individuals are related (imagine we have lots of data from one family and far less from other families - that family will dominate the result too much - we would ideally weight by relationships between individuals) and importantly, it is not estimating the right AF - this is an estimate of AF that pertains to the whole population spanning all the generations, which is not what we need for peeling - for peeling we need AF in founders (or metafounder(s)). There might not be much difference between these in some cases, but I for sure know that there can be quite a bit of difference in some cases - long pedigrees with selection!