Compute Correlation Between Two Sparse Graphs
Source:R/task_graph_construction.R
compute_graph_correlation.Rd
Calculates the Spearman correlation between the edge weights of two sparse graphs, considering the union of their non-zero edges and filling missing edges with 0. Only the upper triangle of the matrices is considered.
Arguments
- W_graph1
A sparse, symmetric matrix (`Matrix::dgCMatrix`, `V_p x V_p`). Assumed to have z-scored non-zero entries.
- W_graph2
A sparse, symmetric matrix (`Matrix::dgCMatrix`, `V_p x V_p`). Assumed to have z-scored non-zero entries.
- max_edges
An integer or `Inf`. If the number of unique edges in the union of the upper triangles exceeds `max_edges`, a random sample of `max_edges` edges will be used for the correlation calculation. Defaults to 2,000,000.