Q (sonnet): Which genomic alterations are associated with immunotherapy response in melanoma patients from the MSK-CHORD Study? ▶ list_studies { "search": "CHORD" } ▶ list_guides {} ◀ result {"result":[{"cancer_study_identifier":"msk_chord_2024","name":"MSK-CHORD (MSK, Nature 2024)","type_of_cancer_id":"mixed","sample_count":25040,"has_guide":true,"url":"https://www.cbioportal.org/study/summary?id=msk_chord_2024"}]} ◀ result {"result":[{"uri":"cbioportal://mutation-frequency-guide","description":"Comprehensive guide for calculating gene mutation frequencies with gene-specific profiling denominators"},{"uri":"cbioportal://clinical-data-guide","description":"Guide for querying clinical data including patient vs sample level considerations"},{"uri":"cbioportal://sample-filtering-guide","description":"Guide for filtering samples and studies in cBioPortal queries"},{"uri":"cbioportal://common-pitfalls","description":"Guide to avoid common mistakes when querying cBioPortal data. If you already know which numbered pitfall applies, fetch just that section via read_guide(\"cbioportal://common-pitfalls#\") (e.g. #16) instead of the full guide"},{"uri":"cbioportal://treatment-guide","description":"Guide for querying treatment/clinical event data including drug agents, timelines, and linking to genomic data"},{"uri":"cbioportal://faq-guide","description":"General cBioPortal FAQ: history, how to cite, data types, reference genome, abbreviations, GISTIC thresholds, API access"},{"uri":"cbioportal://statistical-tests-guide","description":"Statistical test selection guide — decision matrix for choosing Fisher's exact, Wilcoxon, chi-squared, t-test, ANOVA, etc. based on data type and group count"},{"uri":"cbioportal://gene-expression-guide","description":"Gene expression / copy-number / methylation analysis. Covers genetic_alteration_derived, profile_type discovery, and the gene_pair_coexpression view for Spearman correlation between two genes"},{"uri":"cbioportal://external-resources-guide","description":"Guide for finding external linked resources such as imaging, pathology, Minerva, HTAN, or other resource_* table links before declaring data unavailable"},{"uri":"cbioportal://gene-resolution-guide","description":"Guide for resolving ambiguous gene symbols, aliases, gene families, and shorthand such as CD3 before querying expression or alteration data"},{"uri":"cbioportal://study-resolution-guide","description":"Guide for resolving requested studies, avoiding silent substitute cohorts, and redirecting to known external cBioPortal instances when data is not in this deployment"},{"uri":"cbioportal://germline-guide","description":"Guide for querying germline variant data — storage columns, study discovery, query patterns, and somatic vs germline considerations"},{"uri":"cbioportal://study-guide/{study_id}","description":"Dynamic study-specific guide - use get_study_guide(study_id) tool to generate"}]} ▶ get_study_guide { "study_id": "msk_chord_2024" } ◀ 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) ▶ read_guide { "uri": "cbioportal://clinical-data-guide" } ▶ search_oncotree { "search_term": "melanoma" } ◀ result # Clinical Data Query Guide ## Overview Clinical data in cBioPortal is stored at both patient and sample levels. Understanding the distinction is crucial for accurate analysis. ## Data Organization ### Patient-Level vs Sample-Level Data - **Patient-level**: Demographics, overall survival, disease stage (stored once per patient) - **Sample-level**: Sample type, sequencing platform, purity (can have multiple per patient) ### Key Tables - `clinical_patient`: Patient-level clinical attributes - `clinical_sample`: Sample-level clinical attributes - `clinical_data_derived`: Pre-joined view combining both levels - `clinical_attribute_meta`: Metadata about available clinical attributes ## Recommended Approach: Use clinical_data_derived The `clinical_data_derived` table is pre-joined and optimized for most queries: ```sql -- Get clinical data for specific attributes SELECT sample_unique_id, patient_unique_id, attribute_name, attribute_value FROM clinical_data_derived WHERE cancer_study_identifier = 'your_study_id' AND attribute_name IN ('CANCER_TYPE', 'SAMPLE_TYPE', 'TMB_NONSYNONYMOUS'); ``` ## Clinical Attribute Discovery ### Use clinical_attribute_meta for Discovering Available Attributes **Always start here** to see what clinical attributes are available for a specific study: ```sql -- Discover available clinical attributes for a study SELECT attr_id, description, patient_attribute, cancer_study_id FROM clinical_attribute_meta WHERE cancer_study_id = ( SELECT cancer_study_id FROM cancer_study WHERE cancer_study_identifier = 'your_study_id' ) ORDER BY patient_attribute, attr_id; ``` **Key Fields:** - **attr_id**: matches attr_id in clinical_sample/clinical_patient tables - **description**: human-readable description of the attribute - **patient_attribute**: true = patient attribute, false = sample attribute - **cancer_study_id**: links to cancer_study table (filter by study) ## Attribute Semantics and Matching ### Case-Insensitive Matching for Attribute Values Clinical values are free text across studies and may differ only by case. For example, a controlled-looking value such as germline mutation status may appear as `GERMLINE`, `Germline`, or another case variant. When filtering `clinical_data_derived.attribute_value`, use case-insensitive matching unless you have already profiled the exact values in the target study: ```sql -- Correct: case-insensitive clinical value filter SELECT DISTINCT sample_unique_id, patient_unique_id FROM clinical_data_derived WHERE cancer_study_identifier = 'your_study_id' AND attribute_name = 'MUTATION_STATUS' AND upper(attribute_value) = 'GERMLINE'; ``` Do not write `attribute_value = 'GERMLINE'` without first checking all distinct values for that attribute in the study. ### Query the Requested Attribute, Not a Proxy Do not infer one clinical attribute from a related subtype or marker. Query the actual requested attribute when it … (17073 more chars) ◀ result {"result":[{"code":"MEL","name":"Melanoma","score":80,"mainType":"Melanoma","tissue":"Skin","hierarchy":"SKIN > MEL"},{"code":"ACRM","name":"Acral Melanoma","score":65,"mainType":"Melanoma","tissue":"Skin","hierarchy":"SKIN > MEL > ACRM"},{"code":"ARMM","name":"Anorectal Mucosal Melanoma","score":65,"mainType":"Melanoma","tissue":"Bowel","hierarchy":"BOWEL > ARMM"},{"code":"CM","name":"Conjunctival Melanoma","score":65,"mainType":"Melanoma","tissue":"Eye","hierarchy":"EYE > OM > CM"},{"code":"DESM","name":"Desmoplastic Melanoma","score":65,"mainType":"Melanoma","tissue":"Skin","hierarchy":"SKIN > MEL > DESM"},{"code":"ESMM","name":"Mucosal Melanoma of the Esophagus","score":65,"mainType":"Melanoma","tissue":"Esophagus/Stomach","hierarchy":"STOMACH > ESMM"},{"code":"HNMUCM","name":"Head and Neck Mucosal Melanoma","score":65,"mainType":"Melanoma","tissue":"Head and Neck","hierarchy":"HEAD_NECK > HNMUCM"},{"code":"MUP","name":"Melanoma of Unknown Primary","score":65,"mainType":"Melanoma","tissue":"Skin","hierarchy":"SKIN > MEL > MUP"},{"code":"OM","name":"Ocular Melanoma","score":65,"mainType":"Melanoma","tissue":"Eye","hierarchy":"EYE > OM"},{"code":"PCNSM","name":"Primary CNS Melanoma","score":65,"mainType":"Melanoma","tissue":"CNS/Brain","hierarchy":"BRAIN > PCNSMT > PCNSM"},{"code":"SKCM","name":"Cutaneous Melanoma","score":65,"mainType":"Melanoma","tissue":"Skin","hierarchy":"SKIN > MEL > SKCM"},{"code":"SKCN","name":"Congenital Nevus","score":65,"mainType":"Melanoma","tissue":"Skin","hierarchy":"SKIN > MEL > SKCN"},{"code":"SKLMM","name":"Lentigo Maligna Melanoma","score":65,"mainType":"Melanoma","tissue":"Skin","hierarchy":"SKIN > MEL > SKLMM"},{"code":"SPZM","name":"Spitzoid Melanoma","score":65,"mainType":"Melanoma","tissue":"Skin","hierarchy":"SKIN > MEL > SPZM"},{"code":"UM","name":"Uveal Melanoma","score":65,"mainType":"Melanoma","tissue":"Eye","hierarchy":"EYE > OM > UM"},{"code":"URMM","name":"Mucosal Melanoma of the Urethra","score":65,"mainType":"Melanoma","tissue":"Bladder/Urinary Tract","hierarchy":"BLADDER > URMM","replacedCodes":["GMUCM"]},{"code":"VMM","name":"Mucosal Melanoma of the Vulva/Vagina","score":65,"mainType":"Melanoma","tissue":"Vulva/Vagina","hierarchy":"VULVA > VMM"},{"code":"ADPA","name":"Aggressive Digital Papillary Adenocarcinoma","score":45,"mainType":"Skin Cancer, Non-Melanoma","tissue":"Skin","hierarchy":"SKIN > ADPA"},{"code":"AECA","name":"Sweat Gland Carcinoma/Apocrine Eccrine Carcinoma","score":45,"mainType":"Skin Cancer, Non-Melanoma","tissue":"Skin","hierarchy":"SKIN > AECA"},{"code":"AFX","name":"Atypical Fibroxanthoma","score":45,"mainType":"Skin Cancer, Non-Melanoma","tissue":"Skin","hierarchy":"SKIN > AFX"},{"code":"AN","name":"Atypical Nevus","score":45,"mainType":"Skin Cancer, Non-Melanoma","tissue":"Skin","hierarchy":"SKIN > AN"},{"code":"BCC","name":"Basal Cell Carcinoma","score":45,"mainType":"Skin Cancer, Non-Melanoma","tissue":"Skin","hierarchy":"SKIN > BCC"},{"code":"CSCC","name":"Cutaneous S … (395 more chars) ═ answer (success) This question rests on two premises that don't hold for MSK-CHORD, so I want to correct them before going further rather than substituting other data silently: **1. MSK-CHORD does not include melanoma.** The study covers exactly five cancer types: non-small cell lung cancer, colorectal cancer, breast cancer, prostate cancer, and pancreatic cancer. There is no melanoma cohort in this dataset. **2. MSK-CHORD has no immunotherapy response variable.** Even for the cancer types it does contain, the study does not record RECIST response, objective response rate, or best-response classification. The only available proxies are overall survival (`OS_MONTHS`/`OS_STATUS`) and NLP-derived radiology progression events, in patients who received an immunotherapy agent (`SUBTYPE = 'Immuno'`, e.g., pembrolizumab, nivolumab). These are approximate outcome proxies, not curated response calls, and any comparison would need to go through cBioPortal's Group Comparison / Kaplan-Meier survival tools rather than a simple database lookup. Given both constraints, I can't answer "genomic alterations associated with immunotherapy response in melanoma" from this study — the cohort and the outcome variable both don't exist here. **Options if you'd like to proceed differently:** - If you're interested in immunotherapy-treated patients in one of MSK-CHORD's five actual cancer types (e.g., NSCLC), I can pull the mutation landscape for that immunotherapy subgroup and set up a survival/progression comparison by genotype. - If you specifically need melanoma, there are melanoma studies elsewhere in cBioPortal (e.g., MSK melanoma cohorts, TCGA SKCM) — some include treatment and outcome annotations of varying granularity. I'd need to check which one has the specific immunotherapy-response data you're looking for. Would you like me to check melanoma-specific studies in the portal instead, or focus this analysis on one of the five cancer types actually in MSK-CHORD?