bioneuralnet.clustering.correlated_louvain
Functions
|
Compute the partition of the graph nodes which maximises the modularity (or try..) using the Louvain heuristices |
|
Retrieves a global logger configured to write to 'bioneuralnet.log' at the project root. |
|
Compute the modularity of a partition of a graph |
|
Pearson correlation coefficient and p-value for testing non-correlation. |
Classes
|
alias of |
|
Command-line reporter |
|
CorrelatedLouvain Class for Community Detection with Correlated Omics Data. |
- class bioneuralnet.clustering.correlated_louvain.CorrelatedLouvain(G: Graph, B: DataFrame, Y=None, k3: float = 0.2, k4: float = 0.8, weight: str = 'weight', tune: bool = False, gpu: bool = False, seed: int | None = None)[source]
Bases:
objectCorrelatedLouvain Class for Community Detection with Correlated Omics Data. .. attribute:: G
NetworkX graph object.
- type:
nx.Graph
- B
Omics data.
- Type:
pd.DataFrame
- Y
Phenotype data.
- Type:
pd.DataFrame
- partition_to_adjacency(partition: dict) → list[source]
Convert the partition dictionary into a list of adjacency matrices (DataFrames), where each adjacency matrix represents a cluster with more than 2 nodes.
- run(as_dfs: bool = False) → dict | list[source]
Run correlated Louvain clustering.
If as_dfs is True, returns a list of adjacency matrices (DataFrames), where each adjacency matrix represents a cluster with more than 2 nodes. Otherwise, returns the partition dictionary.
If tune is True and as_dfs is False, hyperparameter tuning is performed and the best parameters are returned. If tune is True and as_dfs is True, tuning is performed, and then standard detection is run using the tuned parameters.