Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Statistical-Genetics
RAISS
Commits
911021e1
Commit
911021e1
authored
Mar 04, 2018
by
hjulienne
Browse files
testing stats_model
parent
fa8b3139
Changes
3
Hide whitespace changes
Inline
Side-by-side
impute_jass/impute_jass/__init__.py
View file @
911021e1
import
impute_jass.ld_matrix
as
LD
import
impute_jass.stat_models
as
model
impute_jass/impute_jass/stat_models.py
0 → 100644
View file @
911021e1
"""
function for SNP imputation
"""
import
numpy
as
np
def
ImpG_model
(
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
)
Sig_t_inv
=
np
.
linalg
.
inv
(
Sig_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
})
impute_jass/impute_jass/windows.py
0 → 100644
View file @
911021e1
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment