def fill_bxcan_vis_datadir(config): sh._try_fill_config(config, 'bxcan_vis_datadir', default_params.BXCAN_VIS_DATADIR) res = sh._try_to_format( config['bxcan_vis_datadir'], OrderedDict([('datadir', config['datadir'])]) ) return res
def fill_ld_clump_yaml(config): sh._try_fill_config(config, 'ld_clump_yaml', default_params.LD_CLUMP_YAML) config['ld_clump_yaml'] = sh._try_to_format( config['ld_clump_yaml'], OrderedDict([('datadir', config['datadir'])]) ) return config['ld_clump_yaml']
def fill_bxcan_report_data(config): sh._try_fill_config(config, 'bxcan_idp_meta', default_params.BXCAN_IDP_META) sh._try_fill_config(config, 'bxcan_color_code', default_params.BXCAN_COLOR_CODE) meta = sh._try_to_format( config['bxcan_idp_meta'], OrderedDict([('datadir', config['datadir'])]) ) color = sh._try_to_format( config['bxcan_color_code'], OrderedDict([('datadir', config['datadir'])]) ) return meta, color
def fill_snp_bim(config): sh._try_fill_config(config, 'idp_gwas_snp_pattern', default_params.IDP_GWAS_SNP_PATTERN) sh._check_desired_wildcards( config['idp_gwas_snp_pattern'], [ '{chr_num}' ] ) arg = sh._try_to_format( config['idp_gwas_snp_pattern'], OrderedDict([ ('datadir', config['datadir']), ('chr_num', '[chr_num]') ]) ) files = sh._try_format_for_list( config['geno_cov_pattern'], OrderedDict([('datadir', config['datadir'])]), default_params.CHRS, 'chr_num' ) return arg, files
def fill_mr_ld_panel(config): sh._try_fill_config(config, 'gwas_pop', default_params.GWAS_POP) sh._check_val_in_pool(config['gwas_pop'], default_params.GWAS_POPS) sh._try_fill_config(config, 'mr_ld_panel_pattern', default_params.MR_LD_PANEL_PATTERN) arg = sh._try_to_format( config['mr_ld_panel_pattern'], OrderedDict([ ('datadir', config['datadir']), ('gwas_pop', config['gwas_pop']) ]) ) files = sh._try_format_for_list( config['geno_cov_pattern'] + '.{suffix}', OrderedDict([ ('datadir', config['datadir']), ('gwas_pop', config['gwas_pop']) ]), ['bed', 'bim', 'fam'], 'suffix' ) return arg, files
def fill_permz(config): sh._try_fill_config(config, 'bxcan_ldblock_perm', default_params.BXCAN_LDBLOCK_PERM) sh._try_fill_config(config, 'bxcan_ldblock_perm_seed', default_params.BXCAN_LDBLOCK_PERM_SEED) sh._try_fill_config(config, 'bxcan_ldblock_perm_nrepeat', default_params.BXCAN_LDBLOCK_PERM_NREPEAT) if config['model_type'] is 'elastic_net' and config['bxcan_ldblock_perm'] is not None: print('WARNING: since model_type = elastic_net, we disable LD block based permutation calculation in BrainXcan. Shut down this check by setting bxcan_ldblock_perm_elastic_net=true') config['bxcan_ldblock_perm'] = None
def fill_empz(config): sh._try_fill_config(config, 'bxcan_empirical_z', default_params.BXCAN_EMPIRICAL_Z) sh._try_fill_config(config, 'bxcan_empirical_z_seed', default_params.BXCAN_EMPIRICAL_Z_SEED) sh._try_fill_config(config, 'bxcan_empirical_z_nrepeat', default_params.BXCAN_EMPIRICAL_Z_NREPEAT) if config['model_type'] is 'elastic_net' and config['bxcan_empirical_z'] is True: print('WARNING: since model_type = elastic_net, we disable empirical z-score calculation in BrainXcan') config['bxcan_empirical_z'] = False
def fill_gwas_idp(config): sh._try_fill_config(config, 'idp_gwas_pattern', default_params.IDP_GWAS_PATTERN) sh._check_desired_wildcards( config['idp_gwas_pattern'], [ '{chr_num}', '{idp_code}', '{idp_modality}' ] ) param = sh._try_to_format( config['idp_gwas_pattern'], OrderedDict([ ('datadir', config['datadir']), ('idp_type', config['idp_type']), ('chr_num', '[chr_num]') ]) ) files = sh._try_format_for_list( config['geno_cov_pattern'], OrderedDict([ ('datadir', config['datadir']), ('idp_type', config['idp_type']) ]), default_params.CHRS, 'chr_num' ) return param, files
def fill_patterns(config): sh._try_fill_config(config, 'geno_cov_pattern', default_params.GENO_COV_PATTERN) sh._try_fill_config(config, 'idp_weights_pattern', default_params.IDP_WEIGHTS_PATTERN) sh._try_fill_config(config, 'idp_weights_cols', default_params.IDP_WEIGHTS_COLS) sh._check_desired_wildcards( config['geno_cov_pattern'], [ '{chr_num}' ] ) sh._check_desired_wildcards( config['idp_weights_pattern'], [ '{idp_modality}' ] ) sh._check_list_all_in( list(default_params.IDP_WEIGHTS_COLS.keys()), config['idp_weights_cols'] ) config['idp_weights_pattern'] = sh._try_to_format( config['idp_weights_pattern'], OrderedDict([ ('datadir', config['datadir']), ('idp_type', config['idp_type']), ('model_type', config['model_type']) ]) )
def fill_bxcan_region_vis(config): sh._try_fill_config(config, 'bxcan_region_vis', default_params.BXCAN_REGION_VIS) if config['bxcan_region_vis'] is True: return '--region_vis' else: return ''
def fill_spearman_cutoff(config): sh._try_fill_config(config, 'spearman_cutoff', default_params.SPEARMAN_CUTOFF) return config['spearman_cutoff']
def fill_exe(config): sh._try_fill_config(config, 'python_exe', default_params.PYTHON_EXE) sh._try_fill_config(config, 'rscript_exe', default_params.RSCRIPT_EXE) sh._try_fill_config(config, 'plink_exe', default_params.PLINK_EXE)
def fill_model_type(config): sh._try_fill_config( config, 'model_type', default_params.MODEL_TYPE[0], default_params.MODEL_TYPE[1] )
def fill_idp_type(config): sh._try_fill_config( config, 'idp_type', default_params.IDP_TYPE[0], default_params.IDP_TYPE[1] )