bioneuralnet.metrics.plot
Functions
|
Compute the Pearson correlation coefficient between PC1 of a cluster and phenotype. |
|
Compare clusters from two methods by computing the correlation for each induced subnetwork. |
|
Retrieves a global logger configured to write to 'bioneuralnet.log' at the project root. |
|
Plot the embeddings in 2D space using t-SNE. |
|
Plots a network graph from an adjacency matrix with improved visualization. |
|
Clean and minimal bar plot comparing raw vs embeddings-based performance. |
|
Bar plot comparing performance for raw omics, GNN-enriched omics, and one other method. |
Plot the variance for each feature against its index or name. |
|
|
Compute the variance for each feature (column) in the DataFrame and plot a histogram of these variances. |
- bioneuralnet.metrics.plot.compare_clusters(louvain_clusters: list, smccnet_clusters: list, pheno: DataFrame, omics_merged: DataFrame, label1: str = 'Louvain', label2: str = 'SmCCNet')[source]
Compare clusters from two methods by computing the correlation for each induced subnetwork. Both inputs are expected to be lists of pandas DataFrames. If the lists have different lengths, only the first min(n, m) clusters are compared.
- Parameters:
louvain_clusters – list of pd.DataFrame Each DataFrame represents an induced subnetwork (from Louvain).
smccnet_clusters – list of pd.DataFrame Each DataFrame represents an induced subnetwork (from SMCCNET).
pheno – pd.DataFrame Phenotype data (the first column is used).
omics_merged – pd.DataFrame Full omics data
label1 – str Label for the first method.
label2 – str Label for the second method.
- Returns:
Results table with cluster indices, sizes, and correlations
- Return type:
pd.DataFrame
- bioneuralnet.metrics.plot.plot_embeddings(embeddings, node_labels=None)[source]
Plot the embeddings in 2D space using t-SNE.
- Parameters:
embeddings (array-like) – High-dimensional embedding data.
node_labels (array-like or DataFrame, optional) – Labels for the nodes to color the points.
- bioneuralnet.metrics.plot.plot_network(adjacency_matrix, weight_threshold=0.0, show_labels=False, show_edge_weights=False)[source]
Plots a network graph from an adjacency matrix with improved visualization. Also adds a summary table mapping node indexes to actual gene names.
- Parameters:
- Returns:
Mapping of node indexes to actual gene names.
- Return type:
pd.DataFrame
- bioneuralnet.metrics.plot.plot_performance(embedding_result, raw_rf_acc, title='Performance Comparison', filename=None)[source]
Clean and minimal bar plot comparing raw vs embeddings-based performance.
- bioneuralnet.metrics.plot.plot_performance_three(raw_score, gnn_score, other_score, labels=['Raw', 'GNN', 'Other'], title='Performance Comparison', filename=None)[source]
Bar plot comparing performance for raw omics, GNN-enriched omics, and one other method.
- bioneuralnet.metrics.plot.plot_variance_by_feature(df: DataFrame)[source]
Plot the variance for each feature against its index or name.
- Parameters:
df (pd.DataFrame) – Input data.
- Returns:
Generated figure.
- Return type:
- bioneuralnet.metrics.plot.plot_variance_distribution(df: DataFrame, bins: int = 50)[source]
Compute the variance for each feature (column) in the DataFrame and plot a histogram of these variances.
- Parameters:
df (pd.DataFrame) – Input data.
bins (int) – Number of bins for the histogram.
- Returns:
Generated figure.
- Return type: