bio-copy-number-recurrent-cnv
Identify recurrent and driver copy number alterations across a tumor cohort with GISTIC2 (G-score, Ziggurat deconstruction, focal vs broad/arm-level analysis, q-values from permutation) and quantify copy-number signatures with the Steele 2022 COSMIC framework and the Drews 2022 CINSignatures framework. Covers driver-gene localization from recurrence peaks, distinguishing focal drivers from arm-level passengers, and the caller-sensitivity caveats of copy-number signatures. Use when finding recurrently amplified or deleted regions in a cohort, localizing driver genes, separating focal from broad events, running GISTIC2, or extracting copy-number mutational signatures.
What this skill does
## Version Compatibility
Reference examples tested with: GISTIC 2.0.23, R 4.3+ with CINSignatureQuantification 1.2+; Python 3.10+ with SigProfilerAssignment 0.1+ (optional, COSMIC CN signatures).
Before using code patterns, verify installed versions match. If versions differ:
- CLI: `gistic2 --help` (GISTIC 2.0 is a MATLAB-compiled binary; needs the MCR runtime)
- R: `packageVersion('CINSignatureQuantification')`
- Python: `pip show SigProfilerAssignment`
GISTIC 2.0 has had no substantive release since ~2017; it is effectively frozen. It runs as a compiled binary against the MATLAB Compiler Runtime — there is no R or Python package. Verify the reference (`-refgene`) `.mat` file matches the genome build.
# Recurrent and Driver Copy Number Alteration
**"Which copy number changes recur across my cohort, and which gene is the driver"** -> A CNV in one tumor is an observation; a CNV recurring across many tumors beyond chance is evidence of selection. GISTIC2 separates recurrent driver events from passengers by modeling a background rate and scoring each locus by how often, and how strongly, it is altered. Copy-number signatures decompose the genome-wide pattern of alterations into the mutational processes that generated them.
- CLI: `gistic2` — cohort-level recurrence, focal vs broad, driver localization
- R: `CINSignatureQuantification` (Drews 2022); Python `SigProfilerAssignment` (Steele 2022 COSMIC)
## How GISTIC2 Works — and Its Limits
GISTIC2 scores each genomic marker with a **G-score** = frequency of alteration x mean amplitude, separately for amplifications and deletions. Significance (**q-value**) comes from permuting events along the genome under the null that all are passengers. **Ziggurat deconstruction** decomposes each sample's profile into the additive arm-level and focal events that produced it, so the background rate is estimated separately for broad and focal alterations — without this, ubiquitous arm-level events swamp the focal signal. A **peel-off** procedure removes the contribution of each significant peak before testing the next, so one strong driver does not mask its neighbors.
Two postdoc-level caveats define how GISTIC2 output must be read:
1. **q-values are cohort-size dependent.** Larger N manufactures more "significant" peaks. A peak list from N=50 and one from N=500 are not comparable; recurrence *frequency* is the portable quantity, not the q-value.
2. **GISTIC2 is only as good as its input segmentation.** Oversegmented seg files produce spurious narrow peaks. The seg file must also be correctly **centered** on diploid — a mis-centered profile (WGD genome centered on tetraploid) inverts every call before GISTIC even runs.
## Decision Tree
| Goal | Approach | Notes |
|------|----------|-------|
| Find recurrent focal drivers in a cohort | GISTIC2, focal analysis, peak regions | Driver = recurrence-peak gene with a known role |
| Quantify arm-level / broad events | GISTIC2 `-broad 1`, arm-level output | `-brlen` sets the focal/broad length cutoff |
| Compare cohorts of different size | Recurrence frequency, not q-value | q-value is not portable across N |
| Characterize mutational processes | Copy-number signatures | Drews CINSignatures or Steele COSMIC CN |
| Localize the gene within a wide peak | GISTIC2 `-genegistic 1` + known drivers | Wide peaks need orthogonal driver evidence |
| Single tumor (no cohort) | GISTIC2 does not apply | Use focal-amplification-ecdna / per-sample annotation |
## Running GISTIC2
```bash
# Segment file: 6 columns -- sample, chrom, start, end, num_markers, seg.mean (log2).
# It MUST be diploid-centered. Pool per-sample segments (e.g. cnvkit.py export seg).
gistic2 \
-b gistic_output/ \
-seg cohort.seg \
-refgene hg38.refgene.mat \
-genegistic 1 \
-broad 1 \
-brlen 0.7 \
-conf 0.99 \
-armpeel 1 \
-savegene 1 \
-gcm extreme \
-rx 0
```
Key flags: `-brlen 0.7` sets the focal/broad cutoff at 70% of a chromosome arm; `-conf 0.99` is the peak-boundary confidence — raising it above the 0.75 default yields a wider, more conservative peak with higher confidence the true driver gene lies inside it (the trade-off is more genes per peak); `-armpeel 1` peels arm-level events before focal testing; `-genegistic 1` runs the gene-level test; `-rx 0` keeps sex chromosomes. Output `amp_genes.txt` / `del_genes.txt` and `all_lesions.txt` list peaks, q-values, and genes.
## Copy-Number Signatures
**Goal:** Decompose the genome-wide copy-number pattern into mutational processes (HRD, chromothripsis, tandem duplication, ecDNA, whole-genome doubling).
**Approach:** Two competing 2022 frameworks exist. Steele et al (Nature 2022) defined 21 pan-cancer CN signatures from a 48-channel feature matrix, now in COSMIC; Drews et al (Nature 2022) defined 17 signatures via the CINSignatures feature set. Quantify against one framework consistently; signatures require *absolute* (allele-specific) copy number.
```r
library(CINSignatureQuantification)
# segments: data frame with columns chromosome, start, end, segVal (total CN),
# sample -- absolute copy number from ASCAT/Sequenza/FACETS, NOT relative log2.
res <- quantifyCNSignatures(segments, experimentName = 'cohort',
method = 'drews')
activities <- getActivities(res) # samples x signatures exposure matrix
```
The critical caveat (Steele 2022): three signatures had to be discarded as oversegmentation artifacts and ten were linear combinations needing manual filtering. Signatures are sensitive to the upstream caller — Steele prescribes the caller per platform (SNP6 -> ASCAT penalty 70; shallow WGS -> ASCAT.sc) precisely for this reason.
## Failure Modes
### Comparing q-values across cohorts of different size
**Trigger:** Stating that cohort A has "more significant" peaks than cohort B when the cohorts differ in N.
**Mechanism:** GISTIC q-values fall as N rises — the same recurrence frequency clears significance in a larger cohort.
**Symptom:** A larger cohort appears to have more drivers purely because it is larger; peak lists do not replicate.
**Fix:** Compare recurrence *frequency* (fraction of samples altered), not q-value, across cohorts. Re-run GISTIC at matched N (subsample) if a significance comparison is unavoidable.
### Oversegmented input produces spurious peaks
**Trigger:** Feeding GISTIC a seg file from a noisy or over-fragmented segmentation.
**Mechanism:** GISTIC interprets every segment edge as a potential focal event boundary; fragmentation creates many narrow false peaks.
**Symptom:** Numerous tiny significant peaks at no known driver; peaks not replicated with a cleaner segmentation.
**Fix:** Quality-control the segmentation first (see copy-ratio-segmentation); merge over-fragmented segments before pooling the cohort seg file.
### Mis-centered seg file inverts everything
**Trigger:** Pooling seg files that are not diploid-centered (e.g. WGD tumors centered on tetraploid).
**Mechanism:** GISTIC assumes seg.mean ~ 0 is diploid; a shifted baseline turns gains into neutral and neutral into losses before any statistics run.
**Symptom:** Amplification and deletion peaks swapped relative to known biology; genome-wide deletion bias.
**Fix:** Center each sample's seg file on its true diploid baseline (anchor with allele-specific ploidy) before pooling. Do not rely on per-sample median centering for aneuploid cohorts.
### Treating a wide GISTIC peak as a single-gene call
**Trigger:** Reporting every gene inside a wide significant peak, or assuming the peak gene is the driver.
**Mechanism:** Peak width reflects breakpoint heterogeneity across the cohort; a wide peak may contain dozens of genes, and the statistical peak need not coincide with the functional driver.
**Symptom:** A multi-gene peak reported as one driver; the named gene is a passenger.
**Fix:** Intersect peaks with known drivers (COSMIC CGC, OncoKB), expression, and dependency data. Raising `-confRelated in Writing & Docs
jax-development
IncludedUse this skill when the user is writing, debugging, profiling, refactoring, reviewing, benchmarking, parallelising, exporting, or explaining JAX code, or when they mention JAX, jax.numpy, jit, grad, value_and_grad, vmap, scan, lax, random keys, pytrees, jax.Array, sharding, Mesh, PartitionSpec, NamedSharding, pmap, shard_map, Pallas, XLA, StableHLO, checkify, profiler, or the JAX repo. It helps turn NumPy or PyTorch-style code into pure functional JAX, fix tracer/control-flow/shape/PRNG bugs, remove recompiles and host-device syncs, choose transforms and sharding strategies, inspect jaxpr/lowering/IR, and benchmark compiled code correctly.
nature-article-writer
IncludedDrafts, rewrites, diagnostically critiques, and style-calibrates primary research manuscripts for Nature and Nature Portfolio journals. Use when the user wants a Nature-style title, summary paragraph or abstract, introduction, results, discussion, methods, figure legends, presubmission enquiry, cover letter, reviewer response, or when a scientific draft sounds generic, jargon-heavy, structurally weak, or AI-ish and needs precise, broad-reader-friendly prose without inventing data, analyses, or references. Best for primary research articles and letters rather than reviews or press releases unless explicitly adapting one.
deckrd
IncludedDocument-driven framework that derives requirements, specifications, implementation plans, and executable tasks from goals through structured AI dialogue. Use when user says "write requirements", "create spec", "plan implementation", "derive tasks", "structure this feature", "break down into tasks", or "document this module". Also use for reverse engineering existing code into docs (/deckrd rev). Do NOT use for direct code writing — use /deckrd-coder after tasks are generated. Do NOT use when the user only wants to run or fix existing code without planning.
clinical-decision-support
IncludedGenerate professional clinical decision support (CDS) documents for pharmaceutical and clinical research settings, including patient cohort analyses (biomarker-stratified with outcomes) and treatment recommendation reports (evidence-based guidelines with decision algorithms). Supports GRADE evidence grading, statistical analysis (hazard ratios, survival curves, waterfall plots), biomarker integration, and regulatory compliance. Outputs publication-ready LaTeX/PDF format optimized for drug development, clinical research, and evidence synthesis.
handling-sf-data
IncludedSalesforce data operations with 130-point scoring. Use this skill to create, update, delete, bulk import/export, generate test data, and clean up org records using sf CLI and anonymous Apex. TRIGGER when: user creates test data, performs bulk import/export, uses sf data CLI commands, needs data factory patterns for Apex tests, or needs to seed/clean records in a Salesforce org. DO NOT TRIGGER when: SOQL query writing only (use querying-soql), Apex test execution (use running-apex-tests), or metadata deployment (use deploying-metadata).
accelint-ac-to-playwright
IncludedConvert and validate acceptance criteria for Playwright test automation. Use when user asks to (1) review/evaluate/check if AC are ready for automation, (2) assess if AC can be converted as-is, (3) validate AC quality for Playwright, (4) turn AC into tests, (5) generate tests from acceptance criteria, (6) convert .md bullets or .feature Gherkin files to Playwright specs, (7) create test automation from requirements. Handles both bullet-style markdown and Gherkin syntax with JSON test plan generation and validation.