def het_lik(self, variant_probe_coverage): if variant_probe_coverage.alternate_percent_coverage < 100 or variant_probe_coverage.reference_percent_coverage < 100: return MIN_LLK else: het_liks = [] for expected_depth in self.expected_depths: het_liks.append( log_lik_R_S_coverage( variant_probe_coverage.alternate_median_depth, variant_probe_coverage.reference_median_depth, expected_depth * self.minor_freq, expected_depth * (1 - self.minor_freq))) return max(het_liks)
def hom_alt_lik(self, variant_probe_coverage): if variant_probe_coverage.alternate_percent_coverage < 100 * \ percent_coverage_from_expected_coverage(max(self.expected_depths)): return MIN_LLK else: hom_alt_liks = [] # Either alt+cov or alt_covg + contam_covg for expected_depth in self.expected_depths: hom_alt_liks.append( log_lik_R_S_coverage( variant_probe_coverage.alternate_median_depth, variant_probe_coverage.reference_median_depth, expected_depth, expected_depth * self.error_rate / 3)) for contamination in self.contamination_depths: hom_alt_liks.append( log_lik_R_S_coverage( variant_probe_coverage.alternate_median_depth, variant_probe_coverage.reference_median_depth, expected_depth + contamination, (expected_depth + contamination) * self.error_rate / 3)) return max(hom_alt_liks)