HoloNet.plotting.lr_rank_in_mgc#

HoloNet.plotting.lr_rank_in_mgc(trained_MGC_model_list, lr_df, repeat_filter_num=0, repeat_attention_scale=True, plot_lr_num=15, fname=None, display=True, plot_cluster=True, cluster_col='cluster')#

Analyze the MGC attention value corresponding to each LR pair, and plot the LR pairs serving as the core mediators of FCEs.

Parameters
trained_MGC_model_list List[MGC_Model]

A list of trained MGC model for generating the expression of one target gene.

lr_df DataFrame

The used preprocessed LR-gene dataframe, must contain the ‘LR_pair’ column.

repeat_filter_num int (default: 0)

The number of repetitions to be filtered out. If the attention obtained from a certain training has too low variance, delete the training result. If 0, not filter any training.

repeat_attention_scale bool (default: True)

If True, scale the attention of each training to 0-1.

plot_lr_num int (default: 15)

The number of LR pair displayed in the output figure.

fname str | Path | NoneUnion[str, Path, None] (default: None)

The output file name. If None, not save the figure.

display bool (default: True)

If False, not plot the figure.

plot_cluster bool (default: True)

If True, plot the cluster information of LR pairs as the color bar of heatmap.

cluster_col str (default: 'cluster')

The columns in lr_df dataframe storing the clustering results of each LR pair, which is necessary if plot_cluster == True.

Return type

DataFrame

Returns

: lr_df added column ‘MGC_layer_attention’, which contains the attention value of each LR pair.