Q (sonnet): show me gbm with mgmt hypermethylation ▶ list_studies { "search": "glioblastoma" } ▶ read_guide { "uri": "cbioportal://clinical-data-guide" } ◀ result {"result":[{"cancer_study_identifier":"gbm_tcga","name":"Glioblastoma Multiforme (TCGA, Firehose Legacy)","type_of_cancer_id":"difg","sample_count":619,"has_guide":false,"url":"https://www.cbioportal.org/study/summary?id=gbm_tcga"},{"cancer_study_identifier":"gbm_tcga_gdc","name":"Glioblastoma Multiforme (TCGA GDC, 2025)","type_of_cancer_id":"difg","sample_count":611,"has_guide":false,"url":"https://www.cbioportal.org/study/summary?id=gbm_tcga_gdc"},{"cancer_study_identifier":"gbm_tcga_pan_can_atlas_2018","name":"Glioblastoma Multiforme (TCGA, PanCancer Atlas)","type_of_cancer_id":"difg","sample_count":592,"has_guide":true,"url":"https://www.cbioportal.org/study/summary?id=gbm_tcga_pan_can_atlas_2018"},{"cancer_study_identifier":"gbm_tcga_pub2013","name":"Glioblastoma (TCGA, Cell 2013)","type_of_cancer_id":"difg","sample_count":577,"has_guide":false,"url":"https://www.cbioportal.org/study/summary?id=gbm_tcga_pub2013"},{"cancer_study_identifier":"gbm_tcga_pub","name":"Glioblastoma (TCGA, Nature 2008)","type_of_cancer_id":"difg","sample_count":206,"has_guide":false,"url":"https://www.cbioportal.org/study/summary?id=gbm_tcga_pub"},{"cancer_study_identifier":"gbm_cptac_2021","name":"Glioblastoma (CPTAC, Cell 2021)","type_of_cancer_id":"difg","sample_count":99,"has_guide":false,"url":"https://www.cbioportal.org/study/summary?id=gbm_cptac_2021"},{"cancer_study_identifier":"gbm_columbia_2019","name":"Glioblastoma (Columbia, Nat Med. 2019)","type_of_cancer_id":"difg","sample_count":42,"has_guide":false,"url":"https://www.cbioportal.org/study/summary?id=gbm_columbia_2019"},{"cancer_study_identifier":"gbm_iatlas_prins_2019","name":"Glioblastoma (Randomized Clinical Trial, Nat Med. 2019) - iAtlas Harmonized","type_of_cancer_id":"adifg","sample_count":30,"has_guide":false,"url":"https://www.cbioportal.org/study/summary?id=gbm_iatlas_prins_2019"}]} ◀ 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) ▶ get_study_guide { "study_id": "gbm_tcga_pan_can_atlas_2018" } ◀ result # Glioblastoma Multiforme (TCGA, PanCancer Atlas) **Study ID:** `gbm_tcga_pan_can_atlas_2018` See `_tcga_pancan_template.md` for common TCGA clinical attributes. ## Study-Specific Attributes ### Molecular Classification | Attribute | Description | Values (patients) | |-----------|-------------|--------| | `SUBTYPE` | TCGA glioma IDH classification | `GBM_IDHwt` 114, `GBM_IDHmut-non-codel` 7, `GBM` 5, blank 459 | `SUBTYPE` is blank for most patients and does not hold the transcriptional subtypes (Classical/Mesenchymal/Proneural/Neural). ### Not available in this study - **IDH status**: no `IDH_STATUS` attribute. Use IDH1/IDH2 mutations from mutation data (covers all sequenced samples), or `SUBTYPE` for the 121 classified patients. - **MGMT promoter methylation status**: not available (the methylation profiles are CpG-probe level, with no MGMT status call). - **Karnofsky performance status and extent of resection**: not available. ## Key Genes & Pathways - **TP53**: Frequently mutated - **PTEN**: Common deletions - **EGFR**: Amplified in ~40%, often with EGFRvIII variant - **IDH1**: R132H mutation defines IDH-mutant subtype (better prognosis) - **RB pathway**: CDKN2A deletion, CDK4 amplification, RB1 mutation (often mutually exclusive) ## Notes - IDH-mutant GBMs have significantly better prognosis - MGMT methylation predicts temozolomide response - EGFR amplification and EGFRvIII are GBM-specific - Molecular subtypes have distinct transcriptional programs ▶ clickhouse_run_select_query { "query": "SELECT DISTINCT attribute_name FROM clinical_data_derived WHERE cancer_study_identifier = 'gbm_tcga_pan_can_atlas_2018' AND (upper(attribute_name) LIKE '%MGMT%' OR upper(attribute_name) LIKE '%METHYL%')" } ◀ result {"rows":[]} ▶ clickhouse_run_select_query { "query": "SELECT cancer_study_identifier, attribute_name, count(DISTINCT patient_unique_id) AS n_patients FROM clinical_data_derived WHERE cancer_study_identifier IN ('gbm_tcga','gbm_tcga_gdc','gbm_tcga_pub2013','gbm_tcga_pub','gbm_cptac_2021','gbm_columbia_2019','gbm_iatlas_prins_2019') AND (upper(attribute_name) LIKE '%MGMT%' OR upper(attribute_name) LIKE '%METHYL%') GROUP BY cancer_study_identifier, attribute_name ORDER BY cancer_study_identifier" } ◀ result {"rows":[{"cancer_study_identifier":"gbm_tcga_pub2013","attribute_name":"METHYLATION_STATUS","n_patients":577},{"cancer_study_identifier":"gbm_tcga_pub2013","attribute_name":"MGMT_STATUS","n_patients":577},{"cancer_study_identifier":"gbm_tcga_pub2013","attribute_name":"G_CIMP_METHYLATION","n_patients":577}]} ▶ clickhouse_run_select_query { "query": "SELECT attribute_value, count(DISTINCT patient_unique_id) AS n_patients FROM clinical_data_derived WHERE cancer_study_identifier = 'gbm_tcga_pub2013' AND attribute_name = 'MGMT_STATUS' GROUP BY attribute_value ORDER BY n_patients DESC" } ◀ result {"rows":[{"n_patients":227},{"attribute_value":"UNMETHYLATED","n_patients":180},{"attribute_value":"METHYLATED","n_patients":170}]} ▶ resolve_and_route { "studyIds": [ "gbm_tcga_pub2013" ] } ◀ result {"success":true,"message":"Found 1 study. Use the metadata to call the appropriate navigation tool(s).","data":{"totalCount":1,"studiesWithMetadata":[{"studyId":"gbm_tcga_pub2013","name":"Glioblastoma (TCGA, Cell 2013)","sampleCount":577,"studyViewUrl":"https://www.cbioportal.org/study?id=gbm_tcga_pub2013","metadata":{"clinicalAttributeIds":["AGE","CANCER_TYPE","CANCER_TYPE_DETAILED","DFS_MONTHS","DFS_STATUS","EXPRESSION_SUBTYPE","FRACTION_GENOME_ALTERED","G_CIMP_METHYLATION","IDH1_MUTATION","METHYLATION_STATUS","MGMT_STATUS","MUTATION_COUNT","ONCOTREE_CODE","OS_MONTHS","OS_STATUS","SAMPLE_COUNT","SAMPLE_TYPE","SEX","SOMATIC_STATUS","THERAPY","TMB_NONSYNONYMOUS"],"molecularProfileIds":["gbm_tcga_pub2013_gistic","gbm_tcga_pub2013_linear_CNA","gbm_tcga_pub2013_mutations","gbm_tcga_pub2013_protein_quantification","gbm_tcga_pub2013_protein_quantification_zscores","gbm_tcga_pub2013_rna_seq_v2_mrna","gbm_tcga_pub2013_rna_seq_v2_mrna_median_Zscores","gbm_tcga_pub2013_rna_seq_v2_mrna_median_all_sample_Zscores"],"heatmapProfileIds":["gbm_tcga_pub2013_protein_quantification_zscores","gbm_tcga_pub2013_rna_seq_v2_mrna_median_Zscores","gbm_tcga_pub2013_rna_seq_v2_mrna_median_all_sample_Zscores"],"availableComparisonTabs":["overlap","clinical","survival","alterations","mutations","mrna","protein"]}}]}} ▶ get_studyviewfilter_options { "studyId": "gbm_tcga_pub2013", "attributeIds": [ "MGMT_STATUS" ] } ◀ result {"success":true,"message":"Successfully retrieved StudyView filter options","data":{"studyId":"gbm_tcga_pub2013","attributes":[{"attributeId":"MGMT_STATUS","displayName":"MGMT Status","description":"MGMT Status","datatype":"STRING","values":["NA","METHYLATED","UNMETHYLATED"]}]}} ▶ navigate_to_study_view { "studyIds": [ "gbm_tcga_pub2013" ], "filterJson": { "clinicalDataFilters": [ { "attributeId": "MGMT_STATUS", "values": [ { "value": "METHYLATED" } ] } ] } } ◀ result {"success":true,"message":"Navigating to https://www.cbioportal.org/study/summary?id=gbm_tcga_pub2013#filterJson=%7B%22clinicalDataFilters%22%3A%5B%7B%22attributeId%22%3A%22MGMT_STATUS%22%2C%22values%22%3A%5B%7B%22value%22%3A%22METHYLATED%22%7D%5D%7D%5D%7D","url":"https://www.cbioportal.org/study/summary?id=gbm_tcga_pub2013#filterJson=%7B%22clinicalDataFilters%22%3A%5B%7B%22attributeId%22%3A%22MGMT_STATUS%22%2C%22values%22%3A%5B%7B%22value%22%3A%22METHYLATED%22%7D%5D%7D%5D%7D","data":{"studyIds":["gbm_tcga_pub2013"],"studies":[{"studyId":"gbm_tcga_pub2013","name":"Glioblastoma (TCGA, Cell 2013)","sampleCount":577}],"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) [View MGMT-Hypermethylated GBM Patients — Glioblastoma (TCGA, Cell 2013)](https://www.cbioportal.org/study/summary?id=gbm_tcga_pub2013#filterJson=%7B%22clinicalDataFilters%22%3A%5B%7B%22attributeId%22%3A%22MGMT_STATUS%22%2C%22values%22%3A%5B%7B%22value%22%3A%22METHYLATED%22%7D%5D%7D%5D%7D) This opens the cohort overview pre-filtered to the 170 patients with MGMT promoter **methylated** (hypermethylated) status, out of 577 total patients in the study. Overview of all study data displayed as interactive charts summarizing available clinical and genomic data — click within a chart to filter further, or use the Charts menu for additional attributes. **Note:** the newer TCGA PanCancer Atlas GBM study does not include MGMT status, so this 2013 Cell paper cohort (`gbm_tcga_pub2013`) is the correct source for this specific query.