bd9bdcb334be151fe0195d8685d575355df5a551,third_party/nucleus/util/genomics_math.py,,log10_binomial,#Any#Any#Any#,161

Before Change


  Returns:
    log10 probability of seeing k successes in n trials with p.
  
  return scipy.stats.binom.logpmf(k, n, p) / LOG_E_OF_10


def log10sumexp(log10_probs):
  Returns log10(sum(10^log10_probs)) computed in a numerically-stable way.

After Change


  Returns:
    log10 probability of seeing k successes in n trials with p.
  
  r = math.lgamma(n + 1) - (math.lgamma(k + 1) + math.lgamma(n - k + 1))
  if k > 0:
    r += k * math.log(p)
  if n > k:
    r += (n-k) * math.log1p(-p)
  return r / LOG_E_OF_10


def log10sumexp(log10_probs):
  Returns log10(sum(10^log10_probs)) computed in a numerically-stable way.
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 12

Instances


Project Name: google/deepvariant
Commit Name: bd9bdcb334be151fe0195d8685d575355df5a551
Time: 2018-11-02
Author: no-reply@google.com
File Name: third_party/nucleus/util/genomics_math.py
Class Name:
Method Name: log10_binomial


Project Name: scipy/scipy
Commit Name: b0f34cdfd3ec8e41521cfd1b4a19c8dabb51fbbf
Time: 2020-02-15
Author: pvanmulbregt@users.noreply.github.com
File Name: scipy/stats/_ksstats.py
Class Name:
Method Name: _kolmogn_p


Project Name: google/nucleus
Commit Name: 397dace4af2db3adaec1746ab4dce36ac715cdfe
Time: 2018-11-02
Author: no-reply@google.com
File Name: nucleus/util/genomics_math.py
Class Name:
Method Name: log10_binomial