For the complete documentation index, see llms.txt. This page is also available as Markdown.

Correlation matrix

Measure pairwise associations between genes, proteins, or signatures using Pearson or Spearman correlation, summarized in a correlation matrix.

Measure pairwise associations between genes, proteins, or signatures using Pearson or Spearman correlation, summarized in a correlation matrix.

Pairwise correlation matrix

Description

Analysis summary

Measures how strongly pairs of features — genes, proteins, signatures — move together across a cohort: every pair's correlation coefficient is computed over the per-sample values, yielding a symmetric coefficient matrix.

Computation

Values are log-transformed by default, then every pair of features is correlated across samples: Pearson's r by default, or Spearman's rank correlation when the relationship may be monotonic but not linear. The result is a symmetric matrix of coefficients ranging from −1 (perfect negative association) through 0 (no association) to +1 (perfect positive), with 1 on the diagonal. Each pair also carries a two-sided p-value for the correlation being zero, returned with the results.

When to use

Use when the user asks for correlation coefficients or a pairwise correlation matrix between named features. For binary co-occurrence — Jaccard-index overlap or the percentage of cells co-expressing two markers — use coexpression_analysis instead.

Caveats

Correlation captures linear (Pearson) or monotonic (Spearman) association, not causation, and a handful of samples can make it unstable. Each pair's p-value is uncorrected for the many pairs tested, so large panels produce small p-values by chance. Samples missing any feature's value are dropped before correlating, so the effective cohort is the intersection across the whole panel.

Example questions

example questions
  • Pairwise correlation of multiple gene bulk expression

Input columns

input columns
column
type
required
description

index

any

required

Sample/cell/patient identifier — used to align entity vectors.

value

numeric

required

Measured quantity to correlate across entities.

x_group

categorical

required

Entity name (e.g. gene, protein) — each unique value becomes one axis.

patient_id

categorical

required

Patient identifier required for population summary statistics.

Visualizations

  • heatmap How to read: Each cell colours the correlation between one feature (row) and another (column): red means they rise and fall together, blue means one tends to fall as the other rises, and the neutral middle colour means no association — on a fixed scale from -1 to +1. The matrix is symmetric (a cell and its mirror are the same pair) and the diagonal is always 1. A row of strong colour marks a feature that co-varies with many others. Hovering a cell shows the exact coefficient; the accompanying table adds each pair's p-value. Colour measures association, not level: two strongly red features can sit at very different absolute values.

Example analysis 1

Name — Pearson Correlation between ERBB2 and TP53 in TCGA Bladder Patients (Age > 40)

Analysis parameters

analysis_name, analysis_params, viz_params

Visualization — heatmap

Pearson Correlation between ERBB2 and TP53 in TCGA Bladder Patients (Age > 40)

Output table

descriptive_stats (1 rows)
x_group_a
x_group_b
correlation
p_value
test

ERBB2

TP53

0.1079

0.02513

t-test

statistical_tests (1 rows)
x_group_a
x_group_b
correlation
p_value
test

ERBB2

TP53

0.1079

0.02513

t-test

Last updated

Was this helpful?