def neugamma(xx, params):
"""Return Neutral + Gamma distribution"""
"""params = (shape, scale, pneu)
pneu is the proportion of neutral mutations"""
alpha, beta, pneu = params
xx = np.atleast_1d(xx)
out = (1-pneu)*gamma(xx, (alpha, beta))
# Assume gamma < 1e-4 is essentially neutral
out[np.logical_and(0 <= xx, xx < 1e-4)] += pneu/1e-4
# Reduce xx back to scalar if it's possible
return np.squeeze(out)
# For example: in InferDFE.py, adding
if (sele_dist == "neugamma"):
print ("Using integrate_point_pos for neugamma distribution.")
func = cache1d.integrate_point_pos
else:
func = cache1d.integrate