python/methylnet/model_interpretability.py
def plot_top_cpgs(shapley_data,output_dir,individuals,classes):
    """Plot the top cpgs locations in the genome using circos."""
    os.makedirs(output_dir,exist_ok=True)
    shapley_data=ShapleyData.from_pickle(shapley_data)
    shapley_data_explorer=ShapleyDataExplorer(shapley_data)
    individuals=list(filter(None,individuals))
    classes=list(filter(None,classes))
    if classes and classes[0]=='all':
        classes = shapley_data_explorer.list_classes()
    if individuals and individuals[0]=='all':
        individuals = shapley_data_explorer.list_individuals(return_list=True)
    cpg_exclusion_sets,cpg_sets=None,None
    set_subtraction,intersection=False,False
    if set_subtraction:
        _,cpg_exclusion_sets=shapley_data_explorer.return_cpg_sets()
    elif intersection:
        cpg_sets,_=shapley_data_explorer.return_cpg_sets()
    top_cpgs=shapley_data_explorer.return_top_cpgs(classes=classes,individuals=individuals,cpg_exclusion_sets=cpg_exclusion_sets,cpg_sets=cpg_sets)
    circos_plotter=PlotCircos()
    circos_plotter.plot_cpgs(top_cpgs,output_dir)
Plot the top cpgs locations in the genome using circos.
Plot the top cpgs locations in the genome using circos.
Plot the top cpgs locations in the genome using circos .
def plot_top_cpgs(shapley_data,output_dir,individuals,classes):
    os.makedirs(output_dir,exist_ok=True)
    shapley_data=ShapleyData.from_pickle(shapley_data)
    shapley_data_explorer=ShapleyDataExplorer(shapley_data)
    individuals=list(filter(None,individuals))
    classes=list(filter(None,classes))
    if classes and classes[0]=='all':
        classes = shapley_data_explorer.list_classes()
    if individuals and individuals[0]=='all':
        individuals = shapley_data_explorer.list_individuals(return_list=True)
    cpg_exclusion_sets,cpg_sets=None,None
    set_subtraction,intersection=False,False
    if set_subtraction:
        _,cpg_exclusion_sets=shapley_data_explorer.return_cpg_sets()
    elif intersection:
        cpg_sets,_=shapley_data_explorer.return_cpg_sets()
    top_cpgs=shapley_data_explorer.return_top_cpgs(classes=classes,individuals=individuals,cpg_exclusion_sets=cpg_exclusion_sets,cpg_sets=cpg_sets)
    circos_plotter=PlotCircos()
    circos_plotter.plot_cpgs(top_cpgs,output_dir)
def plot_top_cpgs ( shapley_data , output_dir , individuals , classes ) : os . makedirs ( output_dir , exist_ok = True ) shapley_data = ShapleyData . from_pickle ( shapley_data ) shapley_data_explorer = ShapleyDataExplorer ( shapley_data ) individuals = list ( filter ( None , individuals ) ) classes = list ( filter ( None , classes ) ) if classes and classes [ 0 ] == 'all' : classes = shapley_data_explorer . list_classes ( ) if individuals and individuals [ 0 ] == 'all' : individuals = shapley_data_explorer . list_individuals ( return_list = True ) cpg_exclusion_sets , cpg_sets = None , None set_subtraction , intersection = False , False if set_subtraction : _ , cpg_exclusion_sets = shapley_data_explorer . return_cpg_sets ( ) elif intersection : cpg_sets , _ = shapley_data_explorer . return_cpg_sets ( ) top_cpgs = shapley_data_explorer . return_top_cpgs ( classes = classes , individuals = individuals , cpg_exclusion_sets = cpg_exclusion_sets , cpg_sets = cpg_sets ) circos_plotter = PlotCircos ( ) circos_plotter . plot_cpgs ( top_cpgs , output_dir )
Plot the top cpgs locations in the genome using circos.
Plot the top cpgs locations in the genome using circos .
"""Plot the top cpgs locations in the genome using circos."""
shapley_data
output_dir
individuals
classes