agentsclimarketplace

Pearson correlation statistical testing

Skill HolobiomicsLab/asb-skill-collections/collections/metabolomics/v2/skills/pearson-correlation-statistical-testing

Curated, evidence-grounded skill and software-tool collections for scientific AI agents, generated by the AgenticScienceBuilder

Install
npx -y skills add HolobiomicsLab/asb-skill-collections --skill pearson-correlation-statistical-testing

Assembled 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 when you have two co-registered LA-ICP-MS element images and need to determine whether the spatial distribution of one element correlates significantly with another.

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

7.1 KB, ~1.2k tokens by cl100k_base, as published. Nobody here has run it

Pearson Correlation Statistical Testing

License: restricted — no clear open-source license detected for the underlying tool; verify licensing before commercial use or redistribution. <!-- asb-license-banner -->

Summary

Compute the Pearson R coefficient between two co-registered LA-ICP-MS element channels and assess its statistical significance by comparing the observed R value to a null distribution generated from random shuffles of one input channel. This quantifies spatial correlation between element distributions and provides a probability estimate (ρ) that the observed correlation arose by chance.

When to use

When you have two co-registered LA-ICP-MS element images and need to determine whether the spatial distribution of one element correlates significantly with another. Use this skill after image alignment and co-registration, particularly when interpreting whether observed spatial clustering of two elements is statistically meaningful or attributable to random chance.

When NOT to use

  • Input images are not co-registered or have misaligned spatial coordinates; alignment must be verified before correlation analysis.
  • One or both channels contain predominantly NaN or missing values in the region of interest, as this will bias the R and ρ estimates.
  • You are comparing more than two element channels; use alternative multivariate methods (e.g., principal component analysis) instead.

Inputs

  • Two co-registered LA-ICP-MS element channel images (numeric intensity arrays)
  • Image or selected region of interest (optional; defaults to entire image)

Outputs

  • Pearson R coefficient (real number, range −1 to +1)
  • Probability value ρ (p-value; real number, range 0 to 1)
  • Shuffled R distribution (array of R values from permutation tests)

How to apply

Load two co-registered element images (channels) into the Colocalisation Dialog via the image or selection context menu in pewpew. Compute the Pearson R coefficient over the entire image region or a user-defined region of interest. To assess statistical significance, calculate the probability (ρ) by comparing the observed R value to a distribution of R values obtained from random shuffles (permutations) of one of the input channels. Display and export the resulting R coefficient and ρ-value. Interpret R values close to +1 as strong positive correlation, close to −1 as strong negative correlation, and values near 0 as weak or no correlation. Use the ρ-value (e.g., ρ < 0.05) to reject the null hypothesis that the correlation is random.

Related tools

  • pewpew (GUI application providing the Colocalisation Dialog for computing Pearson R and managing co-registered LA-ICP-MS image pairs) — https://github.com/djdt/pewpew
  • pewlib (Python library underlying pewpew that implements LA-ICP-MS data import, image alignment, and correlation coefficient computation) — https://github.com/djdt/pewlib

Evaluation signals

  • Pearson R coefficient is in the valid range [−1, +1] and matches manual computation on the input arrays.
  • Probability value ρ is in the valid range [0, 1] and reflects the fraction of shuffled R values that equal or exceed the observed R in magnitude.
  • Shuffled R distribution is approximately symmetric around zero, indicating that the permutation test is unbiased under the null hypothesis of no correlation.
  • When applied to synthetic data with known correlation (e.g., identical channels), R approaches 1.0 and ρ approaches 0; when applied to independent random noise, R approaches 0 and ρ approaches 1.0.
  • Results exported from the dialog via copy-to-clipboard or context menu match the displayed R and ρ values with full precision.

Limitations

  • Pearson R assumes linear relationships; nonlinear spatial associations between channels may be missed or underestimated.
  • The permutation-based ρ-value is computationally expensive for large images and may require significant runtime or memory; the number of shuffles influences precision of the p-value estimate.
  • Spatial autocorrelation within each channel can inflate the significance of apparent correlations; the method does not account for non-independence of neighboring pixels.
  • The presence of outliers or extreme intensity values in either channel can substantially affect R; no robust correlation variant (e.g., Spearman rank) is described in the workflow.

Evidence

  • [other] Compute Pearson R coefficient over the entire image region and optionally calculate its probability (ρ) by comparing the R value to those of random shuffles of the input.: "Compute Pearson R coefficient over the entire image region and optionally calculate its probability (ρ) by comparing the R value to those of random shuffles of the input."
  • [other] The Colocalisation Dialog computes Pearson R, Li ICQ, and Manders coefficients (via Costes thresholding method) to quantify spatial relationships between two element channels in co-registered images.: "The Colocalisation Dialog computes Pearson R, Li ICQ, and Manders coefficients (via Costes thresholding method) to quantify spatial relationships between two element channels in co-registered images."
  • [other] Load two co-registered element images (channels) into the Colocalisation Dialog via image or selection context menu.: "Load two co-registered element images (channels) into the Colocalisation Dialog via image or selection context menu."
  • [readme] Pew² is a GUI for importing and processing line-by-line, spot-wise and ablation-time-aligned LA-ICP-MS data using the python library pewlib.: "Pew² is a GUI for importing and processing line-by-line, spot-wise and ablation-time-aligned LA-ICP-MS data using the python library pewlib."

What ships with it

Read from the repository

Just SKILL.md. No reference files, no scripts.

Keep looking

Skills are one crate of 326,984. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.