Command Palette

Search for a command to run...

Назад к скиллам
скилл № 55536

bio-temporal-genomics-temporal-clustering

Clusters temporally variable genes by expression-profile SHAPE (not significance) using Mfuzz fuzzy c-means, TCseq, DEGreport degPatterns, and tslearn…

БесплатноЗапускает вложенные скрипты
lilinjiот lilinji★ 18 звёзд на GitHub

Установить bio-temporal-genomics-temporal-clustering в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Об этом скилле

Version Compatibility

Reference examples tested with: Mfuzz 2.64+, TCseq 1.14+, DEGreport 1.30+ (R/Bioconductor); tslearn 0.8+, scikit-learn 1.4+ (Python).

Before using code patterns, verify installed versions match. If versions differ:

  • Python: pip show tslearn scikit-learn then help(module.function) to check signatures
  • R: packageVersion('Mfuzz') then ?function_name to verify parameters

If code throws ImportError, AttributeError, or TypeError, introspect the installed package and adapt the example to match the actual API rather than retrying.

Temporal Gene Clustering

"Group my time-course genes by expression pattern shape" -> Partition PRE-SELECTED temporally variable genes into co-expression modules by trajectory shape (fuzzy c-means, hierarchical, or DTW), producing candidate temporal programs.

  • R: Mfuzz::mfuzz() (fuzzy/soft), TCseq::timeclust(), DEGreport::degPatterns()
  • Python: tslearn.clustering.TimeSeriesKMeans (Euclidean / DTW / soft-DTW)

Governing Principle - read before clustering anything

Clustering answers only "which genes share a temporal SHAPE." It is DESCRIPTIVE and UNSUPERVISED: it has no null model, no p-value, and no notion of a "true" cluster count, so it ALWAYS returns clusters from whatever it is handed. It is strictly DOWNSTREAM of gene selection.

  • It does NOT answer "which genes are rhythmic" (that is temporal-genomics/circadian-rhythms) and does NOT answer "is this gene significantly changing" (that is differential-expression/timeseries-de: LRT, spline-DE, maSigPro). Clustering adds description, not inference.
  • The input MUST already be the temporally variable genes - the output of timeseries-DE or, at minimum, a variance filter. Never the full expression matrix.
  • Feeding in flat/all genes is the #1 error. Per-gene z-scoring (mandatory, below) rescales a flat gene's pure noise to unit variance, so it lands in a "cluster" of noise that mimics a real program. Z-scoring erases the one signal (near-zero variance) that flagged the gene as flat, which is exactly why prefiltering is a gate, not optional hygiene.
  • Clusters are HYPOTHESES. A centroid is a candidate program; membership is not evidence a gene is regulated - that evidence came (or did not) from the upstream DE step.

If a user asks "cluster my RNA-seq time course," the first question is always: have these genes already been selected for temporal change, and how? If the answer is "no, it is all 20,000 genes," stop and prefilter.

Core Workflow

  1. Confirm the input is pre-selected temporally variable genes (DE hits or top-variance); if not, prefilter
  2. Standardize each gene's profile (z-score across timepoints) - mandatory
  3. Choose a distance metric (Euclidean-on-zscore / correlation / DTW), then an algorithm and k
  4. Assign genes to clusters (soft membership or hard labels); filter by membership if fuzzy
  5. Validate by stability (bootstrap/consensus), then interpret centroids and run per-cluster enrichment with the correct background

Soft vs Hard, and Why Standardization Is Mandatory

Soft (fuzzy) clustering is preferred for expression. Genes participate in multiple regulatory programs, so forcing one gene into one cluster (hard k-means) is biologically false at boundaries and brittle: a gene between two centroids flips clusters under trivial noise. Futschik & Carlisle (2005) established fuzzy c-means as noise-ROBUST for expression time courses - low-membership (ambiguous, likely-noise) genes are down-weighted in centroid estimation, so centroids track the high-confidence core of each program, and ambiguity is exposed as a continuous membership score to threshold rather than hidden inside a hard label.

Z-score per gene is mandatory (Mfuzz standardise(), TCseq standardize=TRUE, tslearn TimeSeriesScalerMeanVariance()). Without it, MAGNITUDE dominates SHAPE: a high-abundance housekeeping gene sits far (Euclidean) from a low-abundance gene of identical shape, while two high-abundance genes co-cluster on abundance alone. Clustering-by-shape requires removing each gene's mean and scaling to unit variance across timepoints.

Mfuzz (R/Bioconductor)

Goal: Group temporally variable genes into soft co-expression clusters by trajectory shape.

Approach: Build an ExpressionSet, gate out flat genes (filter.std), z-score (standardise), estimate then VALIDATE the fuzzifier, run fuzzy c-means, and filter genes by membership. Mfuzz wraps e1071::cmeans (it does not implement its own optimizer); distance is Euclidean on z-scored profiles.

Setup and Preprocessing

library(Mfuzz)
library(Biobase)

# Rows = genes (already selected as temporally variable), columns = timepoints (mean across replicates)
expr_mat <- as.matrix(read.csv('temporal_expression.csv', row.names = 1))
eset <- ExpressionSet(assayData = expr_mat)

# filter.std: flat-gene GATE (keeps the governing principle true). min.std=0.5 is a starting
# point; inspect the SD distribution and se
Полный SKILL.md на GitHub

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

  • examples/mfuzz_clustering.R
  • examples/tslearn_clustering.py
  • usage-guide.md

FAQ

Что делает скилл bio-temporal-genomics-temporal-clustering?

Clusters temporally variable genes by expression-profile SHAPE (not significance) using Mfuzz fuzzy c-means, TCseq, DEGreport degPatterns, and tslearn DTW/soft-DTW. Use when grouping pre-selected time-course genes into shared trajectory programs (co-expression modules), choosing between soft vs hard clustering, picking k, selecting a distance metric (Euclidean/correlation/DTW), or interpreting clusters with per-cluster enrichment. Requires temporally variable genes selected FIRST (differential-expression/timeseries-de or a variance filter); clustering is descriptive and downstream of selection, never a test of which genes are dynamic.

Как установить скилл bio-temporal-genomics-temporal-clustering?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл bio-temporal-genomics-temporal-clustering запускает скрипты?

Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.

Похожие скиллы

Сравнить bio-temporal-genomics-temporal-clustering с