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
6f72006d
Commit
6f72006d
authored
5 years ago
by
Hanna JULIENNE
Browse files
Options
Downloads
Patches
Plain Diff
corrected index system to treat correctly GWAS sharing the same summary statistics file
parent
f28feeee
No related branches found
No related tags found
No related merge requests found
Pipeline
#18645
passed
5 years ago
Stage: test
Stage: deploy
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
jass_preprocessing/__main__.py
+2
-2
2 additions, 2 deletions
jass_preprocessing/__main__.py
jass_preprocessing/map_gwas.py
+5
-7
5 additions, 7 deletions
jass_preprocessing/map_gwas.py
with
7 additions
and
9 deletions
jass_preprocessing/__main__.py
+
2
−
2
View file @
6f72006d
...
@@ -32,7 +32,7 @@ def launch_preprocessing(args):
...
@@ -32,7 +32,7 @@ def launch_preprocessing(args):
gwas_map
=
pd
.
read_csv
(
args
.
gwas_info
,
sep
=
"
\t
"
)
gwas_map
=
pd
.
read_csv
(
args
.
gwas_info
,
sep
=
"
\t
"
)
#define an unique
#define an unique
gwas_map
[
'
tag
'
]
=
gwas_map
.
Consortium
+
"
_
"
+
D
.
Outcome
gwas_map
[
'
tag
'
]
=
gwas_map
.
Consortium
+
"
_
"
+
gwas_map
.
Outcome
if
gwas_map
.
tag
.
duplicated
().
any
():
if
gwas_map
.
tag
.
duplicated
().
any
():
raise_duplicated_index
(
gwas_map
.
tag
)
raise_duplicated_index
(
gwas_map
.
tag
)
...
@@ -41,7 +41,7 @@ def launch_preprocessing(args):
...
@@ -41,7 +41,7 @@ def launch_preprocessing(args):
for
tag
in
gwas_map
.
index
:
for
tag
in
gwas_map
.
index
:
gwas_filename
=
D
.
loc
[
tag
,
"
filename
"
]
gwas_filename
=
gwas_map
.
loc
[
tag
,
"
filename
"
]
print
(
'
processing GWAS: {}
'
.
format
(
tag
))
print
(
'
processing GWAS: {}
'
.
format
(
tag
))
start
=
time
.
time
()
start
=
time
.
time
()
...
...
This diff is collapsed.
Click to expand it.
jass_preprocessing/map_gwas.py
+
5
−
7
View file @
6f72006d
...
@@ -76,7 +76,7 @@ def convert_missing_values(df):
...
@@ -76,7 +76,7 @@ def convert_missing_values(df):
return
df
.
replace
(
def_missing
,
nan_vec
)
return
df
.
replace
(
def_missing
,
nan_vec
)
def
map_columns_position
(
gwas_internal_link
,
my_labels
):
def
map_columns_position
(
gwas_internal_link
,
column_dict
):
"""
"""
Find column position for each specific Gwas
Find column position for each specific Gwas
...
@@ -87,16 +87,14 @@ def map_columns_position(gwas_internal_link, my_labels):
...
@@ -87,16 +87,14 @@ def map_columns_position(gwas_internal_link, my_labels):
Return:
Return:
pandas Series with column position and column names as index
pandas Series with column position and column names as index
"""
"""
print
(
gwas_internal_link
)
print
(
gwas_internal_link
)
gwas_file
=
gwas_internal_link
.
split
(
'
/
'
)[
-
1
]
gwas_file
=
gwas_internal_link
.
split
(
'
/
'
)[
-
1
]
my_labels
=
column_dict
.
loc
[
gwas_file
]
#Our standart labels:
#Our standart labels:
reference_label
=
column_dict
.
columns
.
tolist
()
reference_label
=
column_dict
.
index
.
tolist
()
print
(
reference_label
)
# labels in the GWAS files
# labels in the GWAS files
target_lab
=
pd
.
Index
(
my_labels
.
values
.
tolist
())
target_lab
=
pd
.
Index
(
column_dict
.
values
.
tolist
())
is_gzipped
=
re
.
search
(
r
"
.gz$
"
,
gwas_internal_link
)
is_gzipped
=
re
.
search
(
r
"
.gz$
"
,
gwas_internal_link
)
if
is_gzipped
:
if
is_gzipped
:
f
=
gzip
.
open
(
gwas_internal_link
)
f
=
gzip
.
open
(
gwas_internal_link
)
...
...
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