def scaled_likelihoods(self): """Returns the scaled likelihood of each genotype.""" if not all(bool(x) for x in self._genotype_likelihood_containers): raise ValueError( 'All genotypes must have some probability mass: {}'.format( self._genotype_likelihood_containers)) return genomics_math.normalize_log10_probs([ genomics_math.log10sumexp(unscaled) for unscaled in self._genotype_likelihood_containers ])
def test_log10sumexp(self, log10_probs, expected): self.assertAlmostEqual(genomics_math.log10sumexp(log10_probs), expected)