Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Statistical-Genetics
RAISS
Commits
62fee36f
Commit
62fee36f
authored
Mar 29, 2018
by
Hanna JULIENNE
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add entry point to perform chromosome imputation
parent
cd04d3fd
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
52 additions
and
18 deletions
+52
-18
impute_jass/impute_jass/__main__.py
impute_jass/impute_jass/__main__.py
+45
-0
impute_jass/impute_jass/imputation_launcher.py
impute_jass/impute_jass/imputation_launcher.py
+1
-11
impute_jass/impute_jass/main.py
impute_jass/impute_jass/main.py
+0
-0
impute_jass/setup.py
impute_jass/setup.py
+6
-7
No files found.
impute_jass/impute_jass/__main__.py
0 → 100644
View file @
62fee36f
import
argparse
import
pandas
as
pd
from
impute_jass.imputation_launcher
import
ImputationLauncher
def
launch_chromosome_imputation
(
args
):
"""
Function whose only purpose is to allow the calling of the ImputationLauncher.chromosome_imputation method
from an entry point
"""
print
(
args
)
imputer
=
ImputationLauncher
(
window_size
=
int
(
args
.
window_size
),
buf
=
int
(
args
.
buffer_size
),
lamb
=
float
(
args
.
l2_regularization
),
pinv_rcond
=
float
(
args
.
eigen_treshold
))
z_file
=
"{0}/z_{1}_{2}.txt"
.
format
(
args
.
zscore_folder
,
args
.
gwas
,
args
.
chrom
)
zscore
=
pd
.
read_csv
(
z_file
)
imputer
.
chromosome_imputation
(
args
.
chrom
,
zscore
,
ref_panel
,
ld_folder
)
def
add_chromosome_imputation_argument
(
parser
):
parser
.
add_argument
(
'--chrom'
,
required
=
True
,
help
=
"chromosome to impute to the chr\d+ format"
)
parser
.
add_argument
(
'--gwas'
,
required
=
True
,
help
=
"GWAS to impute to the consortia_trait format"
)
parser
.
add_argument
(
'--ref-folder'
,
required
=
True
,
help
=
"reference panel location (used to determine which snp to impute)"
)
parser
.
add_argument
(
'--LD-folder'
,
required
=
True
,
help
=
"Location LD correlation matrices"
)
parser
.
add_argument
(
'--zscore-folder'
,
required
=
True
,
help
=
"Location of the zscore files of the gwases to impute"
)
parser
.
add_argument
(
'--output-folder'
,
required
=
True
,
help
=
"Location of the impute zscore files"
)
parser
.
add_argument
(
'--window-size'
,
help
=
"Size of the non overlapping window"
,
default
=
500000
)
parser
.
add_argument
(
'--buffer-size'
,
help
=
"Size of the buffer around the imputation window"
,
default
=
125000
)
parser
.
add_argument
(
'--l2-regularization'
,
help
=
"Size of the buffer around the imputation window"
,
default
=
0.1
)
parser
.
add_argument
(
'--eigen-treshold'
,
help
=
"treshold under which eigen vectors are removed for the computation of the pseudo inverse"
,
default
=
0.1
)
parser
.
set_defaults
(
func
=
launch_chromosome_imputation
)
return
(
parser
)
def
main
():
parser
=
argparse
.
ArgumentParser
()
#prog='impute_jass')
parser
=
add_chromosome_imputation_argument
(
parser
)
args
=
parser
.
parse_args
()
args
.
func
(
args
)
if
__name__
==
"__main__"
:
main
()
impute_jass/impute_jass/imputation_launcher.py
View file @
62fee36f
...
...
@@ -7,23 +7,13 @@ import pandas as pd
from
.windows
import
ld_region_centered_window_imputation
,
impg_like_imputation
,
realigned_zfiles_on_panel
def
chromosome_imputation_entry_point
(
chrom
,
zscore
,
ref_panel
,
ld_folder
,
window_size
=
10000
,
imputation_style
=
"online"
,
buf
=
2500
,
lamb
=
0.01
,
pinv_rcond
=
0.01
):
"""
Function whose only purpose is to allow the calling of the ImputationLauncher.chromosome_imputation method
from an entry point
"""
imputer
=
ImputationLauncher
(
window_size
=
10000
,
imputation_style
=
"online"
,
buf
=
2500
,
lamb
=
0.01
,
pinv_rcond
=
0.01
)
imputer
.
chromosome_imputation
(
chrom
,
zscore
,
ref_panel
,
ld_folder
)
class
ImputationLauncher
(
object
):
"""
Class perform imputation of snp from summary statistic
"""
def
__init__
(
self
,
window_size
=
10000
,
imputation_style
=
"
online
"
,
buf
=
2500
,
lamb
=
0.01
,
pinv_rcond
=
0.01
):
def
__init__
(
self
,
window_size
=
10000
,
imputation_style
=
"
batch
"
,
buf
=
2500
,
lamb
=
0.01
,
pinv_rcond
=
0.01
):
"""
Args:
...
...
impute_jass/impute_jass/main.py
deleted
100644 → 0
View file @
cd04d3fd
impute_jass/setup.py
View file @
62fee36f
...
...
@@ -10,13 +10,12 @@ setup(name='impute_jass',
#package_dir = {'': 'jass_preprocessing'},
packages
=
[
'impute_jass'
],
package_data
=
{
'impute_jass'
:
'./data/*.csv'
},
zip_safe
=
False
zip_safe
=
False
,
# entry_points={
# 'console_scripts' : [
# 'impute_chromosome = imputation_launcher:chromosome_imputation_entry_point'
#
# ]
# }
entry_points
=
{
'console_scripts'
:
[
'impute_jass = impute_jass.__main__:main'
]
}
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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