else:
raise ValueError("Cannot determine N. This message indicates a bug.\nN should have been checked earlier in the program.")
return dat.reset_index(drop=True)
def p_to_beta(P, N):
"""
Convert P-value and N to standardized beta
After Change
nstudy_min = args.nstudy_min if args.nstudy_min else dat.NSTUDY.max()
old = len(dat)
dat = dat[dat.NSTUDY >= nstudy_min].drop(["NSTUDY"], axis=1).reset_index(drop=True)
new = len(dat)
log.log("Removed {M} SNPs with NSTUDY < {MIN} ({N} SNPs remain).".format(M=old-new, N=new, MIN=nstudy_min))
if "N" not in dat.columns:
if args.N: