Skip to content
Snippets Groups Projects
Commit 40a38d47 authored by Hervé  MENAGER's avatar Hervé MENAGER
Browse files

connect the smart JOST computation switch to the function params.

parent f5723e92
No related branches found
No related tags found
No related merge requests found
......@@ -368,6 +368,20 @@ def create_inittable_file(input_meta_path: str, init_covariance_path: str, init_
def create_worktable_file(phenotype_ids: List[str], init_file_path: str, project_hdf_path: str, remove_nan: bool):
"""
Create a worktable file from an initial data table by specifying the
selected phenotypes and the computation strategy
:param phenotype_ids: the list of IDs for the phenotypes to select
:param init_file_path: path to the initial data table
:param project_hdf_path: path to the worktable file that will be produced
:path remove_nan: boolean to control the JOST computation strategy,
- if True any SNP which has a NaN value for one of its
phenotypes will be removed.
- if False SNPs will be removed only if all phenotype
values are NaN and JOST will be performed the "smart"
way to compensate these missing values.
"""
# read data by chunks to optimize memory usage
# select only rows (SNPs) where there are no missing data
how_dropna = 'any' if remove_nan else 'all'
......@@ -382,7 +396,7 @@ def create_worktable_file(phenotype_ids: List[str], init_file_path: str, project
COV = read_hdf(init_file_path, 'COV')
Zsel = SumStatTab[phenotype_ids]
subCOV = COV.loc[phenotype_ids, phenotype_ids]
smart_na_computation = False #True
smart_na_computation = not(remove_nan)
if smart_na_computation:
JOST = create_worktable_file_wnan(Zsel,subCOV)
else:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment