Skip to content

Clustering — Dose-Response / Time-Series Patterns

In the app: Expression › Clustering

Clustering groups genes by the shape of their expression across samples, using K-means on per-gene z-scores. Instead of asking "which genes changed?", it asks "which genes change together?" — for example, genes that rise steadily with dose, peak early, or respond only late.

Clustering — example output

Example output from the sample project.

Findings

  • When more genes are available than Max genes, a note such as "145991 genes found — clustering top 500 by variance."
  • Which expression data was used: VST values as delivered, with no extra log transform; or, when the project has no VST matrix, normalised counts transformed with log2(count + 1).
  • How many genes went into how many clusters, the size of each cluster, and the largest cluster.

Filters

Number of clusters (K)

2 to 15, default 4. The number of K-means clusters.

Max genes

50 to 2,000 in steps of 50, default 500. Only this many of the most variable genes are clustered; more is more complete but slower.

Clustered heatmap

Titled Clustered Gene Expression (Z-score, K=k, VST): genes (y-axis Gene) grouped by cluster against samples (x-axis Sample), coloured by z-score.

Mean Expression Profile per Cluster

One line per cluster (legend Cluster k (n genes)) through the sample groups (x-axis Condition), showing the cluster's mean z-score (y-axis Mean Z-score) with a ± 1 SD ribbon. This is where you read each cluster's response shape.

Elbow plot (K selection aid)

A collapsed expander under the graphs. Elbow Plot — Inertia vs. K plots the within-cluster sum of squares (Inertia) for every K from 2 to 15, with a dashed line at the K you chose. A K past which inertia stops falling steeply — the "elbow" — is a reasonable choice.

Raw data

Raw data — Cluster membership — open by default, with each cluster's size in a caption.

Column Meaning
gene_id The gene's identifier
gene_name Gene description, where known
cluster Cluster number (0 to K − 1)

Download CSV saves every gene's cluster, ready for enrichment of one cluster at a time.

Report settings that apply

Filter by gene ID and Filter by gene desc restrict clustering to those genes. The contrast and thresholds do not change it. See Report Settings.

Reading it

Cluster numbers are arbitrary labels — cluster 0 is not "first" in any sense, and the numbering can change when K or Max genes changes. Check the elbow plot before settling on K, and look at the profile plot rather than the heatmap to name a cluster's pattern. For the trajectories of individual genes, use Gene Trend.