python/methylnet/model_interpretability.py
def view_methylation_top_cpgs(shapley_data,individuals, output_dir, test_pkl):
    """Write the Top CpGs for each class/individuals to file along with methylation information."""
    os.makedirs(output_dir,exist_ok=True)
    shapley_data=ShapleyData.from_pickle(shapley_data)
    shapley_data_explorer=ShapleyDataExplorer(shapley_data)
    test_methyl_array=MethylationArray.from_pickle(test_pkl)
    for individual in individuals:
        class_name,individual,shap_df=shapley_data_explorer.view_methylation(individual=individual,methyl_arr=test_methyl_array)
        shap_df.to_csv(join(output_dir,"{}_{}.csv".format(class_name,individual)))
Write the Top CpGs for each class/individuals to file along with methylation information.
Write the Top CpGs for each class/individuals to file along with methylation information.
Write the Top CpGs for each class / individuals to file along with methylation information .
def view_methylation_top_cpgs(shapley_data,individuals, output_dir, test_pkl):
    os.makedirs(output_dir,exist_ok=True)
    shapley_data=ShapleyData.from_pickle(shapley_data)
    shapley_data_explorer=ShapleyDataExplorer(shapley_data)
    test_methyl_array=MethylationArray.from_pickle(test_pkl)
    for individual in individuals:
        class_name,individual,shap_df=shapley_data_explorer.view_methylation(individual=individual,methyl_arr=test_methyl_array)
        shap_df.to_csv(join(output_dir,"{}_{}.csv".format(class_name,individual)))
def view_methylation_top_cpgs ( shapley_data , individuals , output_dir , test_pkl ) : os . makedirs ( output_dir , exist_ok = True ) shapley_data = ShapleyData . from_pickle ( shapley_data ) shapley_data_explorer = ShapleyDataExplorer ( shapley_data ) test_methyl_array = MethylationArray . from_pickle ( test_pkl ) for individual in individuals : class_name , individual , shap_df = shapley_data_explorer . view_methylation ( individual = individual , methyl_arr = test_methyl_array ) shap_df . to_csv ( join ( output_dir , "{}_{}.csv" . format ( class_name , individual ) ) )
Write the Top CpGs for each class/individuals to file along with methylation information.
Write the Top CpGs for each class / individuals to file along with methylation information .
"""Write the Top CpGs for each class/individuals to file along with methylation information."""
shapley_data
individuals
output_dir
test_pkl