Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
J
jass_preprocessing
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Statistical-Genetics
jass_preprocessing
Commits
1497e1fc
Commit
1497e1fc
authored
5 months ago
by
Hanna JULIENNE
Browse files
Options
Downloads
Plain Diff
Merge branch 'hjulienn-
805f2f78
-patch-74c6' into 'master'
Hjulienn
805f2f78
patch 74c6 See merge request
!6
parents
57ee2dfb
b13fe091
No related branches found
No related tags found
1 merge request
!6
Hjulienn 805f2f78 patch 74c6
Pipeline
#147355
passed
5 months ago
Stage: test
Stage: deploy
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
jass_preprocessing/__pycache__/__main__.cpython-311.pyc
+0
-0
0 additions, 0 deletions
jass_preprocessing/__pycache__/__main__.cpython-311.pyc
jass_preprocessing/compute_score.py
+21
-3
21 additions, 3 deletions
jass_preprocessing/compute_score.py
with
21 additions
and
3 deletions
jass_preprocessing/__pycache__/__main__.cpython-311.pyc
0 → 100644
+
0
−
0
View file @
1497e1fc
File added
This diff is collapsed.
Click to expand it.
jass_preprocessing/compute_score.py
+
21
−
3
View file @
1497e1fc
...
@@ -12,18 +12,36 @@ def compute_z_score(mgwas):
...
@@ -12,18 +12,36 @@ def compute_z_score(mgwas):
"""
"""
Compute zscore value and sign1
Compute zscore value and sign1
add the corresponding column to the mgwas dataframe
add the corresponding column to the mgwas dataframe
the smallest positive value of float
sys.float_info.min
2.2250738585072014e-308
the biggest Z score
np.sqrt(ss.chi2.isf(sys.float_info.min, 1))
37.537836095576054
"""
"""
print
(
mgwas
.
columns
)
mgwas
[
"
computed_z
"
]
=
np
.
sqrt
(
ss
.
chi2
.
isf
(
mgwas
[
'
pval
'
],
1
))
if
'
z
'
in
mgwas
.
columns
:
sign_vect
=
np
.
sign
(
mgwas
.
z
)
mgwas
.
loc
[
mgwas
[
"
computed_z
"
].
isin
([
np
.
inf
]),
'
computed_z
'
]
=
mgwas
[
"
z
"
]
if
'
beta_or_Z
'
in
mgwas
.
columns
:
elif
'
beta_or_Z
'
in
mgwas
.
columns
:
sign_vect
=
np
.
sign
(
mgwas
.
beta_or_Z
)
sign_vect
=
np
.
sign
(
mgwas
.
beta
)
mgwas
[
"
computed_z
"
]
=
mgwas
[
"
computed_z
"
].
replace
(
np
.
inf
,
37.537836095576054
)
else
:
else
:
if
"
OR
"
in
mgwas
.
columns
:
if
"
OR
"
in
mgwas
.
columns
:
sign_vect
=
np
.
sign
(
mgwas
[
"
OR
"
]
-
1.0
+
10
**
(
-
8
))
sign_vect
=
np
.
sign
(
mgwas
[
"
OR
"
]
-
1.0
+
10
**
(
-
8
))
mgwas
[
"
computed_z
"
]
=
mgwas
[
"
computed_z
"
].
replace
(
np
.
inf
,
37.537836095576054
)
else
:
else
:
raise
ValueError
(
raise
ValueError
(
'
The gwas data frame doesn
"
t contain effect column
'
)
'
The gwas data frame doesn
"
t contain effect column
'
)
mgwas
[
"
computed_z
"
]
=
np
.
sqrt
(
ss
.
chi2
.
isf
(
mgwas
[
'
pval
'
],
1
))
*
sign_vect
*
mgwas
[
"
sign_flip
"
]
mgwas
[
"
computed_z
"
]
=
mgwas
[
"
computed_z
"
]
*
sign_vect
*
mgwas
[
"
sign_flip
"
]
return
mgwas
return
mgwas
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment