Correlation threshold optimization
Curated, evidence-grounded skill and software-tool collections for scientific AI agents, generated by the AgenticScienceBuilder
npx -y skills add HolobiomicsLab/asb-skill-collections --skill correlation-threshold-optimizationAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 14 stars14 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its author says it does
Copied from the file, not written here
Use when after computing pairwise correlations across all features in a dataset (especially those exceeding 10,000 features), before constructing the final network object.
The file declares its own license as CC-BY-4.0. That is the author’s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.
SKILL.md
8.1 KB, ~1.3k tokens by cl100k_base, as published. Nobody here has run it
correlation-threshold-optimization
License: restricted — no clear open-source license detected for the underlying tool; verify licensing before commercial use or redistribution. <!-- asb-license-banner -->
Summary
Select and apply correlation coefficient thresholds to filter network edges from high-dimensional feature abundance tables, retaining only statistically or biologically significant correlations. This step bridges pairwise correlation computation and final network construction, controlling sparsity, interpretability, and computational load.
When to use
After computing pairwise correlations across all features in a dataset (especially those exceeding 10,000 features), before constructing the final network object. Use this skill when you need to decide which correlations to retain as edges—typically when the full correlation matrix would produce a dense, difficult-to-interpret network, or when domain knowledge or statistical criteria suggest a meaningful cutoff exists.
When NOT to use
- Your correlation matrix is already sparse or you have already applied a threshold upstream
- You require the full, unfiltered correlation structure for downstream statistical tests (e.g., partial correlation or network stability analysis) that depend on the complete correlation landscape
- Your dataset contains fewer than ~100 features, where correlation-based filtering may remove important low-magnitude but biologically meaningful edges
Inputs
- pairwise correlation matrix (symmetric numeric matrix with p-values)
- feature abundance table (rows = features, columns = samples; >10,000 features supported)
Outputs
- thresholded correlation matrix (sparse numeric matrix)
- igraph network object with features as nodes and filtered correlations as weighted edges
How to apply
After computing pairwise correlations (including p-values) on your feature abundance table using MetaNet's correlation engine, apply correlation thresholding to remove weak or non-significant edges. The threshold can be determined by user specification (e.g., r > 0.65 for absolute correlation magnitude) or by statistical criteria (e.g., p-value adjustment). Pass the thresholded correlation matrix to c_net_build(), which constructs an igraph network object where features become nodes and correlations above the threshold become weighted edges. Verify the result by checking that node counts match retained features, edge counts reflect the sparsity you expect, correlation values fall within the expected range, and the igraph object has valid structure.
Related tools
- MetaNet (Implements optimized correlation computation and threshold-based edge filtering via c_net_build(); vectorized matrix algorithms reduce memory and runtime for >10,000 features) — https://github.com/Asa12138/MetaNet
- igraph (Core graph representation and manipulation library; MetaNet constructs igraph objects from thresholded correlation matrices to enable downstream topology analysis and visualization)
- pcutils (Companion R package for data manipulation and utilities; supports preprocessing of abundance tables before correlation computation) — https://github.com/Asa12138/pcutils
Examples
cor <- c_net_calculate(totu); net <- c_net_build(cor, r_threshold = 0.65)
Evaluation signals
- Thresholded correlation matrix contains only correlation coefficients meeting the specified threshold criterion (e.g., |r| ≥ 0.65); all below-threshold entries are zero or NA
- Node count in the igraph object equals the number of retained features (should match input table dimensions)
- Edge count reflects expected network density given the threshold; sparse networks are interpretable (typically 1,000–10,000 edges for omics data)
- Correlation value ranges in the igraph object span the threshold to 1.0 (or −1.0 to 1.0 if bidirectional); no out-of-range values
- igraph object passes structural validation (is.igraph() returns TRUE; E(net) and V(net) are non-empty and properly indexed)
Limitations
- Threshold selection is subjective; no universal guideline exists for all omics domains. Over-thresholding removes biologically relevant edges; under-thresholding retains noise and obscures interpretation.
- Correlation-based networks do not distinguish causality or direct interactions; high correlations may reflect shared confounders or indirect associations.
- Fixed thresholds may be too stringent or permissive depending on the scale and variance structure of the input features. Multiple thresholds may need testing (e.g., sensitivity analysis).
- P-value adjustment (e.g., FDR correction) before thresholding is not automatic; researchers must decide whether and how to adjust for multiple comparisons to avoid spurious edges.
Evidence
- [other] Apply correlation thresholding to retain only significant edges (specific threshold determined by user or statistical criteria): "Apply correlation thresholding to retain only significant edges (specific threshold determined by user or statistical criteria)."
- [other] MetaNet implements a correlation-based network construction module that operates on datasets with more than 10,000 features: "MetaNet implements a correlation-based network construction module that operates on datasets with more than 10,000 features, enabling fast and scalable network building from feature abundance tables."
- [intro] MetaNet enables fast and scalable correlation-based network construction for datasets with more than 10,000 features: "MetaNet enables fast and scalable correlation-based network construction for datasets with more than 10,000 features"
- [other] Construct an igraph network object from the thresholded correlation matrix, with features as nodes and correlations as weighted edges: "Construct an igraph network object from the thresholded correlation matrix, with features as nodes and correlations as weighted edges."
- [other] Validate network construction by checking node and edge counts, correlation value ranges, and igraph object integrity: "Validate network construction by checking node and edge counts, correlation value ranges, and igraph object integrity."
- [readme] optimized vectorized matrix algorithms for calculating correlation coefficients and corresponding p-values, greatly reducing memory use and runtime: "optimized vectorized matrix algorithms for calculating correlation coefficients and corresponding p-values, greatly reducing memory use and runtime"
- [readme] simply build and draw a co-occurrence network plot, only need to use c_net_calculate(), c_net_build(), c_net_plot() three functions: "simply build and draw a co-occurrence network plot, only need to use c_net_calculate(), c_net_build(), c_net_plot() three functions"
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.