KangchengHou / admix-kit

Toolkit for analyzing genetics data from admixed populations
https://kangchenghou.github.io/admix-kit
22 stars 4 forks source link

p-value = 0, inconsistency between marginal and marginal_fast #8

Closed KangchengHou closed 2 years ago

KangchengHou commented 3 years ago

import admix import numpy as np import matplotlib.pyplot as plt

np.random.seed(1234)

np.random.seed(1234) binary_sim = admix.simulate.binary_pheno(dset, beta=beta, hsq=0.15, method="logit")

dset.indiv["pheno"] = binary_sim["pheno"][:, sim_i] df_assoc_ATT = admix.assoc.marginal_fast(dset, pheno_col="pheno", family="logistic", method="ATT") df_assoc_TRACTOR = admix.assoc.marginal_fast(dset, pheno_col="pheno", family="logistic", method="TRACTOR")

fig, axes = plt.subplots(figsize=(4, 2), ncols=2, dpi=150) admix.plot.manhattan(df_assoc_ATT.P.values, s=10, ax=axes[0]) axes[0].set_title("ATT") admix.plot.manhattan(df_assoc_TRACTOR.P.values, s=10, ax=axes[1]) axes[1].set_title("TRACTOR") fig.tight_layout()