python/methylnet/model_interpretability.py
def extract_methylation_array(shapley_data, classes_only, output_dir, test_pkl, col, global_vals, n_extract):
    """Subset and write methylation array using top SHAP cpgs."""
    os.makedirs(output_dir,exist_ok=True)
    shapley_data=ShapleyData.from_pickle(shapley_data)
    shapley_data_explorer=ShapleyDataExplorer(shapley_data)
    output_methyl_arr = shapley_data_explorer.extract_methylation_array(MethylationArray.from_pickle(test_pkl),classes_only,global_vals=global_vals,n_extract=n_extract)
    output_methyl_arr.write_pickle(os.path.join(output_dir,'extracted_methyl_arr.pkl'))
    if col:
        output_methyl_arr.beta[col] = output_methyl_arr.pheno[col]
    output_methyl_arr.write_csvs(output_dir)
Subset and write methylation array using top SHAP cpgs.
Subset and write methylation array using top SHAP cpgs.
Subset and write methylation array using top SHAP cpgs .
def extract_methylation_array(shapley_data, classes_only, output_dir, test_pkl, col, global_vals, n_extract):
    os.makedirs(output_dir,exist_ok=True)
    shapley_data=ShapleyData.from_pickle(shapley_data)
    shapley_data_explorer=ShapleyDataExplorer(shapley_data)
    output_methyl_arr = shapley_data_explorer.extract_methylation_array(MethylationArray.from_pickle(test_pkl),classes_only,global_vals=global_vals,n_extract=n_extract)
    output_methyl_arr.write_pickle(os.path.join(output_dir,'extracted_methyl_arr.pkl'))
    if col:
        output_methyl_arr.beta[col] = output_methyl_arr.pheno[col]
    output_methyl_arr.write_csvs(output_dir)
def extract_methylation_array ( shapley_data , classes_only , output_dir , test_pkl , col , global_vals , n_extract ) : os . makedirs ( output_dir , exist_ok = True ) shapley_data = ShapleyData . from_pickle ( shapley_data ) shapley_data_explorer = ShapleyDataExplorer ( shapley_data ) output_methyl_arr = shapley_data_explorer . extract_methylation_array ( MethylationArray . from_pickle ( test_pkl ) , classes_only , global_vals = global_vals , n_extract = n_extract ) output_methyl_arr . write_pickle ( os . path . join ( output_dir , 'extracted_methyl_arr.pkl' ) ) if col : output_methyl_arr . beta [ col ] = output_methyl_arr . pheno [ col ] output_methyl_arr . write_csvs ( output_dir )
Subset and write methylation array using top SHAP cpgs.
Subset and write methylation array using top SHAP cpgs .
"""Subset and write methylation array using top SHAP cpgs."""
shapley_data
classes_only
output_dir
test_pkl
col
global_vals
n_extract