Commit 36cb79b4 authored by Hanna  JULIENNE's avatar Hanna JULIENNE
Browse files

add ld file name parsing helper function

parent c1134860
import impute_jass.ld_matrix as LD
import impute_jass.stat_models as model
import impute_jass.windows
......@@ -8,7 +8,6 @@ def ImpG_model_batch(Zt, Sig_t, Sig_i_t):
"""
Argument:
Zt : (vector) the vector of known Z scores
"""
#np.fill_diagonal(Sig_t.values, 1.01)
......@@ -19,7 +18,7 @@ def ImpG_model_batch(Zt, Sig_t, Sig_i_t):
Var = np.diag(Sig_t)[0] - np.einsum('ij,jk,ki->i', Sig_i_t, Sig_t_inv ,Sig_i_t.transpose())
mu = np.dot(Sig_i_t, np.dot(Sig_t_inv, Zt))
return({"Var":Var, "mu":mu})
......@@ -27,7 +26,6 @@ def ImpG_model_snp(Zt, Sig_t, Sig_i_t):
"""
Argument:
Zt : (vector) the vector of known Z scores
"""
#np.fill_diagonal(Sig_t.values, 1.01)
#Sig_t.fillna(0, inplace=True)
......
......@@ -2,6 +2,24 @@
implement the imputation window is sliding along the genome:
- ImpG like: Non overlapping windows, the imputation is apply in batch to unknown snp in the window
- Sliding: A sliding window centered on the Snp to impute
- centered_window: A sliding window centered on the Snp to impute
"""
def parse_region_position(LD_file):
"""
Retrieve the region definition from a ld-file generated by impute_jass
Argument :
LD_file : A LD file generated by jass_impute
"""
(chrom, startpos, endpos ) = LD_file.split("/")[-1].split(".")[0].split('_')
return (chrom, startpos, endpos)
def centered_window_imputation(LD_file, ref_panel_folder, Zfile):
"""
Each missing Snp is imputed by known snp found in a window centered on the SNP to impute
"""
pass
Markdown is supported
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