Q (sonnet-5.5): What are the most frequently administered systemic therapy regimens for lung cancer patients in the MSK-CHORD Study? ▶ read_guide { "uri": "cbioportal://treatment-guide" } ▶ get_study_guide { "study_id": "msk_chord_2024" } ◀ result # Treatment Data Query Guide ## Overview Treatment data in cBioPortal is stored in **clinical event tables**, separate from clinical attributes. This allows for timeline-based treatment records with start/stop dates. ## Start Here: Treatment Views For "most common treatments / agents / regimens in study X", use the parameterized views (documented in `cbioportal://clinical-data-guide`, Study-View Chart Counts): ```sql -- Patients per agent (the portal's Treatment chart), with type/subtype arrays SELECT * FROM treatment_counts_in_study(study='msk_chord_2024') ORDER BY patients DESC LIMIT 20; -- Same-day agent combinations (investigational, prior-medication and radiation events excluded) SELECT * FROM treatment_regimens_in_study(study='msk_chord_2024') ORDER BY patients DESC LIMIT 20; ``` Write raw event queries (below) only for subgroups, timelines or keys the views do not expose. ## Key Tables | Table | Description | |-------|-------------| | `clinical_event` | Event records with patient_id, event_type, start_date, stop_date | | `clinical_event_data` | Key-value pairs linked to each clinical_event_id | ## Schema ``` clinical_event ├── clinical_event_id (PK) ├── patient_id (FK → patient.internal_id) ├── event_type (Treatment, TREATMENT, Diagnosis, SURGERY, etc.) ├── start_date (days from diagnosis) └── stop_date (days from diagnosis) clinical_event_data ├── clinical_event_id (FK) ├── key (AGENT, SUBTYPE, etc.) └── value ``` ## Event Types Not all studies have all event types. Common ones include: | Event Type | Description | |------------|-------------| | `Treatment` / `TREATMENT` | Drug/therapy administration | | `SURGERY` | Surgical procedures | | `Diagnosis` | Diagnosis events | | `LAB_TEST` | Laboratory results | | `Sequencing` | Sequencing events | | `Sample acquisition` | Sample collection | | `PATHOLOGY` / `Pathology` | Pathology reports | ## Basic *** Queries ### List Available Event Types in a Study ```sql SELECT DISTINCT ce.event_type, COUNT(*) as event_count FROM clinical_event ce JOIN patient p ON ce.patient_id = p.internal_id JOIN cancer_study cs ON p.cancer_study_id = cs.cancer_study_id WHERE cs.cancer_study_identifier = 'your_study_id' GROUP BY ce.event_type ORDER BY event_count DESC; ``` ### List Treatment Data Keys in a Study ```sql SELECT DISTINCT ced.key, COUNT(*) as cnt FROM clinical_event ce JOIN clinical_event_data ced ON ce.clinical_event_id = ced.clinical_event_id JOIN patient p ON ce.patient_id = p.internal_id JOIN cancer_study cs ON p.cancer_study_id = cs.cancer_study_id WHERE cs.cancer_study_identifier = 'your_study_id' AND ce.event_type IN ('Treatment', 'TREATMENT') GROUP BY ced.key ORDER BY cnt DESC; ``` ### Get Most Common Treatment Agents ```sql SELECT ced.value as agent, COUNT(DISTINCT ce.patient_id) as patient_count FROM clinical_event ce JOIN clinical_event_data ced ON ce.clinical_event_id = ced.clinical_event_id JOIN patient p ON ce.patient_id = p.internal_id JOIN cancer_stud … (6220 more chars) ◀ result # MSK-CHORD (MSK, Nature 2024) **Study ID:** `msk_chord_2024` ## Overview Targeted sequencing via MSK-IMPACT panels. Clinical annotations include some derived from natural language processing (denoted NLP). **Exactly five cancer types** (`CANCER_TYPE`, patients): Non-Small Cell Lung Cancer 7,809, Colorectal Cancer 5,543, Breast Cancer 5,368, Prostate Cancer 3,211, Pancreatic Cancer 3,109. There is **no melanoma** or any other cancer type; say so up front if asked, instead of substituting another type. **No therapy-response variable.** There is no RECIST, objective response, or best-response attribute or event. For treatment-outcome questions (e.g. immunotherapy response), say this first; the only proxies are `OS_MONTHS`/`OS_STATUS`, or NLP radiology progression events (`Diagnosis` events with `SUBTYPE = 'Progression'`, key `PROGRESSION` = Y/N/Indeterminate), in patients with `Treatment` events of the relevant `SUBTYPE` (e.g. `Immuno`: 3,341 patients). Hand off the comparison to cBioPortal group comparison / survival. **Nearly one sample per patient: 24,950 patients / 25,040 samples.** Only 90 patients have more than one sample, and all 90 have samples from two different cancer types (second primaries); only 26 have both a `Primary` and a `Metastasis` sample. There is no meaningful same-patient (paired) primary-vs-metastasis cohort. For "same patient" / paired questions, say this up front, then offer the **unpaired** comparison of all `Primary` vs `Metastasis` samples (`SAMPLE_TYPE`), labelled as unpaired. ```sql SELECT countIf(n > 1) AS multi_sample_patients, -- 90 countIf(has_p AND has_m) AS primary_and_met -- 26 FROM (SELECT patient_unique_id, count() AS n, has(groupArray(attribute_value), 'Primary') AS has_p, has(groupArray(attribute_value), 'Metastasis') AS has_m FROM clinical_data_derived WHERE cancer_study_identifier = 'msk_chord_2024' AND attribute_name = 'SAMPLE_TYPE' GROUP BY patient_unique_id); ``` ## Gene Panels This study uses multiple MSK-IMPACT panel versions: - **IMPACT341**: Earlier version, 341 genes - **IMPACT410**: 410 genes - **IMPACT468**: 468 genes - **IMPACT505**: Latest version, 505 genes **Important:** Different samples may have different gene coverage. Always use gene-specific denominators when calculating mutation frequencies. ## Clinical Attributes - Semantic Guide ### Cancer Classification | Attribute | Description | Values | |-----------|-------------|--------| | `CANCER_TYPE` | Broad cancer category | e.g., "Non-Small Cell Lung Cancer", "Breast Cancer" | | `CANCER_TYPE_DETAILED` | Specific subtype | e.g., "Lung Adenocarcinoma", "Invasive Ductal Carcinoma" | | `ONCOTREE_CODE` | OncoTree classification code | Standardized cancer type codes | ### Sample Information | Attribute | Description | Values | |-----------|-------------|--------| | `SAMPLE_TYPE` | Sample origin | Primary, Metastasis, Local Recurrence, Unknown | | `SAMPLE_CLASS` | Sample … (5439 more chars) ▶ clickhouse_list_table_columns { "table": "clinical_event_derived" } ▶ clickhouse_list_table_columns { "table": "clinical_data_derived" } ◀ result {"columns":[{"name":"clinical_event_id","type":"Int64"},{"name":"patient_id","type":"Nullable(Int64)"},{"name":"patient_stable_id","type":"String"},{"name":"start_date","type":"Nullable(Int64)"},{"name":"stop_date","type":"Nullable(Int64)"},{"name":"event_type","type":"LowCardinality(String)"},{"name":"cancer_study_identifier","type":"LowCardinality(String)"}]} ◀ result {"columns":[{"name":"internal_id","type":"Int32"},{"name":"sample_unique_id","type":"String","comment":"Globally unique sample ID: cancer_study_identifier + \"_\" + sample.stable_id. Empty for patient-level attributes. Use this for sample filtering and joins."},{"name":"patient_unique_id","type":"String","comment":"Globally unique patient ID: cancer_study_identifier + \"_\" + patient.stable_id. Present for both sample and patient-level attributes."},{"name":"attribute_name","type":"LowCardinality(String)","comment":"Clinical attribute name (e.g., SAMPLE_TYPE, CANCER_TYPE, AGE, OS_MONTHS). Use with attribute_value for filtering. AGE may be floored or capped for de-identification (e.g. all children recorded as 18, or everyone 89+ recorded as 89 or 90): before age statistics check for a pile-up at the min/max, and if present compute age from DAYS_TO_BIRTH (-days / 365.25)."},{"name":"attribute_value","type":"String","comment":"Value of the clinical attribute (String). For SAMPLE_TYPE: Primary, Metastasis, Local Recurrence, Unknown. Missing values are empty strings, so use toFloat64OrNull(attribute_value) for numeric comparisons — CAST fails on them."},{"name":"cancer_study_identifier","type":"LowCardinality(String)"},{"name":"type","type":"LowCardinality(String)","comment":"Data level: \"sample\" for sample-level attributes (e.g., SAMPLE_TYPE), \"patient\" for patient-level attributes (e.g., AGE, OS_MONTHS)."}]} ▶ clickhouse_list_table_columns { "table": "clinical_event_data_derived" } ◀ result {"columns":[{"name":"patient_unique_id","type":"String"},{"name":"key","type":"String"},{"name":"value","type":"String"},{"name":"start_date","type":"Int32"},{"name":"stop_date","type":"Int32"},{"name":"event_type","type":"LowCardinality(String)"},{"name":"cancer_study_identifier","type":"LowCardinality(String)"}]} ▶ clickhouse_run_select_query { "query": "WITH lung AS (SELECT DISTINCT patient_unique_id FROM clinical_data_derived WHERE cancer_study_identifier='msk_chord_2024' AND attribute_name='CANCER_TYPE' AND attribute_value='Non-Small Cell Lung Cancer'), ev AS ( SELECT e.patient_unique_id p, e.start_date s, e.stop_date t, anyIf(e.value, e.key='AGENT') ag, anyIf(e.value, e.key='SUBTYPE') st FROM clinical_event_data_derived e WHERE e.cancer_study_identifier='msk_chord_2024' AND e.event_type IN ('Treatment','TREATMENT') AND e.patient_unique_id IN (SELECT patient_unique_id FROM lung) AND e.key IN ('AGENT','SUBTYPE') GROUP BY e.patient_unique_id, e.start_date, e.stop_date, e.value, e.key ), ev2 AS (SELECT p, s, t, max(ag) ag, max(st) st FROM ev GROUP BY p, s, t, ag, st) SELECT 'x' k, 1 n" } ◀ result {"rows":[{"k":"x","n":1}]} ▶ clickhouse_run_select_query { "query": "WITH lung AS (SELECT DISTINCT patient_unique_id FROM clinical_data_derived WHERE cancer_study_identifier='msk_chord_2024' AND attribute_name='CANCER_TYPE' AND attribute_value='Non-Small Cell Lung Cancer'), tx AS ( SELECT ce.clinical_event_id id, ce.patient_stable_id ps, ce.start_date sd FROM clinical_event_derived ce WHERE ce.cancer_study_identifier='msk_chord_2024' AND ce.event_type IN ('Treatment','TREATMENT') AND concat('msk_chord_2024_', ce.patient_stable_id) IN (SELECT patient_unique_id FROM lung) ), ag AS ( SELECT tx.ps ps, tx.sd sd, ced.value agent, subt.value st FROM tx JOIN clinical_event_data ced ON ced.clinical_event_id=tx.id AND ced.key='AGENT' LEFT JOIN clinical_event_data subt ON subt.clinical_event_id=tx.id AND subt.key='SUBTYPE' WHERE subt.value IN ('Chemo','Immuno','Targeted','Biologic') ), reg AS (SELECT ps, sd, arrayStringConcat(arraySort(groupUniqArray(agent)),' + ') regimen FROM ag GROUP BY ps, sd) SELECT regimen, uniqExact(ps) patients, count() administrations FROM reg GROUP BY regimen ORDER BY patients DESC LIMIT 15" } ▶ clickhouse_run_select_query { "query": "WITH lung AS (SELECT DISTINCT patient_unique_id FROM clinical_data_derived WHERE cancer_study_identifier='msk_chord_2024' AND attribute_name='CANCER_TYPE' AND attribute_value='Non-Small Cell Lung Cancer') SELECT count() FROM lung" } ◀ result {"rows":[{"regimen":"CARBOPLATIN + PEMETREXED","patients":1193,"administrations":1228},{"regimen":"OSIMERTINIB","patients":1064,"administrations":1319},{"regimen":"PEMBROLIZUMAB","patients":756,"administrations":841},{"regimen":"GEMCITABINE","patients":715,"administrations":740},{"regimen":"CISPLATIN + PEMETREXED","patients":687,"administrations":695},{"regimen":"CARBOPLATIN + PEMBROLIZUMAB + PEMETREXED","patients":634,"administrations":641},{"regimen":"NIVOLUMAB","patients":541,"administrations":583},{"regimen":"ERLOTINIB","patients":486,"administrations":800},{"regimen":"BEVACIZUMAB + CARBOPLATIN + PEMETREXED","patients":454,"administrations":462},{"regimen":"DOCETAXEL","patients":436,"administrations":447},{"regimen":"CARBOPLATIN + PACLITAXEL","patients":432,"administrations":444},{"regimen":"CARBOPLATIN","patients":394,"administrations":398},{"regimen":"BEVACIZUMAB","patients":321,"administrations":358},{"regimen":"DOCETAXEL + RAMUCIRUMAB","patients":311,"administrations":314},{"regimen":"GEMCITABINE + VINORELBINE","patients":310,"administrations":315}]} ◀ result {"rows":[{"count()":7809}]} ▶ navigate_to_study_view { "studyIds": [ "msk_chord_2024" ], "filterJson": { "clinicalDataFilters": [ { "attributeId": "CANCER_TYPE", "values": [ { "value": "Non-Small Cell Lung Cancer" } ] } ] } } ◀ result {"success":true,"message":"Navigating to https://www.cbioportal.org/study/summary?id=msk_chord_2024#filterJson=%7B%22clinicalDataFilters%22%3A%5B%7B%22attributeId%22%3A%22CANCER_TYPE%22%2C%22values%22%3A%5B%7B%22value%22%3A%22Non-Small%20Cell%20Lung%20Cancer%22%7D%5D%7D%5D%7D","url":"https://www.cbioportal.org/study/summary?id=msk_chord_2024#filterJson=%7B%22clinicalDataFilters%22%3A%5B%7B%22attributeId%22%3A%22CANCER_TYPE%22%2C%22values%22%3A%5B%7B%22value%22%3A%22Non-Small%20Cell%20Lung%20Cancer%22%7D%5D%7D%5D%7D","data":{"studyIds":["msk_chord_2024"],"studies":[{"studyId":"msk_chord_2024","name":"MSK-CHORD (MSK, Nature 2024)","sampleCount":25040}],"tab":"summary","hasFilters":true,"hasPlotsConfig":false,"pageDescription":"Overview of all study data displayed as interactive charts summarizing available clinical and genomic data. Click within a chart to filter. Additional charts may be available in the Charts menu."}} ═ answer (success) In MSK-CHORD, the lung cancer cohort is the 7,809 patients with Non-Small Cell Lung Cancer. It is the only lung cancer type in the study. A regimen here means the set of systemic agents given to a patient on the same start date. I included chemotherapy, immunotherapy, targeted and biologic agents. I left out radiation, investigational drugs and medications given before MSK care. **Top regimens by number of patients** | # | Regimen | Patients | |---|---|---| | 1 | Carboplatin + Pemetrexed | 1,193 | | 2 | Osimertinib | 1,064 | | 3 | Pembrolizumab | 756 | | 4 | Gemcitabine | 715 | | 5 | Cisplatin + Pemetrexed | 687 | | 6 | Carboplatin + Pembrolizumab + Pemetrexed | 634 | | 7 | Nivolumab | 541 | | 8 | Erlotinib | 486 | | 9 | Bevacizumab + Carboplatin + Pemetrexed | 454 | | 10 | Docetaxel | 436 | | 11 | Carboplatin + Paclitaxel | 432 | | 12 | Carboplatin | 394 | | 13 | Bevacizumab | 321 | | 14 | Docetaxel + Ramucirumab | 311 | | 15 | Gemcitabine + Vinorelbine | 310 | - **Platinum–pemetrexed chemotherapy is the most common.** It appears as carboplatin or cisplatin with pemetrexed, and also with pembrolizumab or bevacizumab added. - **Osimertinib and erlotinib are the main targeted regimens.** Osimertinib is the second most frequent regimen overall. - **Pembrolizumab and nivolumab are the main immunotherapy regimens** when given alone. - **The counts overlap.** A patient who received several regimens is counted under each one. - **Some agents may be given on different dates.** For example, if a patient gets pembrolizumab on a different day from their chemotherapy, it appears as a separate regimen. - **I haven't calculated percentages.** The data can't distinguish a treatment that wasn't given from one that wasn't recorded, so a percentage would be unreliable. - **Some treatment records are NLP-derived**, so extraction errors are possible. [View the MSK-CHORD lung cancer (NSCLC) cohort in cBioPortal](https://www.cbioportal.org/study/summary?id=msk_chord_2024#filterJson=%7B%22clinicalDataFilters%22%3A%5B%7B%22attributeId%22%3A%22CANCER_TYPE%22%2C%22values%22%3A%5B%7B%22value%22%3A%22Non-Small%20Cell%20Lung%20Cancer%22%7D%5D%7D%5D%7D)