Commit 3b326494 authored by hjulienn's avatar hjulienn
Browse files

modify load LD plink matrix function

parent f75d1071
......@@ -74,7 +74,7 @@ def load_plink_ld(plink_ld, ref_chr_df):
plink_ld = plink_ld + ".ld"
plink_ld = pd.read_csv(plink_ld, sep = "\s+")
mat_ld = plink_ld.pivot(index='SNP_A', columns='SNP_B', values='R')
un_index = mat_ld.index.union(mat_ld.columns)
un_index = mat_ld.index.intersection(mat_ld.columns)
mat_ld = mat_ld.reindex(index=un_index, columns=un_index)
mat_ld.fillna(0, inplace=True)
sym = np.where(np.abs(mat_ld.values) > np.abs(mat_ld.values.transpose()), mat_ld.values, mat_ld.values.transpose())
......
......@@ -104,5 +104,6 @@ def raiss_model(zt, sig_t, sig_i_t, lamb=0.01, rcond=0.01, batch=True):
var_norm = var_in_boundaries(var, lamb)
R2 = ((1+lamb)-var_norm)
print(R2)
mu = mu / np.sqrt(R2)
return({"var" : var, "mu" : mu, "ld_score" : ld_score, "condition_number" : condition_number, "correct_inversion":correct_inversion })
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment