build a640c20

cbio-lab

analysis documents — cohorts and views over one declarative objectstudiesexamplespaper reproductionshypothesis campaignshow we verifyrationale
AI tools

Your AI assistant — Claude in the Chrome sidebar — can read and edit this analysis with these tools. Every edit is run by the engine first and reaches the page only if it is accepted; analysis_undo reverts the assistant's edits.

These are the only way any assistant works this page, the site's own Assistant panel included. An assistant that supports WebMCP finds the tools through document.modelContext; one that can run JavaScript here calls window.cohortLab.* (window.cohortLab.help() lists them).

WebMCP tool (analysis)window.cohortLab
analysis_get_documentgetDocument()
analysis_get_resultsgetResults()
analysis_get_viewgetView(i)
analysis_get_provenancegetProvenance()
dsl_referencedslReference()
study_vocabularystudyVocabulary(study?)
list_studieslistStudies()
list_exampleslistExamples()
analysis_set_documentsetDocument(doc)
analysis_set_cohortsetCohort(name, def)
analysis_remove_cohortremoveCohort(name)
analysis_split_cohortsplitCohort({cohort, attribute|gene|oql|assay})
analysis_set_splitsetSplit(cohort, name, {arms, other?})
analysis_remove_splitremoveSplit(cohort, name)
analysis_add_viewaddView(view, position?)
analysis_update_viewupdateView(i, patch)
analysis_remove_viewremoveView(i)
analysis_move_viewmoveView(from, to)
analysis_set_detailssetDetails({study, title, params})
analysis_undoundo()
analysis_load_exampleloadExample(title)
analysis_share_linkshareLink()
analysis_savesave(name)
open_tabopenTab(tab)
explore_get_stateexploreState()
explore_get_facetsexploreFacets(section?, limit?)
explore_select_studiesselectStudies([ids])
explore_add_filteraddFilter(clause)
explore_remove_filterremoveFilter(i)
explore_clear_filtersclearFilters()
explore_analyzeanalyzeDraft()
cohorts_save_draftsaveDraft(name)
cohorts_list_savedlistSaved()
cohorts_add_saved_to_analysisaddSavedToAnalysis([names])
analysis_open_savedopenSaved(name)
site_pagespages()
site_openopen(path)
Saved work

Examples — every one of these is executed by the test gate

These are the same analysis documents that docs/dsl.md is generated from, and npm run docs:check runs each of them against the live compiler on every build — so an example that stopped working would fail the suite rather than sit here broken. Running one loads it into the Analysis tab, where you can edit the JSON and re-run.

99 examples
views
topics

Lung adenocarcinoma: a four-view workup

compareclinicalsurvivalcooccurrencemulti-viewlog-rank

One document, four views: the same two cohorts asked genomically, clinically, temporally and structurally. This is what the analysis document is FOR — not one chart, but a whole workup that travels as a single object.

EGFR-mutant versus KRAS-mutant lung adenocarcinoma — the two dominant, mutually exclusive driver classes. Co-alteration frequencies, how the groups differ clinically, how they differ in survival (with a log-rank test), and which driver pairs co-occur within the EGFR arm. Every view is computed from aggregates each site could return without disclosing a patient.

msk_chord_20242 cohorts: EGFR-mutant NSCLC, KRAS-mutant NSCLC
document
{
  "study": "msk_chord_2024",
  "cohorts": {
    "EGFR-mutant NSCLC": {
      "all": [
        {
          "kind": "clinical",
          "attribute": "CANCER_TYPE",
          "values": [
            "Non-Small Cell Lung Cancer"
          ]
        },
        {
          "kind": "oql",
          "q": "EGFR: MUT"
        }
      ]
    },
    "KRAS-mutant NSCLC": {
      "all": [
        {
          "kind": "clinical",
          "attribute": "CANCER_TYPE",
          "values": [
            "Non-Small Cell Lung Cancer"
          ]
        },
        {
          "kind": "oql",
          "q": "KRAS: MUT"
        }
      ]
    }
  },
  "views": [
    {
      "kind": "compare",
      "cohorts": [
        "EGFR-mutant NSCLC",
        "KRAS-mutant NSCLC"
      ],
      "genes": [
        "TP53",
        "STK11",
        "KEAP1",
        "RBM10",
        "ERBB2",
        "MET"
      ]
    },
    {
      "kind": "clinical",
      "cohorts": [
        "EGFR-mutant NSCLC",
        "KRAS-mutant NSCLC"
      ],
      "attributes": [
        "SMOKING_PREDICTIONS_3_CLASSES",
        "CURRENT_AGE_DEID",
        "TMB_NONSYNONYMOUS",
        "FRACTION_GENOME_ALTERED"
      ]
    },
    {
      "kind": "survival",
      "cohorts": [
        "EGFR-mutant NSCLC",
        "KRAS-mutant NSCLC"
      ]
    },
    {
      "kind": "cooccurrence",
      "cohorts": [
        "EGFR-mutant NSCLC",
        "KRAS-mutant NSCLC"
      ],
      "genes": [
        "EGFR",
        "TP53",
        "STK11",
        "KEAP1",
        "RBM10"
      ]
    }
  ]
}

One cohort, five ways: the colorectal hotspot workup

hotspotscooccurrencecompareclinicalsurvivalmulti-viewlollipop

A single cohort put through five different views at once — including the lollipop — to show that the views compose rather than compete. Nothing here is re-queried per chart; each view asks its own aggregate of the same compiled cohort.

Colorectal cancer in MSK-CHORD. Lollipops for the canonical drivers (KRAS codon 12/13, BRAF V600E, PIK3CA E545K/H1047R), which pairs co-occur or exclude each other, which other drivers each group carries, how the mutated and wild-type groups differ clinically, and how they differ in survival. minCount is set so no site returns a change carried by fewer than three patients.

msk_chord_20242 cohorts: CRC, KRAS-mutant, CRC, KRAS wild-type
document
{
  "study": "msk_chord_2024",
  "cohorts": {
    "CRC, KRAS-mutant": {
      "all": [
        {
          "kind": "clinical",
          "attribute": "CANCER_TYPE",
          "values": [
            "Colorectal Cancer"
          ]
        },
        {
          "kind": "oql",
          "q": "KRAS: MUT"
        }
      ]
    },
    "CRC, KRAS wild-type": {
      "all": [
        {
          "kind": "clinical",
          "attribute": "CANCER_TYPE",
          "values": [
            "Colorectal Cancer"
          ]
        },
        {
          "not": {
            "kind": "oql",
            "q": "KRAS:"
          }
        },
        {
          "kind": "profiled",
          "type": "MUTATION",
          "gene": "KRAS"
        }
      ]
    }
  },
  "views": [
    {
      "kind": "hotspots",
      "cohorts": [
        "CRC, KRAS-mutant",
        "CRC, KRAS wild-type"
      ],
      "genes": [
        "KRAS",
        "BRAF",
        "PIK3CA",
        "TP53"
      ],
      "minCount": 3
    },
    {
      "kind": "cooccurrence",
      "cohorts": [
        "CRC, KRAS-mutant",
        "CRC, KRAS wild-type"
      ],
      "genes": [
        "KRAS",
        "BRAF",
        "NRAS",
        "PIK3CA",
        "TP53",
        "APC",
        "SMAD4"
      ]
    },
    {
      "kind": "compare",
      "cohorts": [
        "CRC, KRAS-mutant",
        "CRC, KRAS wild-type"
      ],
      "genes": [
        "BRAF",
        "NRAS",
        "PIK3CA",
        "APC",
        "SMAD4"
      ]
    },
    {
      "kind": "clinical",
      "cohorts": [
        "CRC, KRAS-mutant",
        "CRC, KRAS wild-type"
      ],
      "attributes": [
        "CURRENT_AGE_DEID",
        "MSI_SCORE",
        "TMB_NONSYNONYMOUS"
      ]
    },
    {
      "kind": "survival",
      "cohorts": [
        "CRC, KRAS-mutant",
        "CRC, KRAS wild-type"
      ]
    }
  ]
}

Federated end to end: two studies, four views

comparesurvivalclinicalcooccurrencefederationmulti-viewlog-rankstratified

The full federated story in one document — cohorts spanning two studies, with every view falling back on aggregates that each site can compute in its own database: pooled gene counts, additive moments, per-site survival triples and per-site 2×2 tables.

TP53-mutant versus wild-type across MSK-CHORD and MSK-MET. The log-rank is stratified by study, the co-occurrence test is Cochran–Mantel–Haenszel across the two sites, and the clinical comparison pools counts and moments — all from per-site aggregates. Run with either study aggregate-only and the numbers do not change.

2 studies2 cohorts: TP53 mut, TP53 wt
document
{
  "study": "msk_chord_2024",
  "cohorts": {
    "TP53 mut": {
      "studies": [
        "msk_chord_2024",
        "msk_met_2021"
      ],
      "all": [
        {
          "kind": "oql",
          "q": "TP53: MUT"
        }
      ]
    },
    "TP53 wt": {
      "studies": [
        "msk_chord_2024",
        "msk_met_2021"
      ],
      "all": [
        {
          "not": {
            "kind": "oql",
            "q": "TP53:"
          }
        },
        {
          "kind": "profiled",
          "type": "MUTATION",
          "gene": "TP53"
        }
      ]
    }
  },
  "views": [
    {
      "kind": "compare",
      "cohorts": [
        "TP53 mut",
        "TP53 wt"
      ],
      "genes": [
        "KRAS",
        "PIK3CA",
        "APC",
        "EGFR",
        "CDKN2A"
      ]
    },
    {
      "kind": "survival",
      "cohorts": [
        "TP53 mut",
        "TP53 wt"
      ]
    },
    {
      "kind": "clinical",
      "cohorts": [
        "TP53 mut",
        "TP53 wt"
      ],
      "attributes": [
        "CURRENT_AGE_DEID",
        "TMB_NONSYNONYMOUS",
        "FRACTION_GENOME_ALTERED"
      ]
    },
    {
      "kind": "cooccurrence",
      "cohorts": [
        "TP53 mut",
        "TP53 wt"
      ],
      "genes": [
        "TP53",
        "KRAS",
        "PIK3CA",
        "APC"
      ]
    }
  ]
}

Genomic status via OQL, compared

comparesurvivalOQL

The base case the others build on: two cohorts defined genomically, compared gene by gene with panel-aware denominators, then followed to death.

STK11 putative drivers vs wild-type (wild-type = NOT any STK11 alteration AND profiled for STK11 mutations; without the profiled clause it would include patients never sequenced for STK11). Two views: co-alteration frequencies and overall survival.

msk_chord_20242 cohorts: STK11 driver, STK11 wt
document
{
  "study": "msk_chord_2024",
  "cohorts": {
    "STK11 driver": {
      "all": [
        {
          "kind": "oql",
          "q": "STK11: DRIVER"
        }
      ]
    },
    "STK11 wt": {
      "all": [
        {
          "not": {
            "kind": "oql",
            "q": "STK11:"
          }
        },
        {
          "kind": "profiled",
          "type": "MUTATION",
          "gene": "STK11"
        }
      ]
    }
  },
  "views": [
    {
      "kind": "compare",
      "cohorts": [
        "STK11 driver",
        "STK11 wt"
      ],
      "genes": [
        "KEAP1",
        "KRAS",
        "TP53"
      ]
    },
    {
      "kind": "survival",
      "cohorts": [
        "STK11 driver",
        "STK11 wt"
      ]
    }
  ]
}

Multivariate Cox: gene status alongside a clinical covariateNEW

coxforest-plotOQL

More than one covariate at once, unlike KM's single categorical split -- fit from real per-patient rows within this one local study, so a continuous or clinical covariate can sit next to a gene's alteration status in the same model.

Overall survival regressed on TP53 mutation status and reported gender, over the whole study. The forest plot reports one hazard ratio per covariate level, each measured against its own reference: a mutated-vs-not covariate always defaults to "Not mutated", any other categorical defaults to its most common level.

msk_chord_20241 cohort: all patients
document
{
  "study": "msk_chord_2024",
  "cohorts": {
    "all patients": {
      "all": []
    }
  },
  "views": [
    {
      "kind": "cox",
      "cohorts": [
        "all patients"
      ],
      "covariates": [
        {
          "source": "alteration",
          "gene": "TP53",
          "by": "mutated"
        },
        {
          "source": "clinical",
          "attribute": "GENDER"
        }
      ]
    }
  ]
}

Clinical + timeline event composition

comparetimeline-eventstemporal

A cohort no attribute filter could express — it depends on the ORDER of events in a patient's timeline.

Never-smokers whose timeline shows progression within 180 days after first immunotherapy. The event leaf is the v1 timeline sub-DSL embedded as a clause.

msk_chord_20241 cohort: never-smoker fast progressors
document
{
  "study": "msk_chord_2024",
  "cohorts": {
    "never-smoker fast progressors": {
      "all": [
        {
          "kind": "clinical",
          "attribute": "SMOKING_PREDICTIONS_3_CLASSES",
          "values": [
            "Never"
          ]
        },
        {
          "kind": "event",
          "a": {
            "eventType": "Treatment",
            "attrs": [
              {
                "key": "SUBTYPE",
                "value": "Immuno"
              }
            ],
            "occurrence": "FIRST"
          },
          "b": {
            "eventType": "Diagnosis",
            "attrs": [
              {
                "key": "PROGRESSION",
                "value": "Y"
              }
            ]
          },
          "rel": {
            "type": "BEFORE",
            "maxDays": 180
          }
        }
      ]
    }
  },
  "views": [
    {
      "kind": "compare",
      "cohorts": [
        "never-smoker fast progressors"
      ],
      "genes": [
        "STK11",
        "KEAP1",
        "TP53"
      ]
    }
  ]
}

Derived filters: enough follow-up to answer the question

clinicalcomparederivedtimeline-eventstemporal

Filters computed from the SHAPE of the data instead of a study's own words. Event-type names and attribute keys differ study to study, so anything keyed on them works nowhere in particular; dates and gene symbols are the same everywhere.

Any question about an outcome is only honest among patients observed long enough to have one. This contrasts patients with at least two years of follow-up past the study's own day 0 against those with under six months — a distinction no clinical attribute in this study records, and one that needs no knowledge of how this study names its events.

msk_chord_20242 cohorts: followed 2y+, followed < 6mo
document
{
  "study": "msk_chord_2024",
  "cohorts": {
    "followed 2y+": {
      "all": [
        {
          "kind": "derived",
          "metric": "followupMonths",
          "range": {
            "gte": 24
          }
        }
      ]
    },
    "followed < 6mo": {
      "all": [
        {
          "kind": "derived",
          "metric": "followupMonths",
          "range": {
            "lt": 6
          }
        }
      ]
    }
  },
  "views": [
    {
      "kind": "clinical",
      "cohorts": [
        "followed 2y+",
        "followed < 6mo"
      ],
      "attributes": [
        "CANCER_TYPE",
        "CURRENT_AGE_DEID",
        "TMB_NONSYNONYMOUS"
      ]
    },
    {
      "kind": "compare",
      "cohorts": [
        "followed 2y+",
        "followed < 6mo"
      ],
      "genes": [
        "TP53",
        "KRAS",
        "PIK3CA"
      ]
    }
  ]
}

Progression on immunotherapy: during, versus absent

compareclinicalsurvivaltimeline-eventstemporal

Two temporal relations that look similar and mean opposite things. DURING asks whether progression was recorded inside a treatment interval; NOT_FOLLOWED_BY asks whether it was absent for a year afterwards — and only counts patients whose follow-up actually covers that year.

Patients who progressed while on immunotherapy (1,423) versus those with no progression recorded in the year after starting it (534). The second cohort sets observed:true, so "no progression" means the follow-up was there and nothing was recorded — not that the patient was lost to follow-up. Without that guard the cohort would be far larger and largely meaningless.

msk_chord_20242 cohorts: progressed on immunotherapy, no progression within a year
document
{
  "study": "msk_chord_2024",
  "cohorts": {
    "progressed on immunotherapy": {
      "all": [
        {
          "kind": "event",
          "a": {
            "eventType": "Treatment",
            "attrs": [
              {
                "key": "SUBTYPE",
                "value": "Immuno"
              }
            ]
          },
          "b": {
            "eventType": "Diagnosis",
            "attrs": [
              {
                "key": "PROGRESSION",
                "value": "Y"
              }
            ]
          },
          "rel": {
            "type": "DURING"
          }
        }
      ]
    },
    "no progression within a year": {
      "all": [
        {
          "kind": "event",
          "a": {
            "eventType": "Treatment",
            "attrs": [
              {
                "key": "SUBTYPE",
                "value": "Immuno"
              }
            ],
            "occurrence": "FIRST"
          },
          "b": {
            "eventType": "Diagnosis",
            "attrs": [
              {
                "key": "PROGRESSION",
                "value": "Y"
              }
            ]
          },
          "rel": {
            "type": "NOT_FOLLOWED_BY",
            "withinDays": 365,
            "observed": true
          }
        }
      ]
    }
  },
  "views": [
    {
      "kind": "compare",
      "cohorts": [
        "progressed on immunotherapy",
        "no progression within a year"
      ],
      "genes": [
        "STK11",
        "KEAP1",
        "TP53",
        "EGFR",
        "SMARCA4"
      ]
    },
    {
      "kind": "clinical",
      "cohorts": [
        "progressed on immunotherapy",
        "no progression within a year"
      ],
      "attributes": [
        "TMB_NONSYNONYMOUS",
        "CURRENT_AGE_DEID",
        "SMOKING_PREDICTIONS_3_CLASSES"
      ]
    },
    {
      "kind": "survival",
      "cohorts": [
        "progressed on immunotherapy",
        "no progression within a year"
      ]
    }
  ]
}

Derived treatment lines: who reaches a third line?

survivalclinicalcomparetimeline-eventstemporaltreatment-lines

Treatment lines are not a column in the data — they are synthesised at query time by interval-merging systemic therapy with a gap rule. The line number is then an ordinary attribute you can filter on, and NOT around a line selector expresses "never got that far".

Patients who reached a third line of therapy (3,088) versus those who had a first line and never a second (13,620), with lines derived on a 90-day gap. Changing lineGap changes both cohorts — the line boundary is a modelling choice, made explicit rather than baked into the data. READ THE SURVIVAL CURVE WITH CARE: reaching a third line requires surviving long enough to receive one, so this comparison carries immortal time bias and the modest separation it shows (medians 48.1 vs 43.1 months) is not evidence that more lines help. The engine cannot detect this — it is a property of how the cohorts were defined, not of the data, which is exactly why the definition travels with the result.

msk_chord_20242 cohorts: reached 3rd line, first line only
document
{
  "study": "msk_chord_2024",
  "cohorts": {
    "reached 3rd line": {
      "all": [
        {
          "kind": "event",
          "a": {
            "eventType": "Treatment line (derived)",
            "attrs": [
              {
                "key": "LINE_NO",
                "value": "3"
              }
            ]
          },
          "rel": {
            "type": "NONE"
          },
          "lineGap": 90
        }
      ]
    },
    "first line only": {
      "all": [
        {
          "kind": "event",
          "a": {
            "eventType": "Treatment line (derived)",
            "attrs": [
              {
                "key": "LINE_NO",
                "value": "1"
              }
            ]
          },
          "rel": {
            "type": "NONE"
          },
          "lineGap": 90
        },
        {
          "not": {
            "kind": "event",
            "a": {
              "eventType": "Treatment line (derived)",
              "attrs": [
                {
                  "key": "LINE_NO",
                  "value": "2"
                }
              ]
            },
            "rel": {
              "type": "NONE"
            },
            "lineGap": 90
          }
        }
      ]
    }
  },
  "views": [
    {
      "kind": "survival",
      "cohorts": [
        "reached 3rd line",
        "first line only"
      ]
    },
    {
      "kind": "clinical",
      "cohorts": [
        "reached 3rd line",
        "first line only"
      ],
      "attributes": [
        "CURRENT_AGE_DEID",
        "CANCER_TYPE",
        "TMB_NONSYNONYMOUS"
      ]
    },
    {
      "kind": "compare",
      "cohorts": [
        "reached 3rd line",
        "first line only"
      ],
      "genes": [
        "TP53",
        "KRAS",
        "PIK3CA",
        "APC"
      ]
    }
  ]
}

Held-out replication: one question, two halves of the patients

comparesplitreplicationtimeline-events

The split leaf. The engine divides every study's patients into two fixed halves by a salted hash of the patient id, so a finding made on one half can be checked on patients it never touched — the replication step a hypothesis campaign (/campaign) automates, and the one a single-dataset analysis usually has to skip.

NSCLC patients who progressed within 180 days of first immunotherapy versus those with no progression in the year after it, each divided into the discovery and validation halves. STK11 is altered more often in early failures on both halves; KEAP1 separates the groups on the discovery half only. The halves are the same for every caller and every run, and the salt is pinned by a test, so a result reported on one half can always be re-checked on the other.

msk_chord_20244 cohorts: early failure (discovery), durable response (discovery), early failure (validation), durable response (validation)
document
{
  "study": "msk_chord_2024",
  "cohorts": {
    "early failure (discovery)": {
      "all": [
        {
          "kind": "clinical",
          "attribute": "CANCER_TYPE",
          "values": [
            "Non-Small Cell Lung Cancer"
          ]
        },
        {
          "kind": "event",
          "a": {
            "eventType": "Treatment",
            "attrs": [
              {
                "key": "SUBTYPE",
                "value": "Immuno"
              }
            ],
            "occurrence": "FIRST"
          },
          "b": {
            "eventType": "Diagnosis",
            "attrs": [
              {
                "key": "PROGRESSION",
                "value": "Y"
              }
            ]
          },
          "rel": {
            "type": "BEFORE",
            "maxDays": 180
          }
        },
        {
          "kind": "split",
          "part": "discovery"
        }
      ]
    },
    "durable response (discovery)": {
      "all": [
        {
          "kind": "clinical",
          "attribute": "CANCER_TYPE",
          "values": [
            "Non-Small Cell Lung Cancer"
          ]
        },
        {
          "kind": "event",
          "a": {
            "eventType": "Treatment",
            "attrs": [
              {
                "key": "SUBTYPE",
                "value": "Immuno"
              }
            ],
            "occurrence": "FIRST"
          },
          "b": {
            "eventType": "Diagnosis",
            "attrs": [
              {
                "key": "PROGRESSION",
                "value": "Y"
              }
            ]
          },
          "rel": {
            "type": "NOT_FOLLOWED_BY",
            "withinDays": 365,
            "observed": true
          }
        },
        {
          "kind": "split",
          "part": "discovery"
        }
      ]
    },
    "early failure (validation)": {
      "all": [
        {
          "kind": "clinical",
          "attribute": "CANCER_TYPE",
          "values": [
            "Non-Small Cell Lung Cancer"
          ]
        },
        {
          "kind": "event",
          "a": {
            "eventType": "Treatment",
            "attrs": [
              {
                "key": "SUBTYPE",
                "value": "Immuno"
              }
            ],
            "occurrence": "FIRST"
          },
          "b": {
            "eventType": "Diagnosis",
            "attrs": [
              {
                "key": "PROGRESSION",
                "value": "Y"
              }
            ]
          },
          "rel": {
            "type": "BEFORE",
            "maxDays": 180
          }
        },
        {
          "kind": "split",
          "part": "validation"
        }
      ]
    },
    "durable response (validation)": {
      "all": [
        {
          "kind": "clinical",
          "attribute": "CANCER_TYPE",
          "values": [
            "Non-Small Cell Lung Cancer"
          ]
        },
        {
          "kind": "event",
          "a": {
            "eventType": "Treatment",
            "attrs": [
              {
                "key": "SUBTYPE",
                "value": "Immuno"
              }
            ],
            "occurrence": "FIRST"
          },
          "b": {
            "eventType": "Diagnosis",
            "attrs": [
              {
                "key": "PROGRESSION",
                "value": "Y"
              }
            ]
          },
          "rel": {
            "type": "NOT_FOLLOWED_BY",
            "withinDays": 365,
            "observed": true
          }
        },
        {
          "kind": "split",
          "part": "validation"
        }
      ]
    }
  },
  "views": [
    {
      "kind": "compare",
      "genes": [
        "STK11",
        "KEAP1"
      ],
      "cohorts": [
        "early failure (discovery)",
        "durable response (discovery)"
      ]
    },
    {
      "kind": "compare",
      "genes": [
        "STK11",
        "KEAP1"
      ],
      "cohorts": [
        "early failure (validation)",
        "durable response (validation)"
      ]
    }
  ]
}

True first line: fast progression versus durable control

survivalcompareclinicaltimeline-eventstemporalprior-guard

The prior-treatment guard. "First line" ordinarily means first line OBSERVED HERE — about a fifth of these patients were treated elsewhere first. priorGuard restricts to those flagged treatment-naive, which is the difference between a real first-line claim and an artefact of where the patient was referred from.

Among treatment-naive patients starting first-line chemotherapy: progression recorded within 180 days (3,319) versus none in that window with follow-up to prove it (6,584). BEFORE takes a window; NOT_FOLLOWED_BY takes the same window and asks for its absence. Drop priorGuard and both cohorts grow by roughly the share of patients pre-treated elsewhere.

msk_chord_20242 cohorts: progressed within 180d of 1L chemo, no progression within 180d
document
{
  "study": "msk_chord_2024",
  "cohorts": {
    "progressed within 180d of 1L chemo": {
      "all": [
        {
          "kind": "event",
          "a": {
            "eventType": "Treatment",
            "attrs": [
              {
                "key": "SUBTYPE",
                "value": "Chemo"
              }
            ],
            "occurrence": "FIRST"
          },
          "b": {
            "eventType": "Diagnosis",
            "attrs": [
              {
                "key": "PROGRESSION",
                "value": "Y"
              }
            ]
          },
          "rel": {
            "type": "BEFORE",
            "maxDays": 180
          },
          "priorGuard": true
        }
      ]
    },
    "no progression within 180d": {
      "all": [
        {
          "kind": "event",
          "a": {
            "eventType": "Treatment",
            "attrs": [
              {
                "key": "SUBTYPE",
                "value": "Chemo"
              }
            ],
            "occurrence": "FIRST"
          },
          "b": {
            "eventType": "Diagnosis",
            "attrs": [
              {
                "key": "PROGRESSION",
                "value": "Y"
              }
            ]
          },
          "rel": {
            "type": "NOT_FOLLOWED_BY",
            "withinDays": 180,
            "observed": true
          },
          "priorGuard": true
        }
      ]
    }
  },
  "views": [
    {
      "kind": "survival",
      "cohorts": [
        "progressed within 180d of 1L chemo",
        "no progression within 180d"
      ]
    },
    {
      "kind": "compare",
      "cohorts": [
        "progressed within 180d of 1L chemo",
        "no progression within 180d"
      ],
      "genes": [
        "TP53",
        "KRAS",
        "SMAD4",
        "CDKN2A",
        "MYC"
      ]
    },
    {
      "kind": "clinical",
      "cohorts": [
        "progressed within 180d of 1L chemo",
        "no progression within 180d"
      ],
      "attributes": [
        "CANCER_TYPE",
        "FRACTION_GENOME_ALTERED",
        "CURRENT_AGE_DEID"
      ]
    }
  ]
}

Lab thresholds over time: PSA above 100

comparesurvivalclinicaltimeline-eventstemporallab-values

A numeric predicate on a repeated measurement. The cohort is defined by a lab value ever crossing a threshold, and its complement is built by wrapping the same selector in NOT alongside "was measured at all" — so the comparison is against patients genuinely tested, not against patients with no PSA record.

PSA recorded above 100 ng/ml at any point (879) versus PSA measured but never above 100 (3,250). The second cohort deliberately requires a PSA test to exist: comparing against everyone else would silently contrast the tested with the untested, which is a selection effect rather than a finding.

msk_chord_20242 cohorts: PSA above 100, PSA measured, never above 100
document
{
  "study": "msk_chord_2024",
  "cohorts": {
    "PSA above 100": {
      "all": [
        {
          "kind": "event",
          "a": {
            "eventType": "Lab_Test",
            "attrs": [
              {
                "key": "TEST",
                "value": "PSA"
              }
            ],
            "numeric": {
              "key": "RESULT",
              "op": ">",
              "value": 100
            }
          },
          "rel": {
            "type": "NONE"
          }
        }
      ]
    },
    "PSA measured, never above 100": {
      "all": [
        {
          "kind": "event",
          "a": {
            "eventType": "Lab_Test",
            "attrs": [
              {
                "key": "TEST",
                "value": "PSA"
              }
            ]
          },
          "rel": {
            "type": "NONE"
          }
        },
        {
          "not": {
            "kind": "event",
            "a": {
              "eventType": "Lab_Test",
              "attrs": [
                {
                  "key": "TEST",
                  "value": "PSA"
                }
              ],
              "numeric": {
                "key": "RESULT",
                "op": ">",
                "value": 100
              }
            },
            "rel": {
              "type": "NONE"
            }
          }
        }
      ]
    }
  },
  "views": [
    {
      "kind": "compare",
      "cohorts": [
        "PSA above 100",
        "PSA measured, never above 100"
      ],
      "genes": [
        "AR",
        "TP53",
        "PTEN",
        "SPOP",
        "RB1"
      ]
    },
    {
      "kind": "survival",
      "cohorts": [
        "PSA above 100",
        "PSA measured, never above 100"
      ]
    },
    {
      "kind": "clinical",
      "cohorts": [
        "PSA above 100",
        "PSA measured, never above 100"
      ],
      "attributes": [
        "CURRENT_AGE_DEID",
        "FRACTION_GENOME_ALTERED",
        "CANCER_TYPE"
      ]
    }
  ]
}

any / not / genomicData

compareboolean

Boolean structure: OR inside a clause, NOT around a leaf, and a copy-number threshold expressed as a continuous range.

Colorectal or pancreatic patients (OR inside one clause), excluding CDKN2A deep deletions expressed as a continuous copy-number threshold.

msk_chord_20241 cohort: CRC/PAAD without CDKN2A loss
document
{
  "study": "msk_chord_2024",
  "cohorts": {
    "CRC/PAAD without CDKN2A loss": {
      "all": [
        {
          "any": [
            {
              "kind": "clinical",
              "attribute": "CANCER_TYPE",
              "values": [
                "Colorectal Cancer"
              ]
            },
            {
              "kind": "clinical",
              "attribute": "CANCER_TYPE",
              "values": [
                "Pancreatic Cancer"
              ]
            }
          ]
        },
        {
          "not": {
            "kind": "genomicData",
            "gene": "CDKN2A",
            "profileType": "cna",
            "range": {
              "lte": -2
            }
          }
        }
      ]
    }
  },
  "views": [
    {
      "kind": "compare",
      "cohorts": [
        "CRC/PAAD without CDKN2A loss"
      ],
      "genes": [
        "KRAS",
        "TP53",
        "APC",
        "SMAD4"
      ]
    }
  ]
}

Cross-study federation with an oncoprint

oncoprintfederation

One cohort spanning two studies. Overlap is NOT deduplicated and vocabularies are NOT harmonized — the view says so rather than hiding it.

One cohort unioned across two studies (members are study-qualified; overlap is NOT deduplicated), rendered as a federated oncoprint with a categorical and a numeric clinical track, columns sorted by cancer type then descending age. The “Study of origin” track is added automatically.

2 studies1 cohort: TP53-mut, CHORD+MET
document
{
  "study": "msk_chord_2024",
  "cohorts": {
    "TP53-mut, CHORD+MET": {
      "studies": [
        "msk_chord_2024",
        "msk_met_2021"
      ],
      "all": [
        {
          "kind": "oql",
          "q": "TP53: MUT"
        }
      ]
    }
  },
  "views": [
    {
      "kind": "oncoprint",
      "cohorts": [
        "TP53-mut, CHORD+MET"
      ],
      "genes": [
        "TP53",
        "KRAS",
        "EGFR"
      ],
      "clinical": [
        "CANCER_TYPE",
        "CURRENT_AGE_DEID"
      ],
      "sort": [
        "CANCER_TYPE",
        "-CURRENT_AGE_DEID"
      ]
    }
  ]
}

Molecular heatmap tracks, sorted by expression

oncoprintheatmapexpression

Continuous molecular values as tracks, with the track label doubling as the sort key.

ERBB2-amplified TCGA breast tumors with an mRNA z-score heatmap under the gene tracks, columns sorted by descending ERBB2 expression. Z-scores render on a fixed diverging ±3 ramp; the track label (gene + short profile name) is the sort key.

brca_tcga_pan_can_atlas_20181 cohort: ERBB2 amp
document
{
  "study": "brca_tcga_pan_can_atlas_2018",
  "cohorts": {
    "ERBB2 amp": {
      "all": [
        {
          "kind": "oql",
          "q": "ERBB2: AMP"
        }
      ]
    }
  },
  "views": [
    {
      "kind": "oncoprint",
      "cohorts": [
        "ERBB2 amp"
      ],
      "genes": [
        "ERBB2",
        "EGFR",
        "PIK3CA"
      ],
      "heatmap": [
        {
          "profileType": "rna_seq_v2_mrna_median_Zscores"
        }
      ],
      "sort": [
        "-ERBB2 mRNA-z"
      ]
    }
  ]
}

A plot of 13,000 samples, drawn as density

plotscale

The portal's Plots tab fetches every point to the browser. This one counts them in the database and sends the counts, so the same picture draws for a hundred cases or four hundred thousand.

Tumour mutational burden against fraction of the genome altered, over every sample of a TP53-mutant cohort. The figure is a density field: the samples are counted into a 240x160 grid, and only the occupied cells travel, plus the outliers — the cases in the sparse cells at the fringe, drawn as points. Pearson, Spearman and the fitted line are computed over EVERY sample inside ClickHouse, so they describe the whole cohort rather than the points that happened to be painted last. The second view groups the same measure by TP53 mutation class, as quartiles with Tukey whiskers over a violin, with the values beyond the whiskers drawn as points.

msk_chord_20241 cohort: TP53 mut
document
{
  "study": "msk_chord_2024",
  "cohorts": {
    "TP53 mut": {
      "all": [
        {
          "kind": "oql",
          "q": "TP53: MUT"
        }
      ]
    }
  },
  "views": [
    {
      "kind": "plot",
      "cohorts": [
        "TP53 mut"
      ],
      "unit": "sample",
      "x": {
        "source": "clinical",
        "attribute": "MUTATION_COUNT"
      },
      "y": {
        "source": "clinical",
        "attribute": "FRACTION_GENOME_ALTERED"
      }
    },
    {
      "kind": "plot",
      "cohorts": [
        "TP53 mut"
      ],
      "unit": "sample",
      "x": {
        "source": "alteration",
        "gene": "TP53",
        "by": "mutationType"
      },
      "y": {
        "source": "clinical",
        "attribute": "FRACTION_GENOME_ALTERED"
      }
    }
  ]
}

Point layers on a plot: KRAS G12C and STK11 against 25,000 patients

plotpointsscale

`points` on a plot view: subsets drawn in their own colours over the plotted cohort — here two cohorts, after the outliers — so the cases you care about are visible against a density of everyone else.

Age against tumour mutational burden for every patient in MSK-CHORD (24,947 with both), drawn as a light-blue density. KRAS G12C (1,113 patients) and STK11-mutant (1,206) are drawn over it as points, each in its own colour. The coefficients and the fitted line are still those of the whole cohort. The second view groups the same measure by cancer type: KRAS G12C is again points, while TP53-mutant patients (13,105) are too many for points, so they are drawn as a narrow box per group beside the cohort's own box, and the caption says why.

msk_chord_20244 cohorts: All patients, KRAS G12C, STK11 mut, TP53 mut
document
{
  "study": "msk_chord_2024",
  "cohorts": {
    "All patients": {
      "all": []
    },
    "KRAS G12C": {
      "all": [
        {
          "kind": "oql",
          "q": "KRAS: G12C"
        }
      ]
    },
    "STK11 mut": {
      "all": [
        {
          "kind": "oql",
          "q": "STK11: MUT"
        }
      ]
    },
    "TP53 mut": {
      "all": [
        {
          "kind": "oql",
          "q": "TP53: MUT"
        }
      ]
    }
  },
  "views": [
    {
      "kind": "plot",
      "unit": "patient",
      "cohorts": [
        "All patients"
      ],
      "x": {
        "source": "clinical",
        "attribute": "CURRENT_AGE_DEID"
      },
      "y": {
        "source": "clinical",
        "attribute": "TMB_NONSYNONYMOUS"
      },
      "points": [
        {
          "rule": "outliers"
        },
        {
          "cohort": "KRAS G12C"
        },
        {
          "cohort": "STK11 mut"
        }
      ]
    },
    {
      "kind": "plot",
      "unit": "patient",
      "cohorts": [
        "All patients"
      ],
      "x": {
        "source": "clinical",
        "attribute": "CANCER_TYPE"
      },
      "y": {
        "source": "clinical",
        "attribute": "TMB_NONSYNONYMOUS"
      },
      "points": [
        {
          "cohort": "KRAS G12C"
        },
        {
          "cohort": "TP53 mut"
        }
      ]
    }
  ]
}

A cohort layer that reaches beyond the plotted cohort

plotpoints

A cohort layer's cases are the plotted cohort's cases that are also in it. Patients of the layer's cohort outside the plotted cohort are counted in the caption, not drawn.

Non-small cell lung cancer in MSK-CHORD (7,809 patients), with KRAS G12C highlighted. 916 of the 1,113 KRAS G12C patients have a lung sample; the other 197 are outside the plotted cohort, and the caption says so. The second view counts samples instead of patients, so a patient with two sequenced samples is drawn twice.

msk_chord_20242 cohorts: NSCLC, KRAS G12C
document
{
  "study": "msk_chord_2024",
  "cohorts": {
    "NSCLC": {
      "all": [
        {
          "kind": "clinical",
          "attribute": "CANCER_TYPE",
          "values": [
            "Non-Small Cell Lung Cancer"
          ]
        }
      ]
    },
    "KRAS G12C": {
      "all": [
        {
          "kind": "oql",
          "q": "KRAS: G12C"
        }
      ]
    }
  },
  "views": [
    {
      "kind": "plot",
      "unit": "patient",
      "cohorts": [
        "NSCLC"
      ],
      "x": {
        "source": "clinical",
        "attribute": "CURRENT_AGE_DEID"
      },
      "y": {
        "source": "clinical",
        "attribute": "TMB_NONSYNONYMOUS"
      },
      "points": [
        {
          "cohort": "KRAS G12C"
        }
      ]
    },
    {
      "kind": "plot",
      "unit": "sample",
      "cohorts": [
        "NSCLC"
      ],
      "x": {
        "source": "clinical",
        "attribute": "SAMPLE_TYPE"
      },
      "y": {
        "source": "clinical",
        "attribute": "TMB_NONSYNONYMOUS"
      },
      "points": [
        {
          "cohort": "KRAS G12C"
        }
      ]
    }
  ]
}

Point layers across two studies

plotfederationpoints

Point layers on a federated plot: each study answers for its own cases, and the points are pooled onto one figure.

TCGA lung adenocarcinoma and squamous cell carcinoma pooled (1,053 patients). KRAS-mutant (175) and TP53-mutant (699) patients are drawn over the pooled plot of age against tumour mutational burden; each study returns its own highlighted cases. In the second view, KRAS-mutant patients are drawn over the TMB distribution by sex. If any study in a highlight could not show individual cases, the whole highlight would be drawn as an aggregate, never half points and half cells.

2 studies3 cohorts: Lung (TCGA), KRAS mut, TP53 mut
document
{
  "study": "luad_tcga_pan_can_atlas_2018",
  "cohorts": {
    "Lung (TCGA)": {
      "studies": [
        "luad_tcga_pan_can_atlas_2018",
        "lusc_tcga_pan_can_atlas_2018"
      ],
      "all": []
    },
    "KRAS mut": {
      "studies": [
        "luad_tcga_pan_can_atlas_2018",
        "lusc_tcga_pan_can_atlas_2018"
      ],
      "all": [
        {
          "kind": "oql",
          "q": "KRAS: MUT"
        }
      ]
    },
    "TP53 mut": {
      "studies": [
        "luad_tcga_pan_can_atlas_2018",
        "lusc_tcga_pan_can_atlas_2018"
      ],
      "all": [
        {
          "kind": "oql",
          "q": "TP53: MUT"
        }
      ]
    }
  },
  "views": [
    {
      "kind": "plot",
      "unit": "patient",
      "cohorts": [
        "Lung (TCGA)"
      ],
      "x": {
        "source": "clinical",
        "attribute": "AGE"
      },
      "y": {
        "source": "clinical",
        "attribute": "TMB_NONSYNONYMOUS"
      },
      "points": [
        {
          "cohort": "KRAS mut"
        },
        {
          "cohort": "TP53 mut"
        }
      ]
    },
    {
      "kind": "plot",
      "unit": "patient",
      "cohorts": [
        "Lung (TCGA)"
      ],
      "x": {
        "source": "clinical",
        "attribute": "SEX"
      },
      "y": {
        "source": "clinical",
        "attribute": "TMB_NONSYNONYMOUS"
      },
      "points": [
        {
          "cohort": "KRAS mut"
        }
      ]
    }
  ]
}

OQL on a plot axis: STK11 or KEAP1 mutant lung cancer

plotOQL

An alteration axis written as an OQL query — several genes, Altered when a case matches any of them, or one group per statement — used as a box plot's groups and as a colour.

Non-small cell lung cancer in MSK-CHORD (7,809 patients). The first view groups tumour mutational burden by the OQL query `STK11: MUT; KEAP1: MUT`: 1,535 patients are Altered (a mutation in either gene), the same count as a cohort defined by that OQL, and 6,274 are Unaltered. The second view groups by sample type and colours each violin by the same query, counting samples rather than patients. The third gives each statement of `STK11: MUT, KEAP1: MUT, KRAS: G12C` its own group, over samples: 620 KRAS G12C, 459 KEAP1, 377 STK11, 403 with both STK11 and KEAP1 (median TMB 8.6 against 4.1 for the 5,720 with none), the other pairs as their own groups and 109 matching all three. None of these lung samples is on a panel without the three genes, so no group is Not profiled.

msk_chord_20241 cohort: NSCLC
document
{
  "study": "msk_chord_2024",
  "cohorts": {
    "NSCLC": {
      "all": [
        {
          "kind": "clinical",
          "attribute": "CANCER_TYPE",
          "values": [
            "Non-Small Cell Lung Cancer"
          ]
        }
      ]
    }
  },
  "views": [
    {
      "kind": "plot",
      "unit": "patient",
      "cohorts": [
        "NSCLC"
      ],
      "x": {
        "source": "alteration",
        "oql": "STK11: MUT; KEAP1: MUT"
      },
      "y": {
        "source": "clinical",
        "attribute": "TMB_NONSYNONYMOUS"
      }
    },
    {
      "kind": "plot",
      "unit": "sample",
      "cohorts": [
        "NSCLC"
      ],
      "allPoints": false,
      "points": [],
      "x": {
        "source": "clinical",
        "attribute": "SAMPLE_TYPE"
      },
      "y": {
        "source": "clinical",
        "attribute": "TMB_NONSYNONYMOUS"
      },
      "colorBy": {
        "source": "alteration",
        "oql": "STK11: MUT; KEAP1: MUT"
      }
    },
    {
      "kind": "plot",
      "unit": "sample",
      "cohorts": [
        "NSCLC"
      ],
      "x": {
        "source": "alteration",
        "oql": "STK11: MUT, KEAP1: MUT, KRAS: G12C",
        "by": "statement"
      },
      "y": {
        "source": "clinical",
        "attribute": "TMB_NONSYNONYMOUS"
      }
    }
  ]
}

Plot axes from the study's own profiles: ERBB2 copy number against expression

plotprofiles

A `profile` axis: one gene in one of the study's molecular profiles, read as the study describes the profile — discrete copy number as its levels, expression as a number, mutations by type.

TCGA breast cancer (PanCancer Atlas), every sample. The first view groups ERBB2 mRNA z-scores (relative to all samples) by ERBB2's GISTIC copy-number call, from Shallow deletion to Amplification: the 122 amplified samples sit far above the rest. The second groups fraction of genome altered by TP53's mutation type from the study's mutation profile; the 18 samples not in that profile are Not profiled, not counted as unmutated.

brca_tcga_pan_can_atlas_20181 cohort: all samples
document
{
  "study": "brca_tcga_pan_can_atlas_2018",
  "cohorts": {
    "all samples": {
      "all": []
    }
  },
  "views": [
    {
      "kind": "plot",
      "cohorts": [
        "all samples"
      ],
      "unit": "sample",
      "x": {
        "source": "profile",
        "profile": "gistic",
        "gene": "ERBB2"
      },
      "y": {
        "source": "profile",
        "profile": "rna_seq_v2_mrna_median_all_sample_Zscores",
        "gene": "ERBB2"
      }
    },
    {
      "kind": "plot",
      "cohorts": [
        "all samples"
      ],
      "unit": "sample",
      "x": {
        "source": "profile",
        "profile": "mutations",
        "gene": "TP53"
      },
      "y": {
        "source": "clinical",
        "attribute": "FRACTION_GENOME_ALTERED"
      }
    }
  ]
}

Merged gene rows: a pathway as one track

oncoprintmerged-tracks

Several genes drawn as one row, the way cBioPortal's [TP53 MDM2 MDM4] does, with the members kept alongside so the pooling is visible.

Pancreatic adenocarcinoma. The first row pools TP53, MDM2 and MDM4: it is altered where any of them is, and its denominator is the union of the three genes' panels — not their intersection, and not the whole cohort. TP53 is drawn again on its own underneath, so the difference the other two make is readable rather than asserted. A row's members are listed in its tooltip and in the contract's `members` field.

msk_chord_20241 cohort: Pancreatic
document
{
  "study": "msk_chord_2024",
  "cohorts": {
    "Pancreatic": {
      "all": [
        {
          "kind": "clinical",
          "attribute": "CANCER_TYPE",
          "values": [
            "Pancreatic Cancer"
          ]
        }
      ]
    }
  },
  "views": [
    {
      "kind": "oncoprint",
      "cohorts": [
        "Pancreatic"
      ],
      "genes": [
        {
          "label": "TP53 pathway",
          "genes": [
            "TP53",
            "MDM2",
            "MDM4"
          ]
        },
        "TP53",
        {
          "label": "RAS",
          "genes": [
            "KRAS",
            "NRAS",
            "HRAS"
          ]
        },
        "SMAD4",
        "CDKN2A"
      ],
      "clinical": [
        "CURRENT_AGE_DEID"
      ]
    }
  ]
}

A federated z-score reference on an oncoprint

oncoprintfederationheatmapz-reference

The sharpest form of the argument: a site that discloses no patients — and so draws no columns — still defines the scale those columns are read against, from three totals per gene.

A heatmap track with reference:"federation" is scored against a distribution pooled from EVERY participating study, including instances that disclose no patients and therefore contribute no columns — each returns three totals per gene (n, sum, sum of squares), which is enough to define the reference. Run with luad_tcga_pan_can_atlas_2018 aggregate-only, its patients are absent from the columns while its 510 patients still shape what the drawn columns mean.

2 studies1 cohort: ERBB2 amp
document
{
  "study": "brca_tcga_pan_can_atlas_2018",
  "cohorts": {
    "ERBB2 amp": {
      "studies": [
        "brca_tcga_pan_can_atlas_2018",
        "luad_tcga_pan_can_atlas_2018"
      ],
      "all": [
        {
          "kind": "oql",
          "q": "ERBB2: AMP"
        }
      ]
    }
  },
  "views": [
    {
      "kind": "oncoprint",
      "cohorts": [
        "ERBB2 amp"
      ],
      "genes": [
        "ERBB2",
        "EGFR"
      ],
      "heatmap": [
        {
          "profileType": "rna_seq_v2_mrna_median_Zscores",
          "reference": "federation"
        }
      ]
    }
  ]
}

The clinical course: who is still on treatment, and whenNEW

coursetimeline-eventstemporalanchorat-risk

Timeline data finally DRAWN rather than only filtered on. The two things that make a temporal chart honest are both enforced by the engine: every patient is lined up on a real clinical landmark rather than a study-specific day 0, and the denominator is who was still under observation — not the whole cohort.

MSK-CHORD, aligned on each patient's FIRST treatment, split by TP53 status. Treatment carries real start/stop dates so it is drawn as a state patients are IN; surgery has no duration, so it is the share with a surgery in that bin — a distinction read from the data's shape, not from the event's name. Note surgery peaking BEFORE time zero: resection typically precedes first systemic therapy. The at-risk row under the axis is the denominator, and it falls steeply — a curve read without it would be badly misleading.

msk_chord_20242 cohorts: TP53 mut, TP53 wt
document
{
  "study": "msk_chord_2024",
  "cohorts": {
    "TP53 mut": {
      "all": [
        {
          "kind": "oql",
          "q": "TP53: MUT"
        }
      ]
    },
    "TP53 wt": {
      "all": [
        {
          "not": {
            "kind": "oql",
            "q": "TP53:"
          }
        },
        {
          "kind": "profiled",
          "type": "MUTATION",
          "gene": "TP53"
        }
      ]
    }
  },
  "views": [
    {
      "kind": "course",
      "cohorts": [
        "TP53 mut",
        "TP53 wt"
      ],
      "eventTypes": [
        "treatment",
        "surgery"
      ],
      "anchor": {
        "eventType": "Treatment",
        "occurrence": "FIRST"
      },
      "binMonths": 3,
      "fromMonths": -12,
      "toMonths": 60
    }
  ]
}

A reusable workup: one template, retargeted in a single edit

comparecooccurrenceoncoprinttemplateparamsworkspacenotesmulti-view

The document as a SAVED WORKSPACE rather than a one-off query. Several figures, the analyst's own notes, and the gene panel and study lifted into parameters — so running the same workup on a different panel is one edit instead of the same list retyped in every view.

The gene list appears once, in `params`, and every view refers to it as `$genes`; the study likewise. Change either and all three figures follow. The rule is only that a value which is exactly "$name" is replaced by that parameter — no interpolation, no expressions — so the resolved document is an ordinary one and compiles to exactly the SQL you would get by typing the values in. A `$name` with no declaration is a loud error naming the path, and a parameter declared but never referenced is reported back, which is what catches a rename that missed a reference. `notes` and each view’s `note` travel with the document.

$study1 cohort: NSCLC
document
{
  "params": {
    "study": "msk_chord_2024",
    "genes": [
      "TP53",
      "KRAS",
      "STK11",
      "KEAP1",
      "EGFR"
    ]
  },
  "study": "$study",
  "title": "NSCLC driver workup",
  "notes": "Standard first pass at a driver panel: how often each gene is altered, whether the alterations travel together, and who carries them. Retarget by editing $genes.",
  "cohorts": {
    "NSCLC": {
      "all": [
        {
          "kind": "clinical",
          "attribute": "CANCER_TYPE",
          "values": [
            "Non-Small Cell Lung Cancer"
          ]
        }
      ]
    }
  },
  "views": [
    {
      "kind": "compare",
      "cohorts": [
        "NSCLC"
      ],
      "genes": "$genes",
      "note": "Frequencies first — the headline numbers."
    },
    {
      "kind": "cooccurrence",
      "cohorts": [
        "NSCLC"
      ],
      "genes": "$genes",
      "note": "Do these drivers co-occur, or exclude one another?"
    },
    {
      "kind": "oncoprint",
      "cohorts": [
        "NSCLC"
      ],
      "genes": "$genes"
    }
  ]
}

What comes after what: lines of therapy, and what ending a path meansNEW

sequencesankeytemporaltreatment-linescensoring

The question the clinical-course view CANNOT answer — that chart asks 'on treatment, yes or no', so a seamless switch between drugs never moves the line. And the reason a sequence diagram usually misleads: most paths end because the RECORD ends, not because the patient stopped, so the two endings are drawn as separate terminals.

MSK-CHORD therapy lines by TP53 status, 90-day gap, two panels on one scale. Read the grey blocks first, and read them as TWO things: the darker terminal is patients the study watched for at least a line gap who began no further therapy; the lighter one is patients whose records simply stop, about whom nothing can be concluded. Over half of all paths end censored — collapsing them together (as a plain Sankey does) would turn record-keeping into an apparent clinical decision. The real signal is in first line: TP53 wild-type receives far more hormone therapy than TP53-mutant, which is what hormone-receptor-positive disease looks like. Lines are the one definition every line count shares: systemic-therapy records only, so 'Prior Medications to MSK' (a provenance marker rather than a therapy), radiation and bone treatment are not lines — they co-occur with almost everything, so leaving them in would explode the combination space. The caption says which records were used; a document that wants them anyway says so with lineClasses.

msk_chord_20242 cohorts: TP53 mut, TP53 wt
document
{
  "study": "msk_chord_2024",
  "cohorts": {
    "TP53 mut": {
      "all": [
        {
          "kind": "oql",
          "q": "TP53: MUT"
        }
      ]
    },
    "TP53 wt": {
      "all": [
        {
          "not": {
            "kind": "oql",
            "q": "TP53:"
          }
        },
        {
          "kind": "profiled",
          "type": "MUTATION",
          "gene": "TP53"
        }
      ]
    }
  },
  "views": [
    {
      "kind": "sequence",
      "cohorts": [
        "TP53 mut",
        "TP53 wt"
      ],
      "labelKey": "SUBTYPE",
      "lineGap": 90,
      "maxSteps": 3,
      "topN": 8
    }
  ]
}

Lollipop plot: mutations by protein position, with a suppression floor

hotspotslollipopsuppression

Lollipop data, and the one place small cells genuinely bite: minCount is applied by each site BEFORE anything is returned, because a coordinator filtering what it already received is theatre.

Hotspots in colorectal cancer, drawn the way cBioPortal's mutation tab draws them: one stem per codon, its height the distinct patient + protein change pairs there, with the protein's Pfam domains on the backbone — so KRAS spikes at codons 12-13 and BRAF at V600. minCount is applied by each site before anything is returned — with it set to 3, a change carried by one or two patients never leaves the database holding it, which is where small-cell suppression belongs.

msk_chord_20241 cohort: CRC
document
{
  "study": "msk_chord_2024",
  "cohorts": {
    "CRC": {
      "all": [
        {
          "kind": "clinical",
          "attribute": "CANCER_TYPE",
          "values": [
            "Colorectal Cancer"
          ]
        }
      ]
    }
  },
  "views": [
    {
      "kind": "hotspots",
      "cohorts": [
        "CRC"
      ],
      "genes": [
        "KRAS",
        "BRAF",
        "PIK3CA",
        "TP53"
      ],
      "minCount": 3
    }
  ]
}

Co-expression from sums alone

coexpressionfederable

A correlation depends on the data only through six running totals, so it federates exactly — the pooled answer equals the centralized one rather than approximating it.

Pearson correlation between gene pairs in TCGA breast cancer. A correlation depends on the data only through six running totals, so each site can contribute without transmitting a single expression value — and because the totals add, the federated answer is exact rather than approximate. ERBB2/GRB7 (adjacent on the 17q12 amplicon) comes out near 0.87.

brca_tcga_pan_can_atlas_20181 cohort: BRCA
document
{
  "study": "brca_tcga_pan_can_atlas_2018",
  "cohorts": {
    "BRCA": {
      "all": [
        {
          "kind": "profiled",
          "type": "MUTATION"
        }
      ]
    }
  },
  "views": [
    {
      "kind": "coexpression",
      "cohorts": [
        "BRCA"
      ],
      "profileType": "rna_seq_v2_mrna_median_Zscores",
      "genes": [
        "ERBB2",
        "GRB7",
        "ESR1",
        "PGR",
        "MKI67"
      ]
    }
  ]
}

Clinical attributes compared between cohorts

clinicalfederable

Welch's t from (n, sum, sum of squares): three additive totals per site, so pooled mean and variance are exact and no individual value is transmitted.

How TP53-mutant and wild-type tumors differ clinically. Categorical attributes are compared with a chi-squared over the full value vocabulary; numeric ones with Welch's t computed from three additive totals per site (n, sum, sum of squares) rather than from any transmitted value. An attribute the study does not declare is reported as skipped, not silently dropped.

msk_chord_20242 cohorts: TP53 mut, TP53 wt
document
{
  "study": "msk_chord_2024",
  "cohorts": {
    "TP53 mut": {
      "all": [
        {
          "kind": "oql",
          "q": "TP53: MUT"
        }
      ]
    },
    "TP53 wt": {
      "all": [
        {
          "not": {
            "kind": "oql",
            "q": "TP53:"
          }
        },
        {
          "kind": "profiled",
          "type": "MUTATION",
          "gene": "TP53"
        }
      ]
    }
  },
  "views": [
    {
      "kind": "clinical",
      "cohorts": [
        "TP53 mut",
        "TP53 wt"
      ],
      "attributes": [
        "CANCER_TYPE",
        "SMOKING_PREDICTIONS_3_CLASSES",
        "CURRENT_AGE_DEID",
        "TMB_NONSYNONYMOUS",
        "FRACTION_GENOME_ALTERED"
      ]
    }
  ]
}

Co-occurrence and mutual exclusivity in NSCLC

cooccurrencefederable

Four counts per gene pair per site. Denominators are the patients each site's OWN panels profiled for both genes — something pooled exports get wrong.

Pairwise associations among lung cancer driver genes. Each site returns four counts per pair — both altered, one, the other, neither — among the patients its own panels profiled for BOTH genes, and nothing else; the coordinator does the inference. Reproduces the textbook pattern: STK11/KEAP1 co-occur, EGFR/KRAS and EGFR/ALK are mutually exclusive.

msk_chord_20241 cohort: NSCLC
document
{
  "study": "msk_chord_2024",
  "cohorts": {
    "NSCLC": {
      "all": [
        {
          "kind": "clinical",
          "attribute": "CANCER_TYPE",
          "values": [
            "Non-Small Cell Lung Cancer"
          ]
        }
      ]
    }
  },
  "views": [
    {
      "kind": "cooccurrence",
      "cohorts": [
        "NSCLC"
      ],
      "genes": [
        "EGFR",
        "KRAS",
        "TP53",
        "STK11",
        "KEAP1",
        "ALK"
      ]
    }
  ]
}

Survival from first chemotherapy, left-truncated

survivaltimeline-eventstemporalleft-truncationanchor

Re-anchoring the survival clock to a timeline event, and the correction that makes it honest. The study measures OS from its own day 0 (first sequencing); anchoring at first chemotherapy moves the clock earlier, so patients are unobservable until day 0 and enter the risk set then — without that, every patient would appear to survive from chemotherapy to sequencing, which is precisely what got them into the study.

TP53-mutant vs wild-type, overall survival measured from each patient's first chemotherapy rather than from sequencing. Patients whose first chemotherapy falls after day 0, or who never had chemotherapy, are excluded rather than given negative follow-up. The result reports how long after the anchor patients became observable, so an anchor that is matching earlier events than intended shows up as a long tail.

msk_chord_20242 cohorts: TP53 mut, TP53 wt
document
{
  "study": "msk_chord_2024",
  "cohorts": {
    "TP53 mut": {
      "all": [
        {
          "kind": "oql",
          "q": "TP53: MUT"
        }
      ]
    },
    "TP53 wt": {
      "all": [
        {
          "not": {
            "kind": "oql",
            "q": "TP53:"
          }
        },
        {
          "kind": "profiled",
          "type": "MUTATION",
          "gene": "TP53"
        }
      ]
    }
  },
  "views": [
    {
      "kind": "survival",
      "cohorts": [
        "TP53 mut",
        "TP53 wt"
      ],
      "anchor": {
        "eventType": "Treatment",
        "key": "SUBTYPE",
        "value": "Chemo",
        "occurrence": "FIRST"
      }
    }
  ]
}

Study-stratified survival across two studies

survivalfederationlog-rankstratified

The log-rank statistic is a sum over strata, so sites can BE the strata — which is better methodology than pooling, not merely more private.

TP53-mutant vs wild-type, each cohort spanning two studies. Every site answers with (months, event, n) counts only — no survival time for any individual crosses an instance boundary — and because the log-rank statistic is a sum over strata, those counts are enough to compute the test STRATIFIED by study: each study is compared only against itself. The unstratified pooled p is reported alongside, since the two can disagree when case mix differs between sites.

2 studies2 cohorts: TP53 mut, TP53 wt
document
{
  "study": "msk_chord_2024",
  "cohorts": {
    "TP53 mut": {
      "studies": [
        "msk_chord_2024",
        "msk_met_2021"
      ],
      "all": [
        {
          "kind": "oql",
          "q": "TP53: MUT"
        }
      ]
    },
    "TP53 wt": {
      "studies": [
        "msk_chord_2024",
        "msk_met_2021"
      ],
      "all": [
        {
          "not": {
            "kind": "oql",
            "q": "TP53:"
          }
        },
        {
          "kind": "profiled",
          "type": "MUTATION",
          "gene": "TP53"
        }
      ]
    }
  },
  "views": [
    {
      "kind": "survival",
      "cohorts": [
        "TP53 mut",
        "TP53 wt"
      ]
    }
  ]
}

extends: a nested cohort without repeating its parent's filter

comparecohort-structureextends

A cohort inheriting another's `all` clauses instead of copy-pasting them, so editing the base cohort updates every cohort built on it. `extends` is resolved before compilation, so the compiled SQL and this comparison's counts are identical to writing the APC clause out twice by hand.

APC-mutant colorectal cancer, then the same population restricted to liver metastasis — without re-stating the APC clause. `compare` shows both share the same APC-mutant base, so a difference between them is attributable to the liver-mets split, not to two independently-typed cohort definitions quietly drifting apart.

crc_apc_impact_20202 cohorts: APC-mutant, APC-mutant, liver mets
document
{
  "study": "crc_apc_impact_2020",
  "cohorts": {
    "APC-mutant": {
      "all": [
        {
          "kind": "oql",
          "q": "APC: MUT"
        }
      ]
    },
    "APC-mutant, liver mets": {
      "extends": "APC-mutant",
      "all": [
        {
          "kind": "clinical",
          "attribute": "METASTASIS_LIVER",
          "values": [
            "Yes"
          ]
        }
      ]
    }
  },
  "views": [
    {
      "kind": "compare",
      "cohorts": [
        "APC-mutant",
        "APC-mutant, liver mets"
      ],
      "genes": [
        "TP53",
        "KRAS",
        "PIK3CA"
      ]
    }
  ]
}

Splits: a cohort divided into arms that add up to it

comparesurvivalcohort-structuresplits

A cohort's `splits` divide it into child cohorts that are disjoint and together exactly the parent: arms are tested in order and the first match wins, patients matching none go to a remainder, and patients an arm cannot be decided for (here, not profiled for KRAS) get their own child instead of being counted as wild-type. The result checks that the children add up to the parent; a view naming the split compares its arms.

Non-small cell lung cancer split by KRAS allele: G12C first, then any other KRAS mutation, then wild-type. Because G12C is tested first, "other KRAS" needs no hand-written "and not G12C". 916 + 1,278 + 5,615 = 7,809, the whole cohort, with nobody unprofiled for KRAS in this study. STK11 and KEAP1 are enriched in both KRAS-mutant arms and TP53 in wild-type — the known co-mutation pattern — while overall survival does not differ significantly across the three arms (k-group log-rank p≈0.1).

msk_chord_20241 cohort: NSCLC
document
{
  "study": "msk_chord_2024",
  "cohorts": {
    "NSCLC": {
      "all": [
        {
          "kind": "clinical",
          "attribute": "CANCER_TYPE",
          "values": [
            "Non-Small Cell Lung Cancer"
          ]
        }
      ],
      "splits": {
        "KRAS allele": {
          "other": "KRAS wild-type",
          "arms": [
            {
              "name": "G12C",
              "where": {
                "kind": "oql",
                "q": "KRAS: G12C"
              }
            },
            {
              "name": "other KRAS",
              "where": {
                "kind": "oql",
                "q": "KRAS: MUT"
              }
            }
          ]
        }
      }
    }
  },
  "views": [
    {
      "kind": "compare",
      "genes": [
        "STK11",
        "KEAP1",
        "TP53"
      ],
      "cohorts": [
        "NSCLC / KRAS allele"
      ]
    },
    {
      "kind": "survival",
      "cohorts": [
        "NSCLC / KRAS allele"
      ]
    }
  ]
}

Median/IQR and a rank-sum test, single-study only

clinicalmedianrank-sumsingle-study

Why a second test earns its place: MSI_SCORE is right-skewed here, so Welch's t (which compares means) calls it significant while the Mann-Whitney rank-sum (which compares typical values) does not — the mean is being pulled by a few high-MSI outliers, not by a real shift in the bulk of each group. Both are shown; neither is hidden in favour of the other.

APC-mutant colorectal cancer, split by liver metastasis. Alongside mean/SD, numeric attributes report an exact median/IQR and a Mann-Whitney U — available here only because both cohorts stay within one study (crc_apc_impact_2020): median and rank are not additive across sites the way (n, Σx, Σx²) is, so this is refused rather than approximated the moment a cohort spans more than one study.

crc_apc_impact_20202 cohorts: liver mets, no liver mets
document
{
  "study": "crc_apc_impact_2020",
  "cohorts": {
    "liver mets": {
      "all": [
        {
          "kind": "oql",
          "q": "APC: MUT"
        },
        {
          "kind": "clinical",
          "attribute": "METASTASIS_LIVER",
          "values": [
            "Yes"
          ]
        }
      ]
    },
    "no liver mets": {
      "all": [
        {
          "kind": "oql",
          "q": "APC: MUT"
        },
        {
          "kind": "clinical",
          "attribute": "METASTASIS_LIVER",
          "values": [
            "No"
          ]
        }
      ]
    }
  },
  "views": [
    {
      "kind": "clinical",
      "cohorts": [
        "liver mets",
        "no liver mets"
      ],
      "attributes": [
        "MSI_SCORE",
        "AGE_AT_MET"
      ]
    }
  ]
}

Cox with a gene-SET covariate: any of three genes, one termNEW

coxgene-setsforest-plot

A Cox covariate naming a gene SET (`genes`, not `gene`) instead of one gene at a time — "is any of TP53/KRAS/PIK3CA mutated" as a single pathway-style term, the way a paper actually reasons about a gene panel, without fitting one covariate per gene.

Every patient in the study, one term: mutated in any of TP53/KRAS/PIK3CA versus none of them. Compiles to a single hugo_gene_symbol IN (...) — the same shape as a single-gene covariate, just with a broader gene list, so it costs nothing extra downstream (dummy-coding, the forest plot, the reference-level override all just work).

crc_apc_impact_20201 cohort: all patients
document
{
  "study": "crc_apc_impact_2020",
  "cohorts": {
    "all patients": {
      "all": []
    }
  },
  "views": [
    {
      "kind": "cox",
      "cohorts": [
        "all patients"
      ],
      "endpoint": "OS",
      "covariates": [
        {
          "source": "alteration",
          "genes": [
            "TP53",
            "KRAS",
            "PIK3CA"
          ]
        }
      ]
    }
  ]
}

Cox stratified by cohort: does a gene's hazard ratio hold up in both arms?NEW

coxforest-plotstratified

`stratifyByCohort` fits each named cohort as its own independent Cox model instead of pooling them — the right tool when a covariate's EFFECT, not just the case mix, might genuinely differ between cohorts. The forest plot draws one panel per cohort on a shared hazard-ratio scale, so the difference (or agreement) is visible directly rather than averaged away.

APC mutation status regressed on overall survival, separately in the MSI-high and MSS arms of the same study. Pooled, APC reads HR=0.61 (95% CI 0.48-0.78) — a real effect, but stratifying shows it is almost entirely a microsatellite-stable-population effect (MSS: HR=0.54, p<0.0001) that does not reach significance in the small MSI-high arm (HR=0.87, 95% CI 0.31-2.44, n=27) — a pooled fit alone would not have shown that the effect is concentrated in one subgroup.

crc_apc_impact_20202 cohorts: MSI-high, MSS
document
{
  "study": "crc_apc_impact_2020",
  "cohorts": {
    "MSI-high": {
      "all": [
        {
          "kind": "clinical",
          "attribute": "MSI_TYPE",
          "op": "=",
          "value": "Instable"
        }
      ]
    },
    "MSS": {
      "all": [
        {
          "kind": "clinical",
          "attribute": "MSI_TYPE",
          "op": "=",
          "value": "Stable"
        }
      ]
    }
  },
  "views": [
    {
      "kind": "cox",
      "cohorts": [
        "MSI-high",
        "MSS"
      ],
      "covariates": [
        {
          "source": "alteration",
          "gene": "APC",
          "by": "mutated"
        }
      ],
      "stratifyByCohort": true
    }
  ]
}

Logistic regression: does APC status predict MSI-high status?NEW

logisticforest-plotodds-ratio

A `logistic` view: a BINARY outcome regressed on covariates, reported as odds ratios — the same forest-plot shape as `cox`, but for "did X happen" rather than "when did X happen", so there's no endpoint/months convention. `outcomeEvent` says which observed value of a categorical outcome is the event; every other observed value is disclosed as collapsed into "not event" rather than silently merged.

MSI_TYPE = Instable (vs every other observed value: Stable, Indeterminate, Do not report) regressed on APC mutation status. APC-mutant patients have substantially lower odds of MSI-high status (OR=0.28, 95% CI 0.13-0.63, p=0.0018) — consistent with APC-driven CRC typically arising through the chromosomal-instability pathway rather than the mismatch-repair-deficient pathway MSI-high status marks.

crc_apc_impact_20201 cohort: all patients
document
{
  "study": "crc_apc_impact_2020",
  "cohorts": {
    "all patients": {
      "all": []
    }
  },
  "views": [
    {
      "kind": "logistic",
      "cohorts": [
        "all patients"
      ],
      "outcome": {
        "source": "clinical",
        "attribute": "MSI_TYPE"
      },
      "outcomeEvent": "Instable",
      "covariates": [
        {
          "source": "alteration",
          "gene": "APC",
          "by": "mutated"
        }
      ]
    }
  ]
}

Pan-cancer forest: TP53 mutation and survival in 30 cancer typesNEW

forestforest-plotmeta-analysispan-cancer

A `forest` view: one exposure's hazard ratio fit by Cox regression within each cancer type, then pooled by a DerSimonian–Laird random-effects meta-analysis (and the fixed-effect estimate), with τ², I² and Cochran's Q. Patients not profiled for the gene are left out, never counted as wild type; cancer types under 30 patients or 10 deaths are pooled into one disclosed "Other" row, each with its own baseline hazard.

TP53 mutation against overall survival across MSK-IMPACT 50K. TP53-mutant patients die sooner in almost every cancer type — prostate (HR 2.5), endometrial (2.9), thyroid (4.1) — but not in glioma (0.86) or melanoma (0.78), where TP53 marks better-prognosis subtypes. Pooled, the random-effects HR is 1.63 (1.42–1.87), but I² is 93%: the cancer types disagree far beyond chance, so the pooled number is an average over different effects, not one effect.

msk_impact_50k_20261 cohort: all patients
document
{
  "study": "msk_impact_50k_2026",
  "cohorts": {
    "all patients": {
      "all": []
    }
  },
  "views": [
    {
      "kind": "forest",
      "cohorts": [
        "all patients"
      ],
      "exposure": {
        "source": "alteration",
        "gene": "TP53"
      },
      "strata": "CANCER_TYPE"
    }
  ]
}

Adjusted enrichment: early-onset colorectal cancer, adjusted for MSI and TMBNEW

adjustedcovariatesvolcanoearly-onset

An `adjusted` view: every gene mutated in at least 5% of the patients profiled for it, compared between two cohorts by a logistic regression of mutated on cohort and covariates (here MSI status and tumour mutation burden), its adjusted odds ratio beside the raw one and the Fisher test, Benjamini–Hochberg q on the adjusted p. Panel-aware per gene: a patient whose panel omits a gene is left out of that gene.

Colorectal cancers in MSK-IMPACT 50K diagnosed before 50 against at 50 or later. Early-onset tumours carry BRAF less often (7.4% against 12.9%; adjusted OR 0.52) and RNF43 less often (0.66), and TP53 (77% against 72%; 1.31) and TCF7L2 (1.40) more often — 4 of 56 genes at q < 0.05 once MSI status and TMB are adjusted for, as in Cercek et al. (JNCI 2021).

msk_impact_50k_20262 cohorts: Early-onset CRC, Average-onset CRC
document
{
  "study": "msk_impact_50k_2026",
  "cohorts": {
    "Early-onset CRC": {
      "all": [
        {
          "kind": "clinical",
          "attribute": "CANCER_TYPE",
          "values": [
            "Colorectal Cancer"
          ]
        },
        {
          "kind": "clinical",
          "attribute": "AGE_AT_DX",
          "op": "<",
          "value": 50
        }
      ]
    },
    "Average-onset CRC": {
      "all": [
        {
          "kind": "clinical",
          "attribute": "CANCER_TYPE",
          "values": [
            "Colorectal Cancer"
          ]
        },
        {
          "kind": "clinical",
          "attribute": "AGE_AT_DX",
          "op": ">=",
          "value": 50
        }
      ]
    }
  },
  "views": [
    {
      "kind": "adjusted",
      "cohorts": [
        "Early-onset CRC",
        "Average-onset CRC"
      ],
      "covariates": [
        "MSI_TYPE",
        "TMB_SCORE"
      ]
    }
  ]
}

Clinical actionability: OncoKB levels across 50,000 tumours, and primary against metastasisNEW

actionabilityoncokbprecision-oncologypan-cancer

An `actionability` view: each sequenced patient's highest OncoKB therapeutic level (1, 2, 3A, 3B, 4) and any resistance level over their mutations and copy-number calls, read from the version-pinned store, as stacked bars per cancer type (the largest eight, the rest pooled into a named Other); and for patients with both a primary and a metastatic sample sequenced, the cross-table of their highest level on each side. The store's levels are not cancer-type specific, so the bars are an upper bound — the caveat says so.

MSK-IMPACT 50K by cancer type. Because a level is the store's best for the alteration in any cancer type, KRAS-mutant pancreatic cancers count at level 1 (87%) and as R1: an upper bound, not a treatment rate. Of the 2,278 patients with a primary and a metastasis sequenced, 25.5% have a different highest level in the two.

msk_impact_50k_20261 cohort: all patients
document
{
  "study": "msk_impact_50k_2026",
  "cohorts": {
    "all patients": {
      "all": []
    }
  },
  "views": [
    {
      "kind": "actionability",
      "cohorts": [
        "all patients"
      ],
      "groupBy": "CANCER_TYPE",
      "top": 8
    }
  ]
}

Driver-negative lung cancer: what is mutated when no canonical driver isNEW

drivernegativedriversvolcanonsclc

A `drivernegative` view: one cohort split into patients with an OncoKB driver in a canonical driver list (here the default NSCLC set: EGFR, KRAS, ALK, ROS1, BRAF, MET, RET, ERBB2, NTRK1–3), patients with none who were profiled for every listed gene, and those not fully profiled (neither side); then every other gene's mutation frequency in patients compared between driver-negative and driver-positive, Fisher per gene and Benjamini–Hochberg across genes.

Non-small cell lung cancer in MSK-CHORD. 2,898 of 7,809 patients (37.1%) carry none of the eleven drivers. Their tumours carry NF1 (12.4% against 5.0%), NFE2L2, KEAP1, RASA1, MAP2K1 and NRAS mutations more often — other routes into the same MAPK and oxidative-stress pathways — while RBM10 goes with the drivers.

msk_chord_20241 cohort: NSCLC
document
{
  "study": "msk_chord_2024",
  "cohorts": {
    "NSCLC": {
      "all": [
        {
          "kind": "clinical",
          "attribute": "CANCER_TYPE",
          "values": [
            "Non-Small Cell Lung Cancer"
          ]
        }
      ]
    }
  },
  "views": [
    {
      "kind": "drivernegative",
      "cohorts": [
        "NSCLC"
      ]
    }
  ]
}

Metastatic organotropism: which mutations go with spread to which organ (MSK-MET)NEW

organotropismmetastasisheatmappan-cancer

An `organotropism` view: per-organ metastasis flags (MSK-MET's DMETS_DX_<site>, Yes / No) crossed with the twelve most often mutated genes (OncoKB drivers), each cell a Cochran–Mantel–Haenszel test stratified by cancer type with the Mantel–Haenszel odds ratio, Benjamini–Hochberg over the grid — panel-aware, so a patient not profiled for a gene is in neither group.

25,775 patients in MSK-MET (Nguyen et al., Cell 2022). Within cancer types, TP53 goes with metastasis to nearly every organ (liver odds ratio 1.45), EGFR with the brain (1.63), bone and peripheral nerves, APC with liver and lung, and PTEN and ARID1A with less peritoneal and liver spread — the paper's organotropism map from counts alone.

msk_met_20211 cohort: all patients
document
{
  "study": "msk_met_2021",
  "cohorts": {
    "all patients": {
      "all": []
    }
  },
  "views": [
    {
      "kind": "organotropism",
      "cohorts": [
        "all patients"
      ]
    }
  ]
}

Brain metastasis in lung cancer by EGFR, from dated tumour sitesNEW

organotropismmetastasiscompeting-risksnsclc

An `organotropism` view on timeline sites (MSK-CHORD's Diagnosis events, TUMOR_SITE from radiology reports): a gene × site heatmap for six lung-cancer genes, and the cumulative incidence of a first CNS/brain site after the timeline's day 0 for EGFR-mutant against EGFR-wild-type patients, death as a competing risk (Aalen–Johansen, Gray's test).

Non-small cell lung cancer in MSK-CHORD. EGFR-mutant tumours carry brain sites more often (OR 1.7) and gain them faster after sequencing: 32% by five years against 23%, Gray's p < 0.001; STK11, KEAP1 and SMARCA4 go with adrenal spread.

msk_chord_20241 cohort: NSCLC
document
{
  "study": "msk_chord_2024",
  "cohorts": {
    "NSCLC": {
      "all": [
        {
          "kind": "clinical",
          "attribute": "CANCER_TYPE",
          "values": [
            "Non-Small Cell Lung Cancer"
          ]
        }
      ]
    }
  },
  "views": [
    {
      "kind": "organotropism",
      "cohorts": [
        "NSCLC"
      ],
      "source": "timeline",
      "genes": [
        "EGFR",
        "KRAS",
        "TP53",
        "STK11",
        "KEAP1",
        "SMARCA4"
      ],
      "incidence": {
        "site": "CNS/Brain",
        "gene": "EGFR"
      }
    }
  ]
}

Endometrial cancer molecular subtypes by genetic ancestry (POLE, MMRd, p53abn, NSMP)NEW

molsubtypeendometrialclassifierancestry

A `molsubtype` view: the endometrial molecular classification (TCGA 2013 / ProMisE / WHO 2020) applied to each patient in its hierarchy — a POLE exonuclease-domain hotspot, else MSI-high (MSI_TYPE), else an OncoKB-driver TP53 mutation, else no specific molecular profile — with patients missing an input counted as not classifiable; subtype shares by ANCESTRY_LABEL (chi-squared) and overall survival by subtype (log-rank).

2,373 endometrial cancers in MSK-IMPACT 50K; 196 have no MSI call. p53-abnormal tumours are 71% of classified patients of African ancestry against 34% of non-Ashkenazi European (as in Weigelt et al. on Black and White patients, PMID 37651310), and survival separates as published: POLE-ultramutated best, p53-abnormal worst (median 29.6 months).

msk_impact_50k_20261 cohort: Endometrial
document
{
  "study": "msk_impact_50k_2026",
  "cohorts": {
    "Endometrial": {
      "all": [
        {
          "kind": "clinical",
          "attribute": "CANCER_TYPE",
          "values": [
            "Endometrial Cancer"
          ]
        }
      ]
    }
  },
  "views": [
    {
      "kind": "molsubtype",
      "cohorts": [
        "Endometrial"
      ],
      "by": "ANCESTRY_LABEL"
    }
  ]
}

The endometrial classifier against TCGA's own molecular subtypesNEW

molsubtypeendometrialclassifiertcga

A `molsubtype` view on TCGA's uterine cohort, where the MSI call is the MSIsensor score (MSI_SENSOR_SCORE, ≥ 10 MSI-high, < 3 stable) and the subtypes are crossed with TCGA's published integrated subtypes (the SUBTYPE attribute) — a check of the panel-based classifier against the original.

Of TCGA's 49 POLE tumours 48 are called POLE-ultramutated, 122 of 126 MSI tumours MMR-deficient, 139 of 161 copy-number-high p53-abnormal, and 135 of 145 copy-number-low NSMP.

ucec_tcga_pan_can_atlas_20181 cohort: UCEC
document
{
  "study": "ucec_tcga_pan_can_atlas_2018",
  "cohorts": {
    "UCEC": {
      "all": []
    }
  },
  "views": [
    {
      "kind": "molsubtype",
      "cohorts": [
        "UCEC"
      ],
      "by": "SUBTYPE"
    }
  ]
}

Germline carriers in metastatic prostate cancer, and their tumours' second hitsNEW

germlineinheritedsecond-hitprostate

A `germline` view: per gene with at least two germline carriers (mutations the study marks GERMLINE), the carriers among patients sequenced for the gene, and the share whose tumour carries a somatic second hit in the same gene (another mutation or a deep deletion) against the somatic rate in non-carriers, Fisher per gene with Benjamini–Hochberg; overall survival of BRCA2 carriers against non-carriers.

SU2C/PCF metastatic castration-resistant prostate cancer (Abida et al. 2019), one of the few public studies that deposit germline calls. 17 of 429 patients (4.0%) carry a germline BRCA2 variant, 3 of them with a second somatic BRCA2 mutation against 7.3% of non-carriers; 2 of 6 BRCA1 carriers against 0.5% (q 0.005). Loss of heterozygosity is not assessed, so these are floors. Only 128 patients have OS recorded.

prad_su2c_20191 cohort: mCRPC
document
{
  "study": "prad_su2c_2019",
  "cohorts": {
    "mCRPC": {
      "all": []
    }
  },
  "views": [
    {
      "kind": "germline",
      "cohorts": [
        "mCRPC"
      ],
      "minCarriers": 2,
      "survival": {
        "gene": "BRCA2"
      }
    }
  ]
}

splitBy: one cohort, auto-split into an arm per receptor subtype

comparesplitBycohort-structure

`splitBy` turns one named cohort into an arm per distinct value of a categorical attribute, live from the data, instead of hand-writing one cohort per value. The arms are scoped to this one view — they never touch the document's own cohort list — but still carry full provenance (each arm's own compiled count/SQL) in the result.

"all patients" split by RECEPTOR_STATUS_PRIMARY gives the same 4 clinically standard subtypes a hand-written 4-cohort document would (HR+/HER2-, Triple Negative, HR+/HER2+, HR-/HER2+), plus a few small ones this study also records (HR+/HER2_Unknown, Unk/ND, HR+/HER2_Equivocal) — all within the default 8-arm cap, so nothing here needs pooling into "Other". TP53 reads 26.8%/90.4%/49.2%/77% across the four main subtypes, matching the published literature on triple-negative breast cancer's markedly higher TP53 mutation rate.

breast_msk_20181 cohort: all patients
document
{
  "study": "breast_msk_2018",
  "cohorts": {
    "all patients": {
      "all": []
    }
  },
  "views": [
    {
      "kind": "compare",
      "genes": [
        "TP53",
        "PIK3CA"
      ],
      "splitBy": {
        "cohort": "all patients",
        "attribute": "RECEPTOR_STATUS_PRIMARY"
      }
    }
  ]
}

splitBy: gene mutation status, without hand-writing the mutant/wildtype pair

survivalsplitBylog-rank

splitBy's second shape — `{cohort, gene}` — makes the same one-view, never-touches-the-document's-cohort-list arms as the attribute shape, but for a gene's mutation status: exactly two arms, no live query needed to know their names in advance (unlike an attribute's values, which must be discovered from the data).

"all patients" split by APC mutation status gives the same two arms a hand-written {"kind":"oql","q":"APC: MUT"} cohort pair would (325 mutant, 146 wildtype) — APC-mutant patients have better overall survival (median 25.6mo vs 17.9mo, log-rank p=9.1e-5), matching this study's own headline finding (see the crc_apc_impact_2020 Cox example above) from a single view, no separate cohorts to define.

crc_apc_impact_20201 cohort: all patients
document
{
  "study": "crc_apc_impact_2020",
  "cohorts": {
    "all patients": {
      "all": []
    }
  },
  "views": [
    {
      "kind": "survival",
      "splitBy": {
        "cohort": "all patients",
        "gene": "APC"
      }
    }
  ]
}

splitBy: a list of OQL queries, arms that overlap and a disclosed "Other"

comparesplitByOQL

splitBy's third shape — `{cohort, oql}` — reaches anything OQL can express, not just one gene's plain mutation status: each query becomes its own arm, named from the query text. Arms are not forced into a partition — a patient matching more than one query counts toward each — so the result discloses `overlapCount`; anyone matching none of the queries falls into an "Other" arm alongside the named ones.

"all patients" split by ["TP53: MUT", "KRAS: MUT"] gives 13,105 TP53-mutant, 7,115 KRAS-mutant, and 9,019 in neither ("Other") — summing to more than the 24,950-patient base cohort because 4,289 patients carry both mutations, which the result discloses as `splitBy.overlapCount` rather than leaving the arm counts to look inconsistent on their own (13,105 + 7,115 − 4,289 + 9,019 = 24,950, exactly the base count).

msk_chord_20241 cohort: all patients
document
{
  "study": "msk_chord_2024",
  "cohorts": {
    "all patients": {
      "all": []
    }
  },
  "views": [
    {
      "kind": "compare",
      "genes": [
        "TP53",
        "KRAS"
      ],
      "splitBy": {
        "cohort": "all patients",
        "oql": [
          "TP53: MUT",
          "KRAS: MUT"
        ]
      }
    }
  ]
}

Survival split three ways: the k-group log-rank

survivallog-rankk-group

3+ cohorts in a survival view now get a real test — the k-group log-rank generalization (a (k-1)-df chi-squared from the full covariance matrix, the same statistic R's survdiff() reports) — instead of only a picture with no way to say whether the split is real.

MSI status in three groups (stable / instable / indeterminate) instead of the usual two-arm split. The test asks whether the three curves differ AT ALL, not which pair does — a different question from running the 2-arm test three times pairwise, which would need its own multiple-testing correction.

crc_apc_impact_20203 cohorts: stable, instable, indeterminate
document
{
  "study": "crc_apc_impact_2020",
  "cohorts": {
    "stable": {
      "all": [
        {
          "kind": "clinical",
          "attribute": "MSI_TYPE",
          "values": [
            "Stable"
          ]
        }
      ]
    },
    "instable": {
      "all": [
        {
          "kind": "clinical",
          "attribute": "MSI_TYPE",
          "values": [
            "Instable"
          ]
        }
      ]
    },
    "indeterminate": {
      "all": [
        {
          "kind": "clinical",
          "attribute": "MSI_TYPE",
          "values": [
            "Indeterminate",
            "Do not report"
          ]
        }
      ]
    }
  },
  "views": [
    {
      "kind": "survival",
      "cohorts": [
        "stable",
        "instable",
        "indeterminate"
      ]
    }
  ]
}

A missing alteration type is disclosed, never a false negative

comparepanel-awaredata-quality

sarcoma_msk_2022 has no copy-number data at all (0 of 7,494 samples). MDM2 amplification is well-differentiated liposarcoma's defining alteration, so a naive tool would report 0% altered here and look confidently wrong. This one instead says so.

TP53 (a real mutation hotspot here) and MDM2 (never assayed for copy-number in this study) side by side. Both show 0%-or-real altered figures, but only the view's note — and each cell's per-type breakdown (mutation/CNA/structural-variant counts, visible on hover in the app) — reveals that MDM2's 0% means "never checked" while TP53's is a real, profiled result.

sarcoma_msk_20221 cohort: Well-diff liposarcoma
document
{
  "study": "sarcoma_msk_2022",
  "cohorts": {
    "Well-diff liposarcoma": {
      "all": [
        {
          "kind": "clinical",
          "attribute": "CANCER_TYPE_DETAILED",
          "values": [
            "Well-Differentiated Liposarcoma"
          ]
        }
      ]
    }
  },
  "views": [
    {
      "kind": "compare",
      "cohorts": [
        "Well-diff liposarcoma"
      ],
      "genes": [
        "MDM2",
        "TP53"
      ]
    }
  ]
}

Four receptor subtypes, one real test: Welch's ANOVA

clinicalanovakruskal-wallisk-group

A numeric attribute compared across 3+ cohorts now gets a real test (Welch's ANOVA, plus Kruskal-Wallis alongside it since this stays within one study) instead of being skipped outright — the same k-group treatment this DSL's categorical and survival tests already got.

Breast cancer's four receptor subtypes, compared on genomic instability (FRACTION_GENOME_ALTERED) and mutation burden (TMB_NONSYNONYMOUS). Triple-negative's markedly higher genomic instability is exactly the known biology, and both the parametric (ANOVA) and rank-based (Kruskal-Wallis) tests agree emphatically; TMB does not differ significantly by subtype here, and again both tests agree.

breast_msk_20184 cohorts: HR+/HER2-, TNBC, HR+/HER2+, HR-/HER2+
document
{
  "study": "breast_msk_2018",
  "cohorts": {
    "HR+/HER2-": {
      "all": [
        {
          "kind": "clinical",
          "attribute": "RECEPTOR_STATUS_PRIMARY",
          "values": [
            "HR+/HER2-"
          ]
        }
      ]
    },
    "TNBC": {
      "all": [
        {
          "kind": "clinical",
          "attribute": "RECEPTOR_STATUS_PRIMARY",
          "values": [
            "Triple Negative"
          ]
        }
      ]
    },
    "HR+/HER2+": {
      "all": [
        {
          "kind": "clinical",
          "attribute": "RECEPTOR_STATUS_PRIMARY",
          "values": [
            "HR+/HER2+"
          ]
        }
      ]
    },
    "HR-/HER2+": {
      "all": [
        {
          "kind": "clinical",
          "attribute": "RECEPTOR_STATUS_PRIMARY",
          "values": [
            "HR-/HER2+"
          ]
        }
      ]
    }
  },
  "views": [
    {
      "kind": "clinical",
      "cohorts": [
        "HR+/HER2-",
        "TNBC",
        "HR+/HER2+",
        "HR-/HER2+"
      ],
      "attributes": [
        "TMB_NONSYNONYMOUS",
        "FRACTION_GENOME_ALTERED"
      ]
    }
  ]
}

A non-standard survival endpoint, named directly

survivalendpointdata-quality

ucec_msk_2018 declares no <X>_MONTHS/<X>_STATUS pair at all — its outcome lives in PFS_MONTHS_FIRST_LINE_TX/PROGRESSION_STATUS instead, so the usual endpoint prefix shorthand finds nothing. monthsAttribute/statusAttribute name the real columns directly.

MSI-H vs MSS endometrial cancer, progression-free survival from first-line treatment — the study's actual recorded outcome, reachable only because the exact column names are given rather than assumed from an OS/PFS/DFS-style prefix.

ucec_msk_20182 cohorts: MSI-H, MSS
document
{
  "study": "ucec_msk_2018",
  "cohorts": {
    "MSI-H": {
      "all": [
        {
          "kind": "clinical",
          "attribute": "MSI_STATUS",
          "values": [
            "MSI-H"
          ]
        }
      ]
    },
    "MSS": {
      "all": [
        {
          "kind": "clinical",
          "attribute": "MSI_STATUS",
          "values": [
            "MSS"
          ]
        }
      ]
    }
  },
  "views": [
    {
      "kind": "survival",
      "cohorts": [
        "MSI-H",
        "MSS"
      ],
      "endpoint": "PFS_1L",
      "monthsAttribute": "PFS_MONTHS_FIRST_LINE_TX",
      "statusAttribute": "PROGRESSION_STATUS"
    }
  ]
}

Top 20% TMB, within one cancer type: a percentile cutoff

survivalpercentilecutoff

Reproducing Samstein et al.'s TMB-and-immunotherapy finding needed "the top 20% of TMB, specifically among NSCLC patients" — a cancer-type-specific percentile, not a hardcoded number. percentileOf scopes the live-resolved threshold to another cohort in this document instead of the whole (pan-cancer) study.

tmb_mskcc_2018 is pan-cancer, so a plain percentile would mix histologies with very different baseline TMB. "NSCLC high-TMB"/"NSCLC low-TMB" both restrict to NSCLC first, then split on whether TMB is at or above the 80th percentile COMPUTED WITHIN THAT NSCLC POPULATION (percentileOf:"NSCLC") — the readback shows the resolved number and what it was a percentile of, not just a bare threshold.

tmb_mskcc_20183 cohorts: NSCLC, NSCLC high-TMB, NSCLC low-TMB
document
{
  "study": "tmb_mskcc_2018",
  "cohorts": {
    "NSCLC": {
      "all": [
        {
          "kind": "clinical",
          "attribute": "CANCER_TYPE",
          "values": [
            "Non-Small Cell Lung Cancer"
          ]
        }
      ]
    },
    "NSCLC high-TMB": {
      "all": [
        {
          "kind": "clinical",
          "attribute": "CANCER_TYPE",
          "values": [
            "Non-Small Cell Lung Cancer"
          ]
        },
        {
          "kind": "clinical",
          "attribute": "TMB_NONSYNONYMOUS",
          "op": ">=",
          "percentile": 0.8,
          "percentileOf": "NSCLC"
        }
      ]
    },
    "NSCLC low-TMB": {
      "all": [
        {
          "kind": "clinical",
          "attribute": "CANCER_TYPE",
          "values": [
            "Non-Small Cell Lung Cancer"
          ]
        },
        {
          "kind": "clinical",
          "attribute": "TMB_NONSYNONYMOUS",
          "op": "<",
          "percentile": 0.8,
          "percentileOf": "NSCLC"
        }
      ]
    }
  },
  "views": [
    {
      "kind": "survival",
      "cohorts": [
        "NSCLC high-TMB",
        "NSCLC low-TMB"
      ]
    }
  ]
}

Custom data: a curated biopsy site on every sample

oncoprintplotcomparecustom-datasplitBy

An uploaded, sample-level annotation (`custom:luad-biopsy-site/BIOPSY_SITE`) used like the study's own attributes: as a cohort filter, an oncoprint track that orders the columns, a plot axis, and a `splitBy` that compares gene frequencies across sites. The rows are demo data bundled with the app, so this example runs without logging in; a real upload is stored on the server.

customRuns on demo data bundled with the app: LUAD biopsy site (demo) (186 samples).

luad_mskimpact_2021 is 93 EGFR-mutant lung adenocarcinomas with 186 primary and metastatic samples. The demo upload gives every sample a BIOPSY_SITE, grouped from the study's own SAMPLE_TYPE and free-text METASTATIC_SITE the way a reviewer would (scripts/gen-custom-demo.ts), standing in for a clinician-curated annotation. "CNS met" filters on it: 8 patients. Ordered by site, the oncoprint puts each patient's primary and metastases in their own groups. Fraction of the genome altered has a median of 0.47 in the 11 CNS samples and 0.36 in liver, against 0.21 in the 76 primaries. Split by site, TP53 is altered in 7 of 8 CNS-met patients (87.5%) against 65.6% of the patients with a primary sample. The split arms overlap, because a patient whose primary and metastasis were both sequenced belongs to both arms. With 8 to 61 patients per arm, these are illustrations, not findings.

luad_mskimpact_20212 cohorts: all patients, CNS met
document
{
  "study": "luad_mskimpact_2021",
  "cohorts": {
    "all patients": {
      "all": []
    },
    "CNS met": {
      "all": [
        {
          "kind": "clinical",
          "attribute": "custom:luad-biopsy-site/BIOPSY_SITE",
          "values": [
            "CNS met"
          ]
        }
      ]
    }
  },
  "views": [
    {
      "kind": "oncoprint",
      "unit": "sample",
      "cohorts": [
        "all patients"
      ],
      "genes": [
        "EGFR",
        "KRAS",
        "TP53",
        "STK11",
        "KEAP1",
        "SMARCA4"
      ],
      "clinical": [
        "custom:luad-biopsy-site/BIOPSY_SITE",
        "SAMPLE_TYPE"
      ],
      "sort": [
        "custom:luad-biopsy-site/BIOPSY_SITE"
      ]
    },
    {
      "kind": "plot",
      "unit": "sample",
      "cohorts": [
        "all patients"
      ],
      "x": {
        "source": "clinical",
        "attribute": "custom:luad-biopsy-site/BIOPSY_SITE"
      },
      "y": {
        "source": "clinical",
        "attribute": "FRACTION_GENOME_ALTERED"
      }
    },
    {
      "kind": "compare",
      "genes": [
        "EGFR",
        "KRAS",
        "TP53",
        "STK11",
        "KEAP1",
        "SMARCA4"
      ],
      "splitBy": {
        "cohort": "all patients",
        "attribute": "custom:luad-biopsy-site/BIOPSY_SITE"
      }
    }
  ]
}

Custom data: single-cell features of ovarian tumours (MSK SPECTRUM)

oncoprintplotcustom-datasingle-cell

Features summarised from a study's single-cell RNA-seq, uploaded as six custom datasets (five patient-level, one sample-level) and read beside its genomics: oncoprint tracks, box plots against the mutational signature, a scatter between two cell compartments, and a sample-level plot by tumour site. The rows are demo data bundled with the app, so this example runs without logging in.

customRuns on demo data bundled with the app: SPECTRUM scRNA: cell-type composition (demo) (41 patients), SPECTRUM scRNA: T/NK cell states (demo) (41 patients), SPECTRUM scRNA: T/NK fine states (41) (demo) (41 patients), SPECTRUM scRNA: macrophage & DC states (demo) (41 patients), SPECTRUM scRNA: cancer cell states, signalling & 6p LOH (demo) (41 patients), SPECTRUM scRNA: site-matched sample features (demo) (61 samples).

msk_spectrum_tme_2022 is 42 untreated high-grade serous ovarian cancers; 41 had scRNA-seq at several anatomical sites. scripts/gen-spectrum-sc-demo.py reads the public CELLxGENE cell annotations (cell states, per-cell pathway scores, per-cell 6p allele fraction) and summarises them per patient (solid sites pooled; ADX_ adnexal, NADX_ non-adnexal) and per cBioPortal sample (the scRNA-seq site of the same patient, 61 of 82 samples). Dysfunctional T/NK cells (TNK_DYSFUNC) have a median of 10.8% of T/NK cells in the 16 HRD-Dup tumours against 6.0% in the 14 FBI tumours, and naive/central-memory cells the reverse (7.5% against 11.1%), as in the paper's Fig. 4b. In adnexal cancer cells, JAK-STAT pathway activity has a median of 0.03 in HRD-Dup against -0.57 in FBI (Fig. 3e), and cancer-cell and T/NK-cell JAK-STAT correlate across patients (Spearman 0.74, Fig. 4e). Clonal 6p loss of heterozygosity (over 80% of cancer cells) is called in 4 patients, 3 of them HRD-Dup — the paper reports 4 of 41. By site, T cells are a median 43% of immune cells in the 22 adnexal samples against 54% in the 18 omental ones. These are summaries of public cell metadata, not the paper's statistical models.

msk_spectrum_tme_20221 cohort: all patients
document
{
  "study": "msk_spectrum_tme_2022",
  "cohorts": {
    "all patients": {
      "all": []
    }
  },
  "views": [
    {
      "kind": "oncoprint",
      "cohorts": [
        "all patients"
      ],
      "genes": [
        "TP53",
        "BRCA1",
        "BRCA2",
        "CCNE1",
        "MYC",
        "CDK12"
      ],
      "clinical": [
        "CONSENSUS_SIGNATURE",
        "custom:spectrum-sc-cancer/CA_6P_STATUS",
        "custom:spectrum-sc-tnk/TNK_DYSFUNC",
        "custom:spectrum-sc-tnk/TNK_NAIVE_CM"
      ],
      "sort": [
        "CONSENSUS_SIGNATURE"
      ]
    },
    {
      "kind": "plot",
      "unit": "patient",
      "cohorts": [
        "all patients"
      ],
      "x": {
        "source": "clinical",
        "attribute": "CONSENSUS_SIGNATURE"
      },
      "y": {
        "source": "clinical",
        "attribute": "custom:spectrum-sc-tnk/TNK_DYSFUNC"
      }
    },
    {
      "kind": "plot",
      "unit": "patient",
      "cohorts": [
        "all patients"
      ],
      "x": {
        "source": "clinical",
        "attribute": "CONSENSUS_SIGNATURE"
      },
      "y": {
        "source": "clinical",
        "attribute": "custom:spectrum-sc-tnk/TNK_NAIVE_CM"
      }
    },
    {
      "kind": "plot",
      "unit": "patient",
      "cohorts": [
        "all patients"
      ],
      "x": {
        "source": "clinical",
        "attribute": "CONSENSUS_SIGNATURE"
      },
      "y": {
        "source": "clinical",
        "attribute": "custom:spectrum-sc-cancer/ADX_CA_JAKSTAT"
      }
    },
    {
      "kind": "plot",
      "unit": "patient",
      "cohorts": [
        "all patients"
      ],
      "x": {
        "source": "clinical",
        "attribute": "custom:spectrum-sc-cancer/CA_JAKSTAT"
      },
      "y": {
        "source": "clinical",
        "attribute": "custom:spectrum-sc-tnk/TNK_JAKSTAT"
      }
    },
    {
      "kind": "plot",
      "unit": "sample",
      "cohorts": [
        "all patients"
      ],
      "x": {
        "source": "clinical",
        "attribute": "TUMOR_SUPERSITE"
      },
      "y": {
        "source": "clinical",
        "attribute": "custom:spectrum-sc-site/IMM_T"
      }
    }
  ]
}

Cohort attrition: which criterion removed whomNEW

attritionconsort

An `attrition` view: the CONSORT-style flow a clinicogenomic paper reports before any result — the study base, then the patients left after each clause of the cohort, in the order written, with how many that clause alone removed. Each step is the cohort a reader would get by stopping there, compiled and counted like any other cohort, so the last box is the cohort's own count by construction.

KRAS G12C lung adenocarcinoma treated with immunotherapy, with at least six months of follow-up, beside KRAS wild-type lung adenocarcinoma. The G12C arm loses most of its patients to the genotype, and a further 78 to the follow-up requirement — the kind of step a reader needs to see before trusting a survival curve drawn from what is left.

msk_chord_20242 cohorts: LUAD KRAS G12C, immunotherapy, LUAD KRAS wild-type
document
{
  "study": "msk_chord_2024",
  "cohorts": {
    "LUAD KRAS G12C, immunotherapy": {
      "all": [
        {
          "kind": "clinical",
          "attribute": "CANCER_TYPE_DETAILED",
          "values": [
            "Lung Adenocarcinoma"
          ]
        },
        {
          "kind": "oql",
          "q": "KRAS: G12C"
        },
        {
          "kind": "event",
          "a": {
            "eventType": "Treatment",
            "attrs": [
              {
                "key": "SUBTYPE",
                "value": "Immuno"
              }
            ]
          },
          "rel": {
            "type": "NONE"
          }
        },
        {
          "kind": "derived",
          "metric": "followupMonths",
          "range": {
            "gte": 6
          }
        }
      ]
    },
    "LUAD KRAS wild-type": {
      "all": [
        {
          "kind": "clinical",
          "attribute": "CANCER_TYPE_DETAILED",
          "values": [
            "Lung Adenocarcinoma"
          ]
        },
        {
          "not": {
            "kind": "oql",
            "q": "KRAS"
          }
        }
      ]
    }
  },
  "views": [
    {
      "kind": "attrition",
      "cohorts": [
        "LUAD KRAS G12C, immunotherapy",
        "LUAD KRAS wild-type"
      ]
    }
  ]
}

Genome-wide copy number: colorectal against breastNEW

genomecopy-numbercopy-number segments

A `genome` view: the copy-number SEGMENTS (33M of them in this warehouse, unused by every other view) binned along the genome, as the share of each cohort's segmented samples gained or lost in each bin, with a per-bin Fisher test between exactly two cohorts. Each bin's denominator is the samples whose segmentation actually covers it, the same panel-aware rule every per-gene frequency follows.

Colorectal and breast cancers in MSK-IMPACT, 2 Mb bins. The textbook colorectal pattern is all there — 20q gained in 60%, 13q in 42%, 8q in 32%, 18q lost in 54% — beside breast cancer's 1q and 8q gains and 16q loss. The strip underneath marks every bin where the two differ at q < 0.05, coloured by which cohort is higher.

msk_impact_50k_20262 cohorts: Colorectal, Breast
document
{
  "study": "msk_impact_50k_2026",
  "cohorts": {
    "Colorectal": {
      "all": [
        {
          "kind": "clinical",
          "attribute": "CANCER_TYPE",
          "values": [
            "Colorectal Cancer"
          ]
        }
      ]
    },
    "Breast": {
      "all": [
        {
          "kind": "clinical",
          "attribute": "CANCER_TYPE",
          "values": [
            "Breast Cancer"
          ]
        }
      ]
    }
  },
  "views": [
    {
      "kind": "genome",
      "cohorts": [
        "Colorectal",
        "Breast"
      ],
      "binMb": 2
    }
  ]
}

One patient's copy-number segments, sample by sample

segmentscopy-numbercopy-number segmentspatient

A `segments` view over one patient: each of their samples' copy-number segments along the genome, numbered in collection order as the patient page numbers them — the portal's genomic overview track.

IM-GBM-28's four glioma samples: the segments each sample's copy-number profile was cut into, red where gained, blue where lost.

glioma_msk_20181 cohort: IM-GBM-28
document
{
  "study": "glioma_msk_2018",
  "cohorts": {
    "IM-GBM-28": {
      "all": [
        {
          "kind": "patientList",
          "ids": [
            "glioma_msk_2018:IM-GBM-28"
          ]
        }
      ]
    }
  },
  "views": [
    {
      "kind": "segments",
      "cohorts": [
        "IM-GBM-28"
      ]
    }
  ]
}

ERBB2 copy number across breast tumours, most gained first

segmentscopy-numbercopy-number segments

A `segments` view zoomed to a gene, the portal's CN Segments tab for a query: every sample's segments across ERBB2 and 1 kb either side, ordered by the sample's mean over that span, so the amplified tumours come first; the row limit says how many samples it leaves out.

TCGA PanCancer breast cancer, zoomed to ERBB2 and sorted by its copy number: the HER2-amplified tumours form the red block at the top.

brca_tcga_pan_can_atlas_20181 cohort: Breast
document
{
  "study": "brca_tcga_pan_can_atlas_2018",
  "cohorts": {
    "Breast": {
      "all": []
    }
  },
  "views": [
    {
      "kind": "segments",
      "cohorts": [
        "Breast"
      ],
      "gene": "ERBB2",
      "sort": "gained",
      "rows": 200
    }
  ]
}

Oncogenic signalling pathways: colorectal against pancreatic

pathwaysgene-sets

A `pathways` view: the ten canonical pathways of Sanchez-Vega et al. (Cell 2018) as the share of each cohort with an OncoKB driver in at least one member gene — over the UNION of the members' panels, the oncoprint's merged-row rule — beside each pathway's most-altered members, each with its own panel-aware denominator. A member gene no panel covered is listed as never profiled, not counted as unaltered.

Colorectal and pancreatic cancer in MSK-CHORD. WNT separates them almost completely (82% against 8%, nearly all APC); RTK-RAS is higher in pancreatic cancer (84%, KRAS 81%), and so is the cell cycle (39%, CDKN2A 33%); PI3K and NOTCH (FBXW7) are colorectal. The canonical pathways also show how much a targeted panel misses: 56 of WNT's 68 genes are on no panel here.

msk_chord_20242 cohorts: Colorectal, Pancreatic
document
{
  "study": "msk_chord_2024",
  "cohorts": {
    "Colorectal": {
      "all": [
        {
          "kind": "clinical",
          "attribute": "CANCER_TYPE",
          "values": [
            "Colorectal Cancer"
          ]
        }
      ]
    },
    "Pancreatic": {
      "all": [
        {
          "kind": "clinical",
          "attribute": "CANCER_TYPE",
          "values": [
            "Pancreatic Cancer"
          ]
        }
      ]
    }
  },
  "views": [
    {
      "kind": "pathways",
      "cohorts": [
        "Colorectal",
        "Pancreatic"
      ]
    }
  ]
}

Pathway diagram: TCGA breast cancer and its most-altered genes

pathwaymapgene-setsdiagram

A `pathwaymap` view: the PathwayMapper pathway that holds most of the query genes, drawn from the library's own layout, each gene node carrying its altered % over the samples profiled for that gene, beside the ten TCGA PanCanAtlas pathways ranked by how many query genes each holds — the portal's Pathways tab.

TCGA PanCancer Atlas breast cancer with the genes a breast query usually starts from. PI3K holds three of the seven — PIK3CA (34%), PTEN (11%) and AKT1 (4%) — so it ranks first of the ten PanCanAtlas pathways and is drawn; TP53 and Cell Cycle hold TP53 alone. Every % is over the 1,084 samples profiled, as on cbioportal.org.

brca_tcga_pan_can_atlas_20181 cohort: all patients
document
{
  "study": "brca_tcga_pan_can_atlas_2018",
  "cohorts": {
    "all patients": {
      "all": []
    }
  },
  "views": [
    {
      "kind": "pathwaymap",
      "genes": [
        "TP53",
        "PIK3CA",
        "CDH1",
        "GATA3",
        "MAP3K1",
        "PTEN",
        "AKT1"
      ],
      "cohorts": [
        "all patients"
      ]
    }
  ]
}

Differential expression and enrichment: basal-like against luminal A breast cancer

diffexprvolcanogseaexpression

A `diffexpr` view: every gene's Welch t-test between two cohorts on one molecular profile, from three running totals per gene and cohort (n, Σv, Σv²) — additive, so exact across sites and never a single value sent — drawn as a volcano, then preranked GSEA of the same t ranking against the 50 MSigDB Hallmark sets, significance by seeded gene-set permutation so a shared link reproduces it.

TCGA PanCancer Atlas breast cancer, PAM50 basal-like against luminal A, on mRNA z-scores. The luminal genes (ESR1, PGR, FOXA1, GATA3) and the basal ones (FOXC1, and proliferation — MKI67, CDC20, AURKB) come out as expected, and so does the enrichment: E2F targets, the G2M checkpoint and MYC targets in basal-like tumours, early estrogen response in luminal A.

brca_tcga_pan_can_atlas_20182 cohorts: Basal-like, Luminal A
document
{
  "study": "brca_tcga_pan_can_atlas_2018",
  "cohorts": {
    "Basal-like": {
      "all": [
        {
          "kind": "clinical",
          "attribute": "SUBTYPE",
          "values": [
            "BRCA_Basal"
          ]
        }
      ]
    },
    "Luminal A": {
      "all": [
        {
          "kind": "clinical",
          "attribute": "SUBTYPE",
          "values": [
            "BRCA_LumA"
          ]
        }
      ]
    }
  },
  "views": [
    {
      "kind": "diffexpr",
      "cohorts": [
        "Basal-like",
        "Luminal A"
      ],
      "profileType": "rna_seq_v2_mrna_median_all_sample_Zscores"
    }
  ]
}

Paired samples: what differs between a patient's primary and metastasisNEW

pairedmetastasistumor evolution

A `paired` view: among patients with both a primary and a metastatic sample, per gene, how often a driver is on both, only the primary or only the metastasis — counted only where each side's own panel covered the gene — with an exact McNemar test of whether discordance runs one way. A patient-level comparison computed entirely inside the database; only the four counts per gene leave it.

MSK-IMPACT, the 2,278 patients sequenced at both a primary and a metastatic site. Truncal drivers agree (TP53 78% concordant); what the metastasis alone carries is the resistance biology — ESR1 mutations (49 metastasis-only against 7 primary-only) and AR alterations (71 against 1), both selected under hormone therapy — and MYC amplification and CDKN2A loss.

msk_impact_50k_20261 cohort: all patients
document
{
  "study": "msk_impact_50k_2026",
  "cohorts": {
    "all patients": {
      "all": []
    }
  },
  "views": [
    {
      "kind": "paired",
      "cohorts": [
        "all patients"
      ],
      "genes": [
        "TP53",
        "KRAS",
        "PIK3CA",
        "ESR1",
        "AR",
        "CDKN2A",
        "MYC",
        "TERT"
      ]
    }
  ]
}

Paired samples, every gene: what the metastasis carries that the primary does notNEW

pairedmetastasistumor evolutionscan

A `paired` view with no `genes`: it scans every gene with a driver in some patient sampled at both a primary and a metastatic site, tests each with an exact McNemar test, takes Benjamini–Hochberg q across all of them, and draws the most one-sided — the question asked without guessing the answer's genes first.

MSK-IMPACT again, the 2,278 patients with both kinds of sample, but no gene list. Of 347 genes with a discordant patient, the scan puts AR (71 metastasis-only against 1 primary-only) and ESR1 (49 against 7) first — the hormone-therapy resistance genes the hand-picked version above had to be told to look at — followed by MYC, NKX3-1 and PTEN.

msk_impact_50k_20261 cohort: all patients
document
{
  "study": "msk_impact_50k_2026",
  "cohorts": {
    "all patients": {
      "all": []
    }
  },
  "views": [
    {
      "kind": "paired",
      "cohorts": [
        "all patients"
      ],
      "top": 15
    }
  ]
}

Before and after treatment, pooled across studies that label it differentlyNEW

pairedfederationtreatmentresistancescan

A `paired` view whose `pairBy.studies` gives each study its own before/after attribute and values — five studies, five spellings — so their patients pool into one before-vs-after count per gene, scanned across every driver gene, with `labels` naming the sides.

111 patients with a sample on each side across gastroesophageal (two studies), breast (alpelisib, and a second cohort) and bladder cancer. At this size nothing survives correction across the 278 genes tested — the honest answer — and the most one-sided genes run the other way: CCND1 and MYC amplifications seen before treatment and not after (10 and 10 patients against 1 and 2), as a lower-purity post-treatment sample would also show. Read it as a lead, not a finding; the same view over a large serially sampled cohort is where acquired resistance would show.

5 studies1 cohort: before and after treatment
document
{
  "study": "egc_msk_2017",
  "cohorts": {
    "before and after treatment": {
      "studies": [
        "egc_msk_2017",
        "breast_alpelisib_2020",
        "egc_trap_ccr_msk_2023",
        "blca_cornell_2016",
        "brca_dldccc_2022"
      ],
      "all": []
    }
  },
  "views": [
    {
      "kind": "paired",
      "cohorts": [
        "before and after treatment"
      ],
      "top": 12,
      "pairBy": {
        "labels": {
          "a": "before",
          "b": "after"
        },
        "studies": {
          "egc_msk_2017": {
            "attribute": "IMPACT_PRE_POST",
            "a": "PRE-TX",
            "b": "POST-TX"
          },
          "breast_alpelisib_2020": {
            "attribute": "SAMPLE_COLLECTION_TIMEPOINT",
            "a": "pre-treatment",
            "b": "post-treatment"
          },
          "egc_trap_ccr_msk_2023": {
            "attribute": "PRE_OR_POST_TREATMENT",
            "a": "Pre",
            "b": "Post"
          },
          "blca_cornell_2016": {
            "attribute": "SPECIMEN_COLLECTION_PRE_OR_POST_CHEMO",
            "a": "pre-chemotherapy",
            "b": "post-chemotherapy"
          },
          "brca_dldccc_2022": {
            "attribute": "TREATMENT_STATUS",
            "a": "Pre-Treatment",
            "b": "Post-Treatment"
          }
        }
      }
    }
  ]
}

Acquired under therapy: the sample before a treatment against the sample after itNEW

acquiredtreatmentresistancescanpreview

An `acquired` view (preview): patients with a sample dated on or before their first systemic therapy and another at least 30 days after it, read off the timeline's sample events — per gene, an oncogenic alteration only after (acquired) or only before (lost), counted only where both samples' panels cover the gene, with an exact McNemar test; with no `genes` it scans every gene acquired in at least 3 patients and draws the most one-sided.

MSK thoracic PDX: 142 patients with a systemic therapy start, 33 with a dated sample on each side of it (a median 301 days apart). Acquired calls outnumber lost ones: CDKN2B (8 acquired against 1 lost), MYC, KEAP1 — none survives correction at 33 patients, and many after-samples are PDX models, whose higher purity calls more than the tissue before them.

lung_msk_pdx1 cohort: all patients
document
{
  "study": "lung_msk_pdx",
  "cohorts": {
    "all patients": {
      "all": []
    }
  },
  "views": [
    {
      "kind": "acquired",
      "cohorts": [
        "all patients"
      ],
      "anchor": {
        "eventType": "Treatment",
        "key": "SUBTYPE",
        "value": "Systemic therapy"
      },
      "measure": "driver",
      "top": 12
    }
  ]
}

ctDNA against tissue: what a blood test sees of the tumour, and what detecting it saysNEW

ctdnaliquid biopsyprognosispreview

A `ctdna` view (preview): patients with a plasma (cfDNA) sample and a tissue sample, per gene covered by both panels, altered in both, tissue only or plasma only — plasma's positive percent agreement with tissue as the reference, with Wilson intervals — then the share of plasma patients with any alteration detected, and overall survival by ctDNA detected against not, with a log-rank test.

MSK lung cancer ctDx (1,127 patients; 682 with plasma and tissue). Plasma catches about two thirds of tissue's EGFR, KRAS and TP53 calls but only a third of STK11, KEAP1 and MET; ctDNA is detected in 68% of plasma patients, and they live about half as long (median 21.8 against 41.5 months, log-rank p≈2e-12) — the prognostic signal the paper reports.

nsclc_ctdx_msk_20221 cohort: all patients
document
{
  "study": "nsclc_ctdx_msk_2022",
  "cohorts": {
    "all patients": {
      "all": []
    }
  },
  "views": [
    {
      "kind": "ctdna",
      "cohorts": [
        "all patients"
      ],
      "genes": [
        "EGFR",
        "KRAS",
        "TP53",
        "STK11",
        "KEAP1",
        "PIK3CA",
        "BRAF",
        "MET",
        "ERBB2",
        "ALK"
      ]
    }
  ]
}

ctDNA with clonal haematopoiesis filtered out: MSK-ACCESS plasma against tissueNEW

ctdnaliquid biopsyclonal hematopoiesisprognosispreview

A `ctdna` view (preview) with `chFilter`: plasma mutation calls likely from clonal haematopoiesis — in the canonical CH genes, or seen in the patient's matched white-cell sample at a comparable allele fraction — are left out before agreement with tissue, ctDNA detected and survival are counted, and the result says what each rule removed, gene by gene, beside the unfiltered numbers.

MSK-ACCESS (617 patients; 449 with plasma and tissue). MSK-ACCESS already subtracts the white-cell sample in its own calling, so the filter takes out little: 83 of 2,024 plasma mutation calls in 51 patients, mostly SF3B1, DNMT3A, GNAS and IDH2 by gene and a few TP53 calls seen in the normal. What it removes is plasma-only — AR, RB1 and ATM lose plasma-only calls while every concordant call stays — and ctDNA detected moves from 74% to 73%, with survival by detection unchanged (log-rank p 3.4e-4).

msk_access_20211 cohort: all patients
document
{
  "study": "msk_access_2021",
  "cohorts": {
    "all patients": {
      "all": []
    }
  },
  "views": [
    {
      "kind": "ctdna",
      "cohorts": [
        "all patients"
      ],
      "plasmaPanels": [
        "ACCESS129"
      ],
      "chFilter": true
    }
  ]
}

Mutual exclusivity that accounts for each tumour's burden (DISCOVER)NEW

exclusivitymutual exclusivityco-occurrencelungpreview

An `exclusivity` view (preview): DISCOVER's background — each sample's and gene's probability of alteration fitted from the margins of the whole altered-gene matrix, panel by panel — tests every pair's co-altered count against its Poisson-binomial null, exclusivity in the lower tail and co-occurrence in the upper, beside the plain Fisher test that assumes every tumour is alike.

MSK-IMPACT non-small cell lung cancer, 1,680 samples. The oncogenic drivers stay exclusive (KRAS/EGFR 19 together against 170 expected, q≈1e-56), and so do EGFR with STK11 and KEAP1; STK11/KEAP1 co-occur. What moves is what the burden explains: Fisher calls EGFR/TP53 co-occurring (q≈2e-7) because both mark heavily altered tumours, while DISCOVER expects 300 together and sees 294 (q 0.45); KEAP1/TP53, null by Fisher, turns exclusive.

msk_impact_20171 cohort: NSCLC
document
{
  "study": "msk_impact_2017",
  "cohorts": {
    "NSCLC": {
      "all": [
        {
          "kind": "clinical",
          "attribute": "CANCER_TYPE",
          "values": [
            "Non-Small Cell Lung Cancer"
          ]
        }
      ]
    }
  },
  "views": [
    {
      "kind": "exclusivity",
      "cohorts": [
        "NSCLC"
      ],
      "genes": [
        "KRAS",
        "EGFR",
        "BRAF",
        "STK11",
        "KEAP1",
        "TP53"
      ]
    }
  ]
}

Genomic instability by cancer type: aneuploidy score, FGA and arm-level changesNEW

instabilitycopy-numberaneuploidycopy-number segmentspreview

An `instability` view (preview): from each sample's copy-number segments, computed per sample inside the database, the fraction of the genome altered and arm-level gains and losses (an arm called when more than half its length is past ±0.2) — their count is the aneuploidy score, after Taylor et al. 2018 — drawn per cohort as boxes from histograms with a Kruskal–Wallis test, and each arm's gain and loss frequency as a heatmap. Only histograms and per-arm counts leave the database.

MSK-IMPACT 50k: colorectal, breast and pancreatic cancer. Colorectal shows its textbook arms — 20q gained in 60%, 13q in 42%, 18q lost in 53% — and breast 1q and 8q gains with 16q loss. Pancreatic tumours look the most stable (median 2 arms, against 7 and 8), which is mostly purity: their low tumour content pulls every log ratio toward 0, the bias the caption names.

msk_impact_50k_20263 cohorts: Colorectal, Breast, Pancreatic
document
{
  "study": "msk_impact_50k_2026",
  "cohorts": {
    "Colorectal": {
      "all": [
        {
          "kind": "clinical",
          "attribute": "CANCER_TYPE",
          "values": [
            "Colorectal Cancer"
          ]
        }
      ]
    },
    "Breast": {
      "all": [
        {
          "kind": "clinical",
          "attribute": "CANCER_TYPE",
          "values": [
            "Breast Cancer"
          ]
        }
      ]
    },
    "Pancreatic": {
      "all": [
        {
          "kind": "clinical",
          "attribute": "CANCER_TYPE",
          "values": [
            "Pancreatic Cancer"
          ]
        }
      ]
    }
  },
  "views": [
    {
      "kind": "instability",
      "cohorts": [
        "Colorectal",
        "Breast",
        "Pancreatic"
      ]
    }
  ]
}

Clonality, LOH and genome doubling from FACETSNEW

clonalityfacetslohwgd

A `clonality` view: the FACETS allele-specific copy number this warehouse holds for MSK-IMPACT (1.9M mutation calls no other view reads) — per gene, how often a cohort's driver mutations are clonal or subclonal and whether the mutated locus lost its other allele, beside each cohort's whole-genome doubling rate and purity and ploidy distributions, from FACETS-QC-passing samples.

Colorectal against breast cancer. Tumour suppressors show the classic second hit — TP53 is ~88% clonal with its other allele lost 77–89% of the time, CDH1 in breast 95% — while the oncogene KRAS rarely loses its partner. PIK3CA is markedly more often subclonal in colorectal cancer (68% clonal) than in breast (84%), in keeping with a later event there. Around a third of both cohorts' tumours have doubled their genome.

msk_impact_50k_20262 cohorts: Colorectal, Breast
document
{
  "study": "msk_impact_50k_2026",
  "cohorts": {
    "Colorectal": {
      "all": [
        {
          "kind": "clinical",
          "attribute": "CANCER_TYPE",
          "values": [
            "Colorectal Cancer"
          ]
        }
      ]
    },
    "Breast": {
      "all": [
        {
          "kind": "clinical",
          "attribute": "CANCER_TYPE",
          "values": [
            "Breast Cancer"
          ]
        }
      ]
    }
  },
  "views": [
    {
      "kind": "clonality",
      "cohorts": [
        "Colorectal",
        "Breast"
      ],
      "genes": [
        "TP53",
        "KRAS",
        "APC",
        "PIK3CA",
        "SMAD4",
        "CDH1",
        "GATA3"
      ]
    }
  ]
}

Brain metastasis, with death as a competing riskNEW

incidencecompeting-riskstimeline-events

An `incidence` view: the cumulative incidence of a timeline event (here the first radiology-reported brain metastasis) with death as a competing risk — Aalen–Johansen, not 1 − Kaplan–Meier, which treats the dead as still at risk and so overstates incidence exactly where death is common. The table sets the two side by side; Gray's test compares the cohorts by permutation of their (entry, time, cause) tallies, which are all a site sends.

MSK-CHORD, from each patient's day 0, among those without a brain metastasis by then. At five years 24.7% of NSCLC patients have one — where 1 − Kaplan–Meier would have said 30.4% — against 20.6% in breast and 10.8% in colorectal cancer (1 − KM: 14.4%, a third too high, because so many colorectal patients die first).

msk_chord_20243 cohorts: NSCLC, Breast, Colorectal
document
{
  "study": "msk_chord_2024",
  "cohorts": {
    "NSCLC": {
      "all": [
        {
          "kind": "clinical",
          "attribute": "CANCER_TYPE",
          "values": [
            "Non-Small Cell Lung Cancer"
          ]
        }
      ]
    },
    "Breast": {
      "all": [
        {
          "kind": "clinical",
          "attribute": "CANCER_TYPE",
          "values": [
            "Breast Cancer"
          ]
        }
      ]
    },
    "Colorectal": {
      "all": [
        {
          "kind": "clinical",
          "attribute": "CANCER_TYPE",
          "values": [
            "Colorectal Cancer"
          ]
        }
      ]
    }
  },
  "views": [
    {
      "kind": "incidence",
      "cohorts": [
        "NSCLC",
        "Breast",
        "Colorectal"
      ],
      "event": {
        "eventType": "Diagnosis",
        "attrs": [
          {
            "key": "TUMOR_SITE",
            "value": "CNS/Brain"
          }
        ],
        "label": "brain metastasis"
      }
    }
  ]
}

A tumour mutational burden cut-point for survival on immunotherapyNEW

cutpointbiomarker-thresholdpermutation-testlog-rank

A `cutpoint` view (preview): the value of a numeric marker (here TMB) that best splits overall survival, found by scanning every candidate cut between the 10th and 90th percentiles with the maximally selected log-rank statistic, its p corrected for that search by 1,000 seeded permutations of the marker and set beside the naive one — then the same per cancer type (`stratifyBy`).

Samstein et al. 2019's 1,661 patients treated with checkpoint inhibitors (tmb_mskcc_2018). The best overall cut is TMB > 14.4 mutations/Mb: the top 19% survive markedly longer (HR 0.45, median 47 against 15 months), corrected p ≈ 0.001 against a naive 9.5e-15 that ignores the search. Per cancer type the best cut moves — 18.6 in NSCLC, 9.8 in melanoma, 11.1 in colorectal — and in renal cell carcinoma, oesophagogastric cancer and glioma no cut survives the correction, the paper's point that one threshold does not fit every histology. Every cut here is optimistic and would need validation in another cohort.

tmb_mskcc_20181 cohort: all patients
document
{
  "study": "tmb_mskcc_2018",
  "cohorts": {
    "all patients": {
      "all": []
    }
  },
  "views": [
    {
      "kind": "cutpoint",
      "cohorts": [
        "all patients"
      ],
      "attribute": "TMB_NONSYNONYMOUS",
      "stratifyBy": "CANCER_TYPE"
    }
  ]
}

HLA class I homozygosity and HLA loss in lung cancer, and survivalNEW

hlaimmunogenomicshla-genotypeprognosispreview

An `hla` view (preview): from the germline HLA class I alleles MSK-IMPACT types for each patient, the share homozygous at 0, 1 or 2+ of HLA-A, -B and -C (alleles compared at two fields, A*02:01), and the share whose tumour lost an HLA allele (LOHHLA-style calls); then overall survival by homozygous-at-any-locus against fully heterozygous and by HLA LOH against none, with log-rank tests and Cox hazard ratios, unadjusted and adjusted for tumour mutational burden.

MSK-IMPACT 50K, non-small cell lung cancer (6,633 patients; 5,901 typed at all three loci). 22% are homozygous at one locus or more, about the share Chowell et al. report; in this cohort, not restricted to immunotherapy, homozygosity does not move overall survival (HR 1.02). HLA LOH, called in 30% of the 4,158 patients with a call, goes with shorter survival (median 32 against 48 months, HR 1.35, 1.31 adjusted for TMB) — tumour biology, not a treatment effect.

msk_impact_50k_20261 cohort: NSCLC
document
{
  "study": "msk_impact_50k_2026",
  "cohorts": {
    "NSCLC": {
      "all": [
        {
          "kind": "clinical",
          "attribute": "CANCER_TYPE",
          "values": [
            "Non-Small Cell Lung Cancer"
          ]
        }
      ]
    }
  },
  "views": [
    {
      "kind": "hla",
      "cohorts": [
        "NSCLC"
      ],
      "covariates": [
        "TMB_SCORE"
      ]
    }
  ]
}

HLA class I homozygosity and survival on checkpoint blockade in melanomaNEW

hlafederationimmunotherapyimmunogenomicshla-genotypepreview

An `hla` view (preview) over three studies pooled: the melanoma checkpoint-inhibitor cohorts that record each patient's HLA-A, -B and -C as one "A0201/A2402" value — homozygosity per patient, then overall survival (from the start of treatment, as these studies measure it) by homozygous at any class I locus against fully heterozygous, the log-rank test and Cox model stratified by study.

Van Allen 2015 (ipilimumab), Snyder 2014 (ipilimumab) and Hugo 2016 (anti-PD-1): 212 patients, 22% homozygous at a locus or more. Homozygous patients have a median overall survival of 12 against 22 months (HR 1.22, 95% CI 0.82–1.82) — the direction Chowell et al. found pooling these and other cohorts, though 212 patients cannot show it alone. These studies record no HLA LOH, so that split says so.

3 studies1 cohort: melanoma on checkpoint blockade
document
{
  "study": "skcm_dfci_2015",
  "cohorts": {
    "melanoma on checkpoint blockade": {
      "studies": [
        "skcm_dfci_2015",
        "skcm_mskcc_2014",
        "mel_ucla_2016"
      ],
      "all": []
    }
  },
  "views": [
    {
      "kind": "hla",
      "cohorts": [
        "melanoma on checkpoint blockade"
      ]
    }
  ]
}

Which mutations change survival on immunotherapy in lung cancer?NEW

predictivepredictive-biomarkerinteractiontimeline-events

A `predictive` view (preview): for each gene, a Cox model of overall survival on the gene, exposure to a treatment (any Immuno record) and their interaction — the gene's hazard ratio among the treated and among the untreated side by side, and whether they differ (interaction p, BH q). Each gene is fitted over the patients whose panel covers it.

MSK-CHORD non-small cell lung cancer, 7,809 patients, 2,666 with an immunotherapy record. STK11 and KEAP1 mutations are adverse among the treated (HR 1.48 and 1.41), as reported for checkpoint inhibitors; TP53 and SMARCA4 are strongly adverse only among the untreated (HR 1.72 and 1.88 against about 1.0 and 1.1 treated; interaction q < 1e-4) — in keeping with their link to tumour mutational burden, though immortal time and who gets treated can shape such contrasts too.

msk_chord_20241 cohort: NSCLC
document
{
  "study": "msk_chord_2024",
  "cohorts": {
    "NSCLC": {
      "all": [
        {
          "kind": "clinical",
          "attribute": "CANCER_TYPE",
          "values": [
            "Non-Small Cell Lung Cancer"
          ]
        }
      ]
    }
  },
  "views": [
    {
      "kind": "predictive",
      "cohorts": [
        "NSCLC"
      ],
      "exposure": {
        "eventType": "Treatment",
        "key": "SUBTYPE",
        "value": "Immuno"
      },
      "genes": [
        "STK11",
        "KEAP1",
        "KRAS",
        "TP53",
        "EGFR",
        "SMARCA4"
      ]
    }
  ]
}

Months of life gained on immunotherapy with a high tumour mutational burden, with landmarksNEW

rmstimmunotherapylandmarknon-proportional-hazards

An `rmst` view (preview): the restricted mean survival time — the area under each Kaplan–Meier curve up to τ = 24 months, the mean months lived in the first two years — with its standard error, and between the cohorts the difference and ratio of those means with 95% intervals. It needs no proportional hazards, the usual worry with immunotherapy curves. `landmarkMonths` repeats it among the patients alive and followed at 6 and 12 months, each panel's clock restarted there.

Samstein et al.'s immunotherapy cohort (every patient treated with immune checkpoint inhibitors; OS from the first treatment), TMB under 10 against 10 or more mutations per megabase. In the first 24 months TMB-high patients lived about 3.3 months longer on average (17.7 against 14.5 months, ratio 1.23), and the gain holds at about 3.2–3.6 months among those still alive at 6 and at 12 months — the benefit is not only early.

tmb_mskcc_20182 cohorts: TMB < 10, TMB ≥ 10
document
{
  "study": "tmb_mskcc_2018",
  "cohorts": {
    "TMB < 10": {
      "all": [
        {
          "kind": "clinical",
          "attribute": "TMB_NONSYNONYMOUS",
          "range": {
            "lt": 10
          }
        }
      ]
    },
    "TMB ≥ 10": {
      "all": [
        {
          "kind": "clinical",
          "attribute": "TMB_NONSYNONYMOUS",
          "range": {
            "gte": 10
          }
        }
      ]
    }
  },
  "views": [
    {
      "kind": "rmst",
      "cohorts": [
        "TMB < 10",
        "TMB ≥ 10"
      ],
      "tau": 24,
      "landmarkMonths": [
        0,
        6,
        12
      ]
    }
  ]
}

From progression to death in colorectal cancer, by stageNEW

multistatetimeline-eventsprogressionhazard-ratio

A `multistate` view (preview): the illness–death model (Rueda et al., Nature 2019) — alive without progression, alive after it, dead — from each patient's first sequencing (the timeline's day 0 in MSK-CHORD). Per cohort the share in each state month by month (Aalen–Johansen, stacked), the cumulative hazard of each transition (Nelson–Aalen), each transition's rate per 100 person-months, and a Cox hazard ratio per transition against the first cohort, from id-free (progression time, end time, dead) counts.

MSK-CHORD colorectal cancer, highest recorded stage 1–3 against stage 4. Stage 4 patients progress over four times as fast (HR ≈ 4.4) and, once progressed, die about 1.7 times as fast; death without a recorded progression is rare in both. So the stage-4 survival gap comes mostly through faster progression, and partly through worse survival after it. About a third of each cohort had a progression recorded before their first sequencing and starts in the progression state; set prevalent to exclude to follow only patients not yet progressed.

msk_chord_20242 cohorts: Colorectal, stage 1-3, Colorectal, stage 4
document
{
  "study": "msk_chord_2024",
  "cohorts": {
    "Colorectal, stage 1-3": {
      "all": [
        {
          "kind": "clinical",
          "attribute": "CANCER_TYPE",
          "values": [
            "Colorectal Cancer"
          ]
        },
        {
          "kind": "clinical",
          "attribute": "STAGE_HIGHEST_RECORDED",
          "values": [
            "Stage 1-3"
          ]
        }
      ]
    },
    "Colorectal, stage 4": {
      "all": [
        {
          "kind": "clinical",
          "attribute": "CANCER_TYPE",
          "values": [
            "Colorectal Cancer"
          ]
        },
        {
          "kind": "clinical",
          "attribute": "STAGE_HIGHEST_RECORDED",
          "values": [
            "Stage 4"
          ]
        }
      ]
    }
  },
  "views": [
    {
      "kind": "multistate",
      "cohorts": [
        "Colorectal, stage 1-3",
        "Colorectal, stage 4"
      ]
    }
  ]
}

Real-world PFS on immunotherapy in lung cancer, by KRAS statusNEW

txendpointsreal-world-endpointstimeline-eventslog-rank

A `txendpoints` view (preview): real-world progression-free survival from each patient's first immunotherapy record — to the first progression recorded after it, or death — as Kaplan–Meier curves with the number at risk, medians with 95% intervals and a log-rank test, from (entry, time, event) counts alone. `endpoint` switches it to time to next treatment (the next treatment line, as the sequence view builds lines) or time on treatment.

MSK-CHORD non-small cell lung cancer, KRAS-mutant against KRAS wild-type (profiled for KRAS), from the first Immuno record. About a third of each cohort was treated. Median real-world PFS is about 2.6 months in both groups and the curves lie on top of each other (log-rank p ≈ 0.98): KRAS status alone does not mark who progresses on immunotherapy here. Progression is read from notes, so it is recorded densely; switching to time to next treatment gives medians near a year.

msk_chord_20242 cohorts: NSCLC, KRAS mutant, NSCLC, KRAS wild-type
document
{
  "study": "msk_chord_2024",
  "cohorts": {
    "NSCLC, KRAS mutant": {
      "all": [
        {
          "kind": "clinical",
          "attribute": "CANCER_TYPE",
          "values": [
            "Non-Small Cell Lung Cancer"
          ]
        },
        {
          "kind": "oql",
          "q": "KRAS: MUT"
        }
      ]
    },
    "NSCLC, KRAS wild-type": {
      "all": [
        {
          "kind": "clinical",
          "attribute": "CANCER_TYPE",
          "values": [
            "Non-Small Cell Lung Cancer"
          ]
        },
        {
          "not": {
            "kind": "oql",
            "q": "KRAS:"
          }
        },
        {
          "kind": "profiled",
          "type": "MUTATION",
          "gene": "KRAS"
        }
      ]
    }
  },
  "views": [
    {
      "kind": "txendpoints",
      "cohorts": [
        "NSCLC, KRAS mutant",
        "NSCLC, KRAS wild-type"
      ],
      "endpoint": "rwpfs",
      "anchor": {
        "eventType": "Treatment",
        "key": "SUBTYPE",
        "value": "Immuno"
      }
    }
  ]
}

A survival risk model from mutated genes in lung cancerNEW

riskmodelmachine-learningtable-1

A `riskmodel` view: an elastic-net Cox model of survival on every mutated gene that all the cohort's panels cover, fitted on random two-thirds of the patients and scored on the held-out third, repeatedly (OncoCast's ensemble) — so each patient's risk score comes from models that never saw them — with the held-out C-index, the genes kept most often, Kaplan-Meier curves of the risk groups, and each group's clinical and genomic makeup (Table 1).

Non-small cell lung cancer in MSK-CHORD. The model keeps KEAP1, STK11, SMARCA4 and TP53 as adverse and EGFR as favourable, as the literature does, and its risk thirds separate clearly; a held-out C-index near 0.61 says mutations alone predict survival only modestly. Five runs keep the example quick; OncoCast recommends fifty. Its Table 1 (`describe`) shows who is in each third: the high-risk third is more often male, a former or current smoker and at stage 4 than the low-risk third. KEAP1 and TP53 are marked “in the model” — the score is built from them, so their enrichment is by construction and gets no q-value — and ZFHX3, which not every panel covers, is counted over each group's patients whose panel does.

msk_chord_20241 cohort: NSCLC
document
{
  "study": "msk_chord_2024",
  "cohorts": {
    "NSCLC": {
      "all": [
        {
          "kind": "clinical",
          "attribute": "CANCER_TYPE",
          "values": [
            "Non-Small Cell Lung Cancer"
          ]
        }
      ]
    }
  },
  "views": [
    {
      "kind": "riskmodel",
      "cohorts": [
        "NSCLC"
      ],
      "runs": 5,
      "describe": {
        "attributes": [
          "STAGE_HIGHEST_RECORDED",
          "GENDER",
          "SMOKING_PREDICTIONS_3_CLASSES",
          "CURRENT_AGE_DEID"
        ],
        "genes": [
          "KEAP1",
          "TP53",
          "ZFHX3"
        ]
      }
    }
  ]
}

A lung cancer risk model, validated on another studyNEW

riskmodelfederationmachine-learningexternal-validation

A `riskmodel` view with `validateOn` (preview): the OncoCast-style ensemble is fitted on one study's cohort as usual, then every patient of another cohort — here another study — is scored with the ensemble's mean coefficients and cut at the training risk-group thresholds, with Harrell's C-index (bootstrap interval), Kaplan–Meier curves, the log-rank test and each group's hazard ratio on patients the model never saw.

Fitted on the 1,440 non-small cell lung cancer patients of MSK-IMPACT 2017 (ten runs; KEAP1, STK11 and TP53 adverse, EGFR favourable), scored on the 7,809 of MSK-CHORD. The C-index holds at 0.607 (95% CI 0.597–0.616) against 0.613 held out in training, and the training thresholds still separate the new cohort: median survival 66 months in the low-risk group against 33 and 21 months (HR 1.63 and 2.12, log-rank p ≈ 1e-72). Both studies are from MSK, so some patients may be in both under different identifiers; a study from another centre would be the stronger test.

2 studies2 cohorts: NSCLC (MSK-IMPACT 2017), NSCLC (MSK-CHORD)
document
{
  "study": "msk_impact_2017",
  "cohorts": {
    "NSCLC (MSK-IMPACT 2017)": {
      "studies": [
        "msk_impact_2017"
      ],
      "all": [
        {
          "kind": "clinical",
          "attribute": "CANCER_TYPE",
          "values": [
            "Non-Small Cell Lung Cancer"
          ]
        }
      ]
    },
    "NSCLC (MSK-CHORD)": {
      "studies": [
        "msk_chord_2024"
      ],
      "all": [
        {
          "kind": "clinical",
          "attribute": "CANCER_TYPE",
          "values": [
            "Non-Small Cell Lung Cancer"
          ]
        }
      ]
    }
  },
  "views": [
    {
      "kind": "riskmodel",
      "cohorts": [
        "NSCLC (MSK-IMPACT 2017)"
      ],
      "runs": 10,
      "validateOn": "NSCLC (MSK-CHORD)"
    }
  ]
}

PSA response to hormone therapy, by TP53 statusNEW

labsresponsewaterfalltimeline-eventslab-values

A `labs` view: a lab value's course from a treatment start, as % change from each patient's own baseline — median and interquartile band per 4-week bin, from histograms, so any site can contribute — with the best response, the share meeting a response threshold (here PCWG3's PSA50, counted exactly), and a waterfall of every patient's best change where the participant may disclose patient-level values.

Prostate cancer in MSK-CHORD, from the first hormone therapy. PSA falls by a median of more than 95% within three months in both groups, but 93.0% of TP53 wild-type patients reach PSA50 against 85.8% of TP53-mutant ones (Fisher p = 1.4e-6), and the mutant group's upper quartile turns back upward within a year.

msk_chord_20242 cohorts: Prostate, TP53 mutant, Prostate, TP53 wild-type
document
{
  "study": "msk_chord_2024",
  "cohorts": {
    "Prostate, TP53 mutant": {
      "all": [
        {
          "kind": "clinical",
          "attribute": "CANCER_TYPE",
          "values": [
            "Prostate Cancer"
          ]
        },
        {
          "kind": "oql",
          "q": "TP53: MUT"
        }
      ]
    },
    "Prostate, TP53 wild-type": {
      "all": [
        {
          "kind": "clinical",
          "attribute": "CANCER_TYPE",
          "values": [
            "Prostate Cancer"
          ]
        },
        {
          "not": {
            "kind": "oql",
            "q": "TP53"
          }
        }
      ]
    }
  },
  "views": [
    {
      "kind": "labs",
      "cohorts": [
        "Prostate, TP53 mutant",
        "Prostate, TP53 wild-type"
      ],
      "test": "PSA",
      "anchor": {
        "eventType": "Treatment",
        "key": "SUBTYPE",
        "value": "Hormone"
      }
    }
  ]
}

Cancer types summary: RAS genes across 50,000 tumours

cancertypesfrequencypan-cancer

A `cancertypes` view, cBioPortal's Cancer Types Summary: the share of samples altered in at least one of a gene list per cancer type, each bar split by mutation, amplification, deep deletion, structural variant or several at once, over the samples profiled for at least one of the genes. Small cancer types are pooled into one named bar, not dropped.

KRAS, NRAS and HRAS across MSK-IMPACT 50K. Pancreatic cancer leads at 82%, appendiceal and colorectal follow, and the bars show where RAS is amplified rather than mutated — germ cell tumours and esophagogastric cancer.

msk_impact_50k_20261 cohort: all patients
document
{
  "study": "msk_impact_50k_2026",
  "cohorts": {
    "all patients": {
      "all": []
    }
  },
  "views": [
    {
      "kind": "cancertypes",
      "cohorts": [
        "all patients"
      ],
      "genes": [
        "KRAS",
        "NRAS",
        "HRAS"
      ],
      "minSamples": 200
    }
  ]
}

Cohort overlap: how four groups share their patients

overlapupset

An `overlap` view, the portal's Overlap tab drawn as an UpSet plot: for every combination of cohorts, the patients in exactly those cohorts and no other. Each study answers with one count per combination, and every cohort's size here equals its own count.

TP53-mutant, KRAS-mutant, immunotherapy-treated and NSCLC patients in MSK-CHORD. 5,314 TP53-mutant patients belong to none of the other three groups; 435 are in all four.

msk_chord_20244 cohorts: TP53 mutant, KRAS mutant, Immunotherapy, NSCLC
document
{
  "study": "msk_chord_2024",
  "cohorts": {
    "TP53 mutant": {
      "all": [
        {
          "kind": "oql",
          "q": "TP53: MUT"
        }
      ]
    },
    "KRAS mutant": {
      "all": [
        {
          "kind": "oql",
          "q": "KRAS: MUT"
        }
      ]
    },
    "Immunotherapy": {
      "all": [
        {
          "kind": "event",
          "a": {
            "eventType": "Treatment",
            "attrs": [
              {
                "key": "SUBTYPE",
                "value": "Immuno"
              }
            ]
          },
          "rel": {
            "type": "NONE"
          }
        }
      ]
    },
    "NSCLC": {
      "all": [
        {
          "kind": "clinical",
          "attribute": "CANCER_TYPE",
          "values": [
            "Non-Small Cell Lung Cancer"
          ]
        }
      ]
    }
  },
  "views": [
    {
      "kind": "overlap",
      "cohorts": [
        "TP53 mutant",
        "KRAS mutant",
        "Immunotherapy",
        "NSCLC"
      ]
    }
  ]
}

Alteration enrichment: what separates colorectal from pancreatic tumours

enrichmentvolcano

An `enrichment` view, the portal's Genomic Alterations tab: every gene's mutation frequency in two cohorts, counted in samples over the samples profiled for that gene, with a Fisher test per gene and Benjamini–Hochberg across all of them, drawn as a volcano beside a table. MSI-high tumours are excluded from both cohorts, because hypermutated tumours enrich almost every gene at once.

Microsatellite-stable colorectal against pancreatic cancer in MSK-CHORD. APC, TCF7L2, PIK3CA, FBXW7 and SOX9 mark colorectal cancer; KRAS and CDKN2A mark pancreatic cancer.

msk_chord_20242 cohorts: Colorectal, MSS, Pancreatic, MSS
document
{
  "study": "msk_chord_2024",
  "cohorts": {
    "Colorectal, MSS": {
      "all": [
        {
          "kind": "clinical",
          "attribute": "CANCER_TYPE",
          "values": [
            "Colorectal Cancer"
          ]
        },
        {
          "not": {
            "kind": "clinical",
            "attribute": "MSI_TYPE",
            "values": [
              "Instable"
            ]
          }
        }
      ]
    },
    "Pancreatic, MSS": {
      "all": [
        {
          "kind": "clinical",
          "attribute": "CANCER_TYPE",
          "values": [
            "Pancreatic Cancer"
          ]
        },
        {
          "not": {
            "kind": "clinical",
            "attribute": "MSI_TYPE",
            "values": [
              "Instable"
            ]
          }
        }
      ]
    }
  },
  "views": [
    {
      "kind": "enrichment",
      "cohorts": [
        "Colorectal, MSS",
        "Pancreatic, MSS"
      ]
    }
  ]
}

Mutational signatures: what UV light and tobacco leave behind

assaysmutational signaturesvolcano

An `assays` view, the portal's generic-assay comparison tabs: every entity of one generic-assay profile — here the 30 COSMIC v2 mutational signatures — compared between two cohorts with Welch's t on each cohort's n, mean and variance, Benjamini–Hochberg across the signatures, drawn as a volcano of the difference in mean contribution beside a table. A categorical profile such as arm-level copy number is compared the same way with a chi-squared test.

Melanoma against non-small cell lung cancer in MSK-IMPACT 50K. The UV signature (7) makes up about half of a melanoma's mutations and almost none of a lung cancer's; the smoking signature (4) is the reverse.

msk_impact_50k_20262 cohorts: Melanoma, Non-small cell lung
document
{
  "study": "msk_impact_50k_2026",
  "cohorts": {
    "Melanoma": {
      "all": [
        {
          "kind": "clinical",
          "attribute": "CANCER_TYPE",
          "values": [
            "Melanoma"
          ]
        }
      ]
    },
    "Non-small cell lung": {
      "all": [
        {
          "kind": "clinical",
          "attribute": "CANCER_TYPE",
          "values": [
            "Non-Small Cell Lung Cancer"
          ]
        }
      ]
    }
  },
  "views": [
    {
      "kind": "assays",
      "cohorts": [
        "Melanoma",
        "Non-small cell lung"
      ],
      "profileType": "mutational_signatures_contribution_v2"
    }
  ]
}

Composition: T and NK cell states by mutational signature (MSK SPECTRUM)NEW

compositioncustom-datasingle-cell

A `composition` view, the stacked-bar panels of single-cell papers: each patient's T/NK cells split into ten states (custom data, one attribute per state), ordered by the dysfunctional CXCL13+ CD8 share, each signature's mean beside its patients, and a matrix of every state in each signature against the other two. A second view does the same per sample from the study's own generic-assay cell-type fractions.

customRuns on demo data bundled with the app: SPECTRUM scRNA: cell-type composition (demo) (41 patients), SPECTRUM scRNA: T/NK cell states (demo) (41 patients), SPECTRUM scRNA: T/NK fine states (41) (demo) (41 patients), SPECTRUM scRNA: macrophage & DC states (demo) (41 patients), SPECTRUM scRNA: cancer cell states, signalling & 6p LOH (demo) (41 patients), SPECTRUM scRNA: site-matched sample features (demo) (61 samples).

The 36 SPECTRUM patients with a consensus signature other than Undetermined, split as the paper splits them. Dysfunctional CXCL13+ CD8 T cells are a mean 7.0% of T/NK cells in the 16 HRD-Dup patients against 4.9% in HRD-Del and 4.4% in FBI, and naive CD4 cells the reverse (15.2% against 19.6% and 20.1%) — the direction of the paper's Fig. 4b. The clearest single difference is cycling T/NK cells, higher in HRD-Dup (8.6% against 5.7%; Welch p = 0.003, q = 0.08 across the 30 comparisons); none reaches q < 0.05 at this size, which the matrix shows as no outlined dot. Per sample, from the study's cell-type fractions, T cells are 24% of HRD-Dup samples' cells against 32% of FBI's. The paper fits a binomial model on cell counts with site and sort as covariates; this view compares shares between groups and says so.

msk_spectrum_tme_20223 cohorts: HRD-Dup, HRD-Del, FBI
document
{
  "study": "msk_spectrum_tme_2022",
  "cohorts": {
    "HRD-Dup": {
      "all": [
        {
          "kind": "clinical",
          "attribute": "CONSENSUS_SIGNATURE",
          "values": [
            "HRD-Dup"
          ]
        }
      ]
    },
    "HRD-Del": {
      "all": [
        {
          "kind": "clinical",
          "attribute": "CONSENSUS_SIGNATURE",
          "values": [
            "HRD-Del"
          ]
        }
      ]
    },
    "FBI": {
      "all": [
        {
          "kind": "clinical",
          "attribute": "CONSENSUS_SIGNATURE",
          "values": [
            "FBI"
          ]
        }
      ]
    }
  },
  "views": [
    {
      "kind": "composition",
      "cohorts": [
        "HRD-Dup",
        "HRD-Del",
        "FBI"
      ],
      "attributes": [
        "custom:spectrum-sc-tnk/TNK_CD4_T_CXCL13",
        "custom:spectrum-sc-tnk/TNK_CD4_T_naive",
        "custom:spectrum-sc-tnk/TNK_CD4_T_reg",
        "custom:spectrum-sc-tnk/TNK_CD8_T_CXCL13",
        "custom:spectrum-sc-tnk/TNK_CD8_T_ISG",
        "custom:spectrum-sc-tnk/TNK_CD8_T_cytotoxic",
        "custom:spectrum-sc-tnk/TNK_Cycling_T_NK",
        "custom:spectrum-sc-tnk/TNK_ILC",
        "custom:spectrum-sc-tnk/TNK_NK_CD56",
        "custom:spectrum-sc-tnk/TNK_NK_cytotoxic"
      ],
      "sort": "custom:spectrum-sc-tnk/TNK_CD8_T_CXCL13"
    },
    {
      "kind": "composition",
      "cohorts": [
        "HRD-Dup",
        "HRD-Del",
        "FBI"
      ],
      "profileType": "cell_type_relative_counts",
      "sort": "T_cell"
    }
  ]
}

Composition: adenomas and serrated polyps, from a generic single-cell summary (HTAN Vanderbilt)NEW

compositioncustom-datasingle-cell

Single-cell data brought in without a study-specific script: scripts/gen-singlecell-summary.py proposed the mapping from a Cell Explorer dataset to this study (donor_id is the patient, the HTAN Specimen ID the sample) and summarised the cell labels per sample. The first view draws those custom data; the second the study's own generic-assay cell-type fractions, for comparison.

customRuns on demo data bundled with the app: HTAN Vanderbilt colorectal polyp scRNA-seq (Chen et al., Cell 2021) — per patient (51 patients), HTAN Vanderbilt colorectal polyp scRNA-seq (Chen et al., Cell 2021) — per sample (55 samples).

crc_hta11_htan_2021 is 52 patients with colorectal polyps (Chen et al., Cell 2021). The summary covers 55 of its 61 samples; its counts equal the study's own absolute_counts profile for all 670 sample and cell-type pairs it reports. Per sample, adenoma-specific cells (ASC) are 32.1% of the epithelium in the 30 conventional adenomas against 4.1% in the 20 serrated polyps (q = 2e-5), and serrated-specific cells (SSC) 1.5% against 19.7% (q = 0.003): the two paths to malignancy the paper describes. Stem cells (STM) differ little here (3.1% against 2.5%). The study's own fractions, over every cell type, give the same picture (ASC 29.9% against 3.7%). Cohorts are patients, so a patient with polyps of both types counts in both; 5 of the 52 have both.

crc_hta11_htan_20212 cohorts: Conventional adenoma, Serrated polyp
document
{
  "study": "crc_hta11_htan_2021",
  "cohorts": {
    "Conventional adenoma": {
      "all": [
        {
          "kind": "clinical",
          "attribute": "POLYP_TYPE",
          "values": [
            "AD"
          ]
        }
      ]
    },
    "Serrated polyp": {
      "all": [
        {
          "kind": "clinical",
          "attribute": "POLYP_TYPE",
          "values": [
            "SER"
          ]
        }
      ]
    }
  },
  "views": [
    {
      "kind": "composition",
      "cohorts": [
        "Conventional adenoma",
        "Serrated polyp"
      ],
      "unit": "sample",
      "attributes": [
        "custom:hta11-sc-s/EPI_Cell_Type_ABS",
        "custom:hta11-sc-s/EPI_Cell_Type_ASC",
        "custom:hta11-sc-s/EPI_Cell_Type_CT",
        "custom:hta11-sc-s/EPI_Cell_Type_EE",
        "custom:hta11-sc-s/EPI_Cell_Type_GOB",
        "custom:hta11-sc-s/EPI_Cell_Type_SSC",
        "custom:hta11-sc-s/EPI_Cell_Type_STM",
        "custom:hta11-sc-s/EPI_Cell_Type_TAC",
        "custom:hta11-sc-s/EPI_Cell_Type_TUF"
      ],
      "sort": "custom:hta11-sc-s/EPI_Cell_Type_ASC"
    },
    {
      "kind": "composition",
      "cohorts": [
        "Conventional adenoma",
        "Serrated polyp"
      ],
      "profileType": "relative_counts",
      "sort": "ASC"
    }
  ]
}

KRAS codon 12/13 mutations in colorectal cancer, clonal-looking calls first

mutationsdata-tablefilter

A table view's query: `columns` picks what is shown, `filters` keeps rows — a regular expression on protein change, a range on allele frequency — and `sort` orders them, all in the database across the whole table. The caveat says how many rows the query kept of how many; the download holds every kept row with every column. The same fields work on the `table` view.

MSK-CHORD patients with a colorectal cancer sample: their KRAS G12/G13 calls at an allele frequency of 0.2 or more, highest first.

msk_chord_20241 cohort: Colorectal
document
{
  "study": "msk_chord_2024",
  "cohorts": {
    "Colorectal": {
      "all": [
        {
          "kind": "clinical",
          "attribute": "CANCER_TYPE",
          "values": [
            "Colorectal Cancer"
          ]
        }
      ]
    }
  },
  "views": [
    {
      "kind": "mutations",
      "cohorts": [
        "Colorectal"
      ],
      "gene": "KRAS",
      "columns": [
        "sample",
        "proteinChange",
        "annotation",
        "vaf",
        "mutCount"
      ],
      "filters": {
        "proteinChange": {
          "op": "regex",
          "value": "^G1[23]"
        },
        "vaf": {
          "min": 0.2
        }
      },
      "sort": {
        "column": "vaf",
        "desc": true
      }
    }
  ]
}

ALK, ROS1 and RET structural variants in MSK-IMPACT

svdata-tablestructural-variants

The Results View's Structural Variants tab as a view: every structural variant with either partner a queried gene, one row per call with the portal's default columns, and per gene how many samples were profiled for it — a sample whose panel does not list a gene is not counted as without a fusion in it.

MSK-IMPACT 2017 (10,945 samples): every call involving ALK, ROS1 or RET as either partner, drivers first.

msk_impact_20171 cohort: MSK-IMPACT
document
{
  "study": "msk_impact_2017",
  "cohorts": {
    "MSK-IMPACT": {
      "all": []
    }
  },
  "views": [
    {
      "kind": "sv",
      "cohorts": [
        "MSK-IMPACT"
      ],
      "genes": [
        "ALK",
        "ROS1",
        "RET"
      ]
    }
  ]
}

Clinical data: every pancreatic cancer sample, oldest patients first

tabledata-tabledownload

A `table` view, the portal's Clinical Data tab: one row per sample of the cohort's patients with every clinical attribute the study records, sorted by one of them, the first rows on screen and every row as a download. Its rows are patients, so only a study that may disclose patients lists them; any other is named with how many it holds.

Pancreatic cancer in MSK-CHORD, sorted by age, highest first.

msk_chord_20241 cohort: Pancreatic
document
{
  "study": "msk_chord_2024",
  "cohorts": {
    "Pancreatic": {
      "all": [
        {
          "kind": "clinical",
          "attribute": "CANCER_TYPE",
          "values": [
            "Pancreatic Cancer"
          ]
        }
      ]
    }
  },
  "views": [
    {
      "kind": "table",
      "cohorts": [
        "Pancreatic"
      ],
      "sort": {
        "column": "CURRENT_AGE_DEID",
        "desc": true
      },
      "rows": 25
    }
  ]
}

A patient's timeline: treatments, diagnoses, samples and lab values from diagnosis

timelinealterationsdata-tablepatient

A `timeline` view, the portal's patient-view Timeline: the chosen patient's clinical events as tracks — treatment nested by subtype and agent, lab tests as line charts, samples as numbered markers — with the list of the cohort's patients to choose from (a table: searchable, sortable, downloadable). `patient` names who is drawn; `collapsed` folds a track's sub-tracks into one row. Beside it, an `alterations` view of the same patient: their mutations, copy-number alterations and structural variants, as the portal's patient page lists them under the timeline. Both name a patient, so only a study that may disclose patients takes part.

MSK-CHORD breast cancer patients with the most timeline events first; P-0000012 drawn, with chemotherapy folded into one row, and P-0000012's alterations beside it.

msk_chord_20241 cohort: Breast
document
{
  "study": "msk_chord_2024",
  "cohorts": {
    "Breast": {
      "all": [
        {
          "kind": "clinical",
          "attribute": "CANCER_TYPE",
          "values": [
            "Breast Cancer"
          ]
        }
      ]
    }
  },
  "views": [
    {
      "kind": "timeline",
      "cohorts": [
        "Breast"
      ],
      "patient": {
        "study": "msk_chord_2024",
        "id": "P-0000012"
      },
      "collapsed": [
        "treatment.Chemo"
      ],
      "sort": {
        "column": "events",
        "desc": true
      }
    },
    {
      "kind": "alterations",
      "cohorts": [
        "Breast"
      ],
      "patient": {
        "study": "msk_chord_2024",
        "id": "P-0000012"
      }
    }
  ]
}

A patient's mutations, copy-number alterations and structural variants

alterationsdata-tablepatientcnastructural-variants

An `alterations` view, the portal's patient-view genomic tables: three tables in one view — Mutations, Copy Number Alterations, Structural Variants — for the chosen patient, with the cohort's patients listed to choose from. Each table has its own query under its own key (`mutations`, `cna`, `sv`: columns, search, filters, sort, rows); the top-level query is the patient list's. A variant, call or event is one row however many of the patient's samples carry it. Only a study that may disclose patients takes part.

MSK-CHORD prostate cancer patients, those with the most structural variants first; P-0024249's tables, mutations kept to OncoKB-oncogenic calls.

msk_chord_20241 cohort: Prostate
document
{
  "study": "msk_chord_2024",
  "cohorts": {
    "Prostate": {
      "all": [
        {
          "kind": "clinical",
          "attribute": "CANCER_TYPE",
          "values": [
            "Prostate Cancer"
          ]
        }
      ]
    }
  },
  "views": [
    {
      "kind": "alterations",
      "cohorts": [
        "Prostate"
      ],
      "patient": {
        "study": "msk_chord_2024",
        "id": "P-0024249"
      },
      "sort": {
        "column": "sv",
        "desc": true
      },
      "mutations": {
        "filters": {
          "annotation": {
            "op": "contains",
            "value": "Oncogenic"
          }
        }
      }
    }
  ]
}

A glioma's mutations across four samples over three and a half years

evolutionpatientvaftumor evolution

An `evolution` view, the portal's Genomic Evolution tab: each mutation's variant allele frequency in each of the patient's samples, the samples placed by the day each was collected. Mutations found in one sample are followed into the others — not found there (VAF 0) where the sample was sequenced for the gene, NOT PROFILED where its panel does not cover it — so the lines show clones rising and falling. The cohort's patients with two or more samples and allele counts are listed to choose from.

MSK glioma (2018): IM-GBM-28's eight mutations in two tumour resections, a recurrence and cerebrospinal fluid — TP53 Q136E and STAG2 N141I in the first tumours, replaced by TP53 R282G later; TERT promoter throughout.

glioma_msk_20181 cohort: Glioma
document
{
  "study": "glioma_msk_2018",
  "cohorts": {
    "Glioma": {
      "all": []
    }
  },
  "views": [
    {
      "kind": "evolution",
      "cohorts": [
        "Glioma"
      ],
      "patient": {
        "study": "glioma_msk_2018",
        "id": "IM-GBM-28"
      }
    }
  ]
}

Download tab: TP53, PIK3CA and GATA3 in TCGA breast cancer

datafilesdata-tabledownload

A `datafiles` view, the Results page's Download tab: the gene-by-sample files for the query's genes and every molecular profile the study holds, the altered and unaltered sample lists and the sample matrix, each downloadable whole; each line's alteration frequency among the samples profiled for it; and the table of every sample's alterations, searchable and sortable like any table view.

TCGA PanCancer Atlas breast cancer, the samples with mutation and copy-number data (the portal's cnaseq case set): the portal finds 704 of 996 (70.7%) altered in TP53, PIK3CA or GATA3.

brca_tcga_pan_can_atlas_20181 cohort: Queried
document
{
  "study": "brca_tcga_pan_can_atlas_2018",
  "cohorts": {
    "Queried": {
      "all": [
        {
          "kind": "caseList",
          "id": "cnaseq"
        }
      ]
    }
  },
  "views": [
    {
      "kind": "datafiles",
      "cohorts": [
        "Queried"
      ],
      "oql": [
        "TP53",
        "PIK3CA",
        "GATA3"
      ]
    }
  ]
}

A melanoma's mutational signatures: UV light behind nine in ten of its mutations

signaturespatientmutational signaturesspectrum

A `signatures` view, the portal's Mutational Signatures tab: each single-base-substitution signature's contribution to the patient's tumour, and the sample's 96-channel mutational spectrum from the study's counts profile. The cohort's patients with signature values are listed to choose from.

PCAWG melanoma: DO220875's mutations are dominated by SBS7a (UV light); its spectrum is the C>T substitutions at dipyrimidines that UV leaves behind.

pancan_pcawg_20201 cohort: Melanoma
document
{
  "study": "pancan_pcawg_2020",
  "cohorts": {
    "Melanoma": {
      "all": [
        {
          "kind": "clinical",
          "attribute": "CANCER_TYPE",
          "values": [
            "Melanoma"
          ]
        }
      ]
    }
  },
  "views": [
    {
      "kind": "signatures",
      "cohorts": [
        "Melanoma"
      ],
      "patient": {
        "study": "pancan_pcawg_2020",
        "id": "DO220875"
      }
    }
  ]
}

Co-expression: the genes that rise and fall with ESR1

correlatesexpression

A `correlates` view, the portal's Co-expression tab: one gene's mRNA against every gene's across a cohort, Spearman's ρ and Pearson's r computed from sums each database returns — n, Σx, Σy, Σxy, Σx², Σy² on the values and on their ranks — so no expression value leaves it, ranked by ρ with Benjamini–Hochberg across all genes.

TCGA PanCancer Atlas breast cancer. The oestrogen-receptor programme lines up behind ESR1 — CCDC170 (its neighbour on 6q25, often co-amplified), THSD4, FOXA1, TBC1D9 — and the genes of basal-like tumours fall away from it.

brca_tcga_pan_can_atlas_20181 cohort: all patients
document
{
  "study": "brca_tcga_pan_can_atlas_2018",
  "cohorts": {
    "all patients": {
      "all": []
    }
  },
  "views": [
    {
      "kind": "correlates",
      "cohorts": [
        "all patients"
      ],
      "gene": "ESR1",
      "profileType": "rna_seq_v2_mrna"
    }
  ]
}