bioneuralnet.metrics.correlation

Functions

cluster_correlation(louvain_cluster)

Builds a new correlation network from an extracted cluster/subnetwork.

cluster_pca_correlation(cluster_df, pheno)

Computes the Pearson correlation coefficient between PC1 of a cluster and phenotype.

get_logger(name)

Retrieves a global logger configured to write to 'bioneuralnet.log'.

omics_correlation(omics, pheno)

Computes the Pearson correlation between the first principal component of omics data and a phenotype.

pearsonr(x, y, *[, alternative, method, axis])

Pearson correlation coefficient and p-value for testing non-correlation.

Classes

PCA([n_components, copy, whiten, ...])

Principal component analysis (PCA).

StandardScaler(*[, copy, with_mean, with_std])

Standardize features by removing the mean and scaling to unit variance.

bioneuralnet.metrics.correlation.cluster_correlation(louvain_cluster: DataFrame) DataFrame[source]

Builds a new correlation network from an extracted cluster/subnetwork.

This function is often used as an intermediate step between HybridLouvain and plotting. It allows the subnetwork to reveal its internal topological structure by computing the Pearson correlation of node connectivity profiles.

Parameters:

louvain_cluster (pd.DataFrame) – Represents an induced subnetwork.

Returns:

Adjacency matrix.

Return type:

pd.DataFrame

bioneuralnet.metrics.correlation.cluster_pca_correlation(cluster_df: DataFrame, pheno: DataFrame) tuple[source]

Computes the Pearson correlation coefficient between PC1 of a cluster and phenotype.

Parameters:
  • cluster_df (pd.DataFrame) – DataFrame representing a cluster of samples.

  • pheno (pd.DataFrame) – DataFrame representing the phenotype.

Returns:

(cluster_size, correlation) or (size, None) if correlation fails.

Return type:

tuple

bioneuralnet.metrics.correlation.omics_correlation(omics: DataFrame, pheno: DataFrame) Tuple[float, float][source]

Computes the Pearson correlation between the first principal component of omics data and a phenotype.

Parameters:
  • omics (pd.DataFrame) – Omics data with rows as samples and columns as features.

  • pheno (pd.DataFrame) – Phenotype data. Expected to have a single column.

Returns:

Pearson correlation coefficient and p-value.

Return type:

Tuple[float, float]