Q (sonnet): is there a relationship between cic mutation and 19q del in lgg? ▶ list_guides {} ◀ 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"}]} ▶ read_guide { "uri": "cbioportal://statistical-tests-guide" } ▶ read_guide { "uri": "cbioportal://study-resolution-guide" } ▶ search_oncotree { "search_term": "LGG" } ◀ result Statistical Test Selection Guide ================================ Purpose ------- This guide ensures the correct statistical test is selected before performing any group comparison, matching cBioPortal's own Group Comparison defaults. HARD RULES — NEVER FABRICATE A STATISTIC ---------------------------------------- ClickHouse cannot run statistical tests. The agent therefore must NEVER produce a derived statistic that is not a literal column value from a SQL result. Specifically: 1. **Never invent a p-value.** Not "p < 0.001", not "p ≈ 0.05", not any p-value. If the user asks "what is the p-value?", the answer is *"I can't compute that — here is the 2x2 contingency table (or group statistics). Run it in cBioPortal's Group Comparison tab, in R with `fisher.test(...)` / `wilcox.test(...)`, or in Python with `scipy.stats.fisher_exact(...)` / `mannwhitneyu(...)`."* 2. **Never claim mutual exclusivity (or co-occurrence) from a contingency table alone.** A 2x2 table is not a test. The shape "altered/not altered × group A/group B" needs Fisher's exact + a defined direction (odds ratio < 1 with significant p). Without that test, the agent presents the table and stops. Descriptive phrasing is also a claim: "largely/mostly mutually exclusive", "rarely co-occur", "tend to co-occur" are forbidden without the test — point to cBioPortal's Mutual Exclusivity tab instead. 3. **Never report a "median" that came from `AVG(...)` or any non-median aggregate.** "Median" and "mean" are different statistics; for skewed clinical distributions (especially survival) they differ substantially. Use ClickHouse's `quantile(0.5)(...)` for actual median, and label arithmetic averages as "mean", never "median". 4. **Never report a hazard ratio, odds ratio, risk ratio, or relative risk** that wasn't computed by an external tool. These require regression / model fitting that ClickHouse does not do. 5. **Never report median overall survival from `AVG(OS_MONTHS)` or even `quantile(0.5)(OS_MONTHS)`.** Median OS requires Kaplan-Meier estimation, which handles censoring (`OS_STATUS = 0:LIVING` means the event hasn't happened yet). Naive medians/means over `OS_MONTHS` ignore censoring and are systematically wrong. The correct handoff: return the raw `(OS_MONTHS, OS_STATUS)` pairs (or descriptive counts: N events, N censored, follow-up range) and tell the user to run KM in R (`survival::survfit`) or Python (`lifelines.KaplanMeierFitter`), or use cBioPortal's Survival comparison. If asked to do any of (1)–(5), respond with the appropriate handoff template from the "Approved Response Templates" section below — do not produce the number. Ambiguous-Term Clarification (before any analysis) -------------------------------------------------- If the user's question uses an ambiguous term, ask before computing anything. Examples: - **"aggressive"** → could mean shorter overall survival, higher metastasis rate, higher grade/stage, higher TMB, or specific molecular features. Ask which definit … (9984 more chars) ◀ result # Study Resolution Guide Use this guide when the user names a study, cohort, portal, or data source that may not exist in the connected cBioPortal deployment. ## Routing Triggers Read this guide when the user mentions: - PBTA, Pediatric Brain Tumor Atlas, pediatric cBioPortal, Kids First - GENIE, AACR GENIE, MSK private cohorts, institutional cohorts - "download study", "which study", "find cohort", "data from [portal]" - a named cohort that `list_studies(search=...)` does not find ## Core Rules 1. Resolve the requested study before substituting another study. 2. If the requested study is not in this deployment, say so explicitly. 3. Do not silently analyze a substitute cohort. 4. If the user agrees to a substitute, keep a one-line scope caveat when reporting numbers. ## Known External cBioPortal Instances These are not necessarily queryable from this MCP server, but they are useful redirects: | User wording | Likely external instance | Scope | |---|---|---| | PBTA, Pediatric Brain Tumor Atlas, pediatric brain tumors | https://pedcbioportal.kidsfirstdrc.org/ | Pediatric cancer studies, including pediatric brain tumor cohorts | | GENIE | https://genie.cbioportal.org/ | AACR GENIE data access, depending on release and permissions | | MSK private / institutional cohorts | private institutional cBioPortal deployments | Not queryable from public cBioPortal unless exported to the public database | ## Study Resolution Workflow 1. Call `list_studies(search=...)` with the user's exact study/cohort phrase and close variants. 2. If a cancer type is mentioned, call `search_oncotree(search_term)` before disease-level study discovery. 3. If no matching study is found, check known external instances above before declaring the study absent. 4. If proposing a substitute, describe why it is a substitute and how its scope differs. ## Substitute-Cohort Answer Pattern > I cannot query PBTA from this cBioPortal deployment. PBTA is typically accessed through pediatric cBioPortal at https://pedcbioportal.kidsfirstdrc.org/. I can analyze `[substitute_study_id]` here, but its results should not be interpreted as PBTA results. When reporting numbers from a substitute: > Scope note: these counts are from `[substitute_study_id]` in this deployment, not from the requested PBTA cohort. ## Do Not - Do not answer a PBTA question with `brain_cptac_2020` numbers without a scope warning. - Do not let later turns drop the substitute-cohort warning. - Do not claim a study does not exist globally; say it is not available in the connected deployment. ◀ result {"result":[{"code":"LGGNOS","name":"Low-Grade Glioma, NOS","score":70,"mainType":"Glioma","tissue":"CNS/Brain","hierarchy":"BRAIN > ENCG > LGGNOS"},{"code":"DLGGMAPK","name":"Diffuse Low-Grade Glioma, MAPK Pathway-Altered","score":55,"mainType":"Gliomas, Glioneuronal Tumors, and Neuronal Tumors","tissue":"CNS/Brain","hierarchy":"BRAIN > DIFG > PDIFLG > DLGGMAPK"}]} ▶ list_studies { "search": "LGG" } ▶ clickhouse_list_table_columns { "table": "clinical_data_derived" } ◀ result {"result":[{"cancer_study_identifier":"lgggbm_tcga_pub","name":"Merged Cohort of LGG and GBM (TCGA, Cell 2016)","type_of_cancer_id":"difg","sample_count":1122,"has_guide":false,"url":"https://www.cbioportal.org/study/summary?id=lgggbm_tcga_pub"},{"cancer_study_identifier":"lgg_tcga","name":"Brain Lower Grade Glioma (TCGA, Firehose Legacy)","type_of_cancer_id":"difg","sample_count":530,"has_guide":false,"url":"https://www.cbioportal.org/study/summary?id=lgg_tcga"},{"cancer_study_identifier":"lgg_tcga_pan_can_atlas_2018","name":"Brain Lower Grade Glioma (TCGA, PanCancer Atlas)","type_of_cancer_id":"difg","sample_count":514,"has_guide":false,"url":"https://www.cbioportal.org/study/summary?id=lgg_tcga_pan_can_atlas_2018"},{"cancer_study_identifier":"lgg_ucsf_2014","name":"Low-Grade Gliomas (UCSF, Science 2014)","type_of_cancer_id":"difg","sample_count":61,"has_guide":false,"url":"https://www.cbioportal.org/study/summary?id=lgg_ucsf_2014"},{"cancer_study_identifier":"lgg_ctf_synodos_2025","name":"Pediatric Low-Grade Glioma (CTF, Acta Neuropathol 2021)","type_of_cancer_id":"difg","sample_count":31,"has_guide":false,"url":"https://www.cbioportal.org/study/summary?id=lgg_ctf_synodos_2025"}]} ◀ result {"error_message":"Query execution failed: HTTPDriver for https://dl96orhu96.us-east-1.aws.clickhouse.cloud:8443 received ClickHouse error code 241\n Code: 241. DB::Exception: (total) memory limit exceeded: would use 31.76 GiB (attempt to allocate chunk of 0.00 B), current RSS: 31.76 GiB, maximum: 28.80 GiB. (MEMORY_LIMIT_EXCEEDED)\n"} ▶ clickhouse_list_table_columns { "table": "clinical_data_derived" } ▶ clickhouse_list_table_columns { "table": "genomic_event_derived" } ◀ 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)."}]} ◀ result {"columns":[{"name":"sample_unique_id","type":"String"},{"name":"hugo_gene_symbol","type":"String","comment":"HUGO gene symbol (e.g., TP53, KRAS, BRAF). Use for gene-specific queries."},{"name":"entrez_gene_id","type":"Int32"},{"name":"gene_panel_stable_id","type":"LowCardinality(String)"},{"name":"cancer_study_identifier","type":"LowCardinality(String)"},{"name":"genetic_profile_stable_id","type":"LowCardinality(String)"},{"name":"variant_type","type":"LowCardinality(String)","comment":"Type of genomic event: \"mutation\" for SNVs/indels, \"cna\" for copy number alterations, \"structural_variant\" for SVs. Always filter by this."},{"name":"mutation_variant","type":"String","comment":"Protein change notation (e.g., p.V600E, p.R175H). Use for specific variant queries. \"NA\" for non-mutation events."},{"name":"mutation_type","type":"LowCardinality(String)"},{"name":"mutation_status","type":"LowCardinality(String)","comment":"For mutations: Somatic, Germline, UNKNOWN, or UNCALLED. Filter mutation_status != \"UNCALLED\" to exclude uncertain calls. Include all other statuses."},{"name":"driver_filter","type":"LowCardinality(String)"},{"name":"driver_filter_annotation","type":"String"},{"name":"driver_tiers_filter","type":"LowCardinality(String)"},{"name":"driver_tiers_filter_annotation","type":"String"},{"name":"cna_alteration","type":"Nullable(Int8)","comment":"Copy number alteration: only 2 = amplification (AMP) and -2 = deep deletion (HOMDEL) are stored. Shallow deletion (-1), diploid (0) and gain (1) are not in this table; query genetic_alteration_derived WHERE profile_type = 'gistic' (alteration_value is a String, e.g. '-1'). NULL for non-CNA events."},{"name":"cna_cytoband","type":"String"},{"name":"sv_event_info","type":"String"},{"name":"patient_unique_id","type":"String"},{"name":"off_panel","type":"Bool","comment":"Boolean: 1 = mutation outside gene panel coverage (off-panel), 0 = within panel (on-panel). Filter off_panel = 0 for reliable frequency calculations."}]} ▶ clickhouse_run_select_query { "query": "SELECT DISTINCT attribute_name FROM clinical_data_derived WHERE cancer_study_identifier = 'lgg_tcga_pan_can_atlas_2018' AND (attribute_name ILIKE '%19q%' OR attribute_name ILIKE '%1p%' OR attribute_name ILIKE '%codel%')" } ◀ result {"rows":[]} ▶ clickhouse_run_select_query { "query": "SELECT DISTINCT attribute_name FROM clinical_data_derived WHERE cancer_study_identifier = 'lgg_tcga' AND (attribute_name ILIKE '%19q%' OR attribute_name ILIKE '%1p%' OR attribute_name ILIKE '%codel%')" } ◀ result {"rows":[]} ▶ clickhouse_run_select_query { "query": "SELECT DISTINCT attribute_name FROM clinical_data_derived WHERE cancer_study_identifier = 'lgggbm_tcga_pub' AND (attribute_name ILIKE '%19q%' OR attribute_name ILIKE '%1p%' OR attribute_name ILIKE '%codel%')" } ◀ result {"rows":[{"attribute_name":"IDH_1P19Q_SUBTYPE"},{"attribute_name":"IDH_CODEL_SUBTYPE"}]} ▶ clickhouse_run_select_query { "query": "SELECT DISTINCT attribute_value FROM clinical_data_derived WHERE cancer_study_identifier = 'lgggbm_tcga_pub' AND attribute_name = 'IDH_CODEL_SUBTYPE'" } ◀ result {"rows":[{"attribute_value":"IDHwt"},{},{"attribute_value":"IDHmut-non-codel"},{"attribute_value":"IDHmut-codel"}]} ▶ clickhouse_run_select_query { "query": "SELECT DISTINCT attribute_value FROM clinical_data_derived WHERE cancer_study_identifier = 'lgggbm_tcga_pub' AND attribute_name = 'CANCER_TYPE_DETAILED'" } ◀ result {"rows":[{"attribute_value":"Diffuse Glioma"}]} ▶ clickhouse_run_select_query { "query": "SELECT DISTINCT attribute_name FROM clinical_data_derived WHERE cancer_study_identifier = 'lgggbm_tcga_pub' AND (attribute_name ILIKE '%cancer_type%' OR attribute_name ILIKE '%histolog%')" } ◀ result {"rows":[{"attribute_name":"HISTOLOGICAL_DIAGNOSIS"},{"attribute_name":"CANCER_TYPE"},{"attribute_name":"CANCER_TYPE_DETAILED"}]} ▶ clickhouse_run_select_query { "query": "SELECT DISTINCT attribute_value FROM clinical_data_derived WHERE cancer_study_identifier = 'lgggbm_tcga_pub' AND attribute_name = 'CANCER_TYPE'" } ▶ clickhouse_run_select_query { "query": "SELECT DISTINCT attribute_value FROM clinical_data_derived WHERE cancer_study_identifier = 'lgggbm_tcga_pub' AND attribute_name = 'HISTOLOGICAL_DIAGNOSIS'" } ▶ clickhouse_list_table_columns { "table": "clinical_event_derived" } ◀ result {"rows":[{"attribute_value":"Glioma"}]} ◀ result {"rows":[{"attribute_value":"astrocytoma"},{"attribute_value":"oligodendroglioma"},{"attribute_value":"oligoastrocytoma"},{},{"attribute_value":"glioblastoma"}]} ◀ 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)"}]} ▶ clickhouse_run_select_query { "query": " WITH lgg_samples AS ( SELECT DISTINCT sample_unique_id, patient_unique_id FROM clinical_data_derived WHERE cancer_study_identifier = 'lgggbm_tcga_pub' AND attribute_name = 'HISTOLOGICAL_DIAGNOSIS' AND attribute_value IN ('astrocytoma','oligodendroglioma','oligoastrocytoma') ), codel_status AS ( SELECT patient_unique_id, attribute_value AS codel_subtype FROM clinical_data_derived WHERE cancer_study_identifier = 'lgggbm_tcga_pub' AND attribute_name = 'IDH_CODEL_SUBTYPE' AND attribute_value != '' ), cic_mut AS ( SELECT DISTINCT sample_unique_id FROM genomic_event_derived WHERE cancer_study_identifier = 'lgggbm_tcga_pub' AND hugo_gene_symbol = 'CIC' AND variant_type = 'mutation' AND mutation_status != 'UNCALLED' AND off_panel = 0 ) SELECT codel_status.codel_subtype, countIf(cic_mut.sample_unique_id IS NOT NULL) AS cic_mutated, countIf(cic_mut.sample_unique_id IS NULL) AS cic_wildtype, count(*) AS total FROM lgg_samples JOIN codel_status ON lgg_samples.patient_unique_id = codel_status.patient_unique_id LEFT JOIN cic_mut ON lgg_samples.sample_unique_id = cic_mut.sample_unique_id GROUP BY codel_status.codel_subtype ORDER BY codel_status.codel_subtype " } ◀ result {"rows":[{"codel_subtype":"IDHmut-codel","cic_mutated":151,"cic_wildtype":0,"total":151},{"codel_subtype":"IDHmut-non-codel","cic_mutated":218,"cic_wildtype":0,"total":218},{"codel_subtype":"IDHwt","cic_mutated":86,"cic_wildtype":0,"total":86}]} ▶ clickhouse_run_select_query { "query": " WITH lgg_samples AS ( SELECT DISTINCT sample_unique_id, patient_unique_id FROM clinical_data_derived WHERE cancer_study_identifier = 'lgggbm_tcga_pub' AND attribute_name = 'HISTOLOGICAL_DIAGNOSIS' AND attribute_value IN ('astrocytoma','oligodendroglioma','oligoastrocytoma') ), codel_status AS ( SELECT patient_unique_id, attribute_value AS codel_subtype FROM clinical_data_derived WHERE cancer_study_identifier = 'lgggbm_tcga_pub' AND attribute_name = 'IDH_CODEL_SUBTYPE' AND attribute_value != '' ), cic_mut AS ( SELECT DISTINCT sample_unique_id FROM genomic_event_derived WHERE cancer_study_identifier = 'lgggbm_tcga_pub' AND hugo_gene_symbol = 'CIC' AND variant_type = 'mutation' AND mutation_status != 'UNCALLED' AND off_panel = 0 ) SELECT cs.codel_subtype, countIf(ls.sample_unique_id IN (SELECT sample_unique_id FROM cic_mut)) AS cic_mutated, count(*) - countIf(ls.sample_unique_id IN (SELECT sample_unique_id FROM cic_mut)) AS cic_wildtype, count(*) AS total FROM lgg_samples ls JOIN codel_status cs ON ls.patient_unique_id = cs.patient_unique_id GROUP BY cs.codel_subtype ORDER BY cs.codel_subtype " } ◀ result {"rows":[{"codel_subtype":"IDHmut-codel","cic_mutated":0,"cic_wildtype":151,"total":151},{"codel_subtype":"IDHmut-non-codel","cic_mutated":0,"cic_wildtype":218,"total":218},{"codel_subtype":"IDHwt","cic_mutated":0,"cic_wildtype":86,"total":86}]} ▶ clickhouse_run_select_query { "query": "SELECT sample_unique_id FROM genomic_event_derived WHERE cancer_study_identifier = 'lgggbm_tcga_pub' AND hugo_gene_symbol = 'CIC' AND variant_type = 'mutation' LIMIT 5" } ◀ result {"rows":[{"sample_unique_id":"lgggbm_tcga_pub_TCGA-06-A7TK-01"},{"sample_unique_id":"lgggbm_tcga_pub_TCGA-CS-6668-01"},{"sample_unique_id":"lgggbm_tcga_pub_TCGA-DB-5278-01"},{"sample_unique_id":"lgggbm_tcga_pub_TCGA-DB-A4XA-01"},{"sample_unique_id":"lgggbm_tcga_pub_TCGA-DB-A64L-01"}]} ▶ clickhouse_run_select_query { "query": "SELECT sample_unique_id FROM clinical_data_derived WHERE cancer_study_identifier = 'lgggbm_tcga_pub' AND attribute_name = 'HISTOLOGICAL_DIAGNOSIS' LIMIT 5" } ◀ result {"rows":[{},{},{},{},{}]} ▶ clickhouse_run_select_query { "query": "SELECT type, patient_unique_id, attribute_value FROM clinical_data_derived WHERE cancer_study_identifier = 'lgggbm_tcga_pub' AND attribute_name = 'HISTOLOGICAL_DIAGNOSIS' LIMIT 5" } ◀ result {"rows":[{"type":"patient","patient_unique_id":"lgggbm_tcga_pub_TCGA-CS-4938","attribute_value":"astrocytoma"},{"type":"patient","patient_unique_id":"lgggbm_tcga_pub_TCGA-CS-4941","attribute_value":"astrocytoma"},{"type":"patient","patient_unique_id":"lgggbm_tcga_pub_TCGA-CS-4942","attribute_value":"astrocytoma"},{"type":"patient","patient_unique_id":"lgggbm_tcga_pub_TCGA-CS-4943","attribute_value":"astrocytoma"},{"type":"patient","patient_unique_id":"lgggbm_tcga_pub_TCGA-CS-4944","attribute_value":"astrocytoma"}]} ▶ clickhouse_run_select_query { "query": "SELECT type, patient_unique_id, attribute_value FROM clinical_data_derived WHERE cancer_study_identifier = 'lgggbm_tcga_pub' AND attribute_name = 'IDH_CODEL_SUBTYPE' LIMIT 5" } ◀ result {"rows":[{"type":"sample","patient_unique_id":"lgggbm_tcga_pub_TCGA-02-0001","attribute_value":"IDHwt"},{"type":"sample","patient_unique_id":"lgggbm_tcga_pub_TCGA-02-0003","attribute_value":"IDHwt"},{"type":"sample","patient_unique_id":"lgggbm_tcga_pub_TCGA-02-0004"},{"type":"sample","patient_unique_id":"lgggbm_tcga_pub_TCGA-02-0006","attribute_value":"IDHwt"},{"type":"sample","patient_unique_id":"lgggbm_tcga_pub_TCGA-02-0007","attribute_value":"IDHwt"}]} ▶ clickhouse_run_select_query { "query": " WITH lgg_patients AS ( SELECT DISTINCT patient_unique_id FROM clinical_data_derived WHERE cancer_study_identifier = 'lgggbm_tcga_pub' AND attribute_name = 'HISTOLOGICAL_DIAGNOSIS' AND attribute_value IN ('astrocytoma','oligodendroglioma','oligoastrocytoma') ), codel_status AS ( SELECT patient_unique_id, attribute_value AS codel_subtype FROM clinical_data_derived WHERE cancer_study_identifier = 'lgggbm_tcga_pub' AND attribute_name = 'IDH_CODEL_SUBTYPE' AND attribute_value != '' ), lgg_samples AS ( SELECT DISTINCT sample_unique_id, patient_unique_id FROM clinical_data_derived WHERE cancer_study_identifier = 'lgggbm_tcga_pub' AND type = 'sample' AND sample_unique_id != '' AND patient_unique_id IN (SELECT patient_unique_id FROM lgg_patients) ), cic_mut AS ( SELECT DISTINCT sample_unique_id FROM genomic_event_derived WHERE cancer_study_identifier = 'lgggbm_tcga_pub' AND hugo_gene_symbol = 'CIC' AND variant_type = 'mutation' AND mutation_status != 'UNCALLED' AND off_panel = 0 ) SELECT cs.codel_subtype, countIf(ls.sample_unique_id IN (SELECT sample_unique_id FROM cic_mut)) AS cic_mutated, count(*) - countIf(ls.sample_unique_id IN (SELECT sample_unique_id FROM cic_mut)) AS cic_wildtype, count(*) AS total FROM lgg_samples ls JOIN codel_status cs ON ls.patient_unique_id = cs.patient_unique_id GROUP BY cs.codel_subtype ORDER BY cs.codel_subtype " } ◀ result {"rows":[{"codel_subtype":"IDHmut-codel","cic_mutated":71,"cic_wildtype":80,"total":151},{"codel_subtype":"IDHmut-non-codel","cic_mutated":0,"cic_wildtype":218,"total":218},{"codel_subtype":"IDHwt","cic_mutated":0,"cic_wildtype":86,"total":86}]} ▶ resolve_and_route { "studyIds": [ "lgggbm_tcga_pub" ] } ◀ result {"success":true,"message":"Found 1 study. Use the metadata to call the appropriate navigation tool(s).","data":{"totalCount":1,"studiesWithMetadata":[{"studyId":"lgggbm_tcga_pub","name":"Merged Cohort of LGG and GBM (TCGA, Cell 2016)","sampleCount":1122,"studyViewUrl":"https://www.cbioportal.org/study?id=lgggbm_tcga_pub","metadata":{"clinicalAttributeIds":["ABSOLUTE_EXTRACT_PLOIDY","AGE","ATRX_STATUS","BCR_STATUS","BRAF_KIAA1549_FUSION","BRAF_V600E_STATUS","CANCER_TYPE","CANCER_TYPE_DETAILED","CHR_19_20_CO_GAIN","CHR_7_GAIN_CHR_10_LOSS","DAXX_STATUS","ESTIMATE_COMBINED_SCORE","ESTIMATE_IMMUNE_SCORE","ESTIMATE_STROMAL_SCORE","GRADE","HISTOLOGICAL_DIAGNOSIS","HM27","HM450","IDH_1P19Q_SUBTYPE","IDH_CODEL_SUBTYPE","IDH_SPECIFIC_DNA_METHYLATION_CLUSTER","IDH_SPECIFIC_RNA_EXPRESSION_CLUSTER","IDH_STATUS","KARNOFSKY_PERFORMANCE_SCORE","MGMT_PROMOTER_STATUS","MUTATION_COUNT","ONCOTREE_CODE","ORIGINAL_SUBTYPE","OS_MONTHS","OS_STATUS","PAN_GLIOMA_DNA_METHYLATION_CLUSTER","PAN_GLIOMA_RNA_EXPRESSION_CLUSTER","PERCENT_ANEUPLOIDY","PURITY_ABSOLUTE","RANDOM_FOREST_STURM_CLUSTER","RNASEQ_DATA","RPPA","RPPA_CLUSTER","SAMPLE_COUNT","SEX","SNP6","SOMATIC_STATUS","STUDY","SUPERVISED_DNA_METHYLATION_CLUSTER","TELOMERE_LENGTH_ESTIMATE_IN_BLOOD_NORMAL_KB","TELOMERE_LENGTH_ESTIMATE_IN_TUMOR_KB","TELOMERE_MAINTENANCE","TERT_EXPRESSION_LOG2","TERT_EXPRESSION_STATUS","TERT_PROMOTER_STATUS","TISSUE_SOURCE_SITE","TMB_NONSYNONYMOUS","TRANSCRIPTOME_SUBTYPE","U133A","WHOLE_EXOME_SEQUENCING","WHOLE_GENOME_SEQUENCING"],"molecularProfileIds":["lgggbm_tcga_pub_gistic","lgggbm_tcga_pub_log2CNA","lgggbm_tcga_pub_mutations"],"availableComparisonTabs":["overlap","clinical","survival","alterations","mutations"]}}]}} ▶ get_studyviewfilter_options { "studyId": "lgggbm_tcga_pub", "attributeIds": [ "IDH_CODEL_SUBTYPE", "HISTOLOGICAL_DIAGNOSIS" ] } ◀ result {"success":true,"message":"Successfully retrieved StudyView filter options","data":{"studyId":"lgggbm_tcga_pub","attributes":[{"attributeId":"HISTOLOGICAL_DIAGNOSIS","displayName":"Neoplasm Histologic Type Name","description":"Text term for the structural pattern of cancer cells used to define a microscopic diagnosis.","datatype":"STRING","values":["glioblastoma","oligodendroglioma","NA","astrocytoma","oligoastrocytoma"]},{"attributeId":"IDH_CODEL_SUBTYPE","displayName":"IDH/codel subtype","description":"IDH/codel subtype","datatype":"STRING","values":["IDHmut-codel","NA","IDHwt","IDHmut-non-codel"]}]}} ▶ navigate_to_group_comparison { "studyIds": [ "lgggbm_tcga_pub" ], "tab": "mutations", "selectedGene": "CIC", "studyViewFilter": { "clinicalDataFilters": [ { "attributeId": "HISTOLOGICAL_DIAGNOSIS", "values": [ { "value": "astrocytoma" }, { "value": "oligodendroglioma" }, { "value": "oligoastrocytoma" } ] } ] }, "groups": [ { "name": "IDHmut-codel (1p/19q-codeleted)", "studyViewFilter": { "clinicalDataFilters": [ { "attributeId": "IDH_CODEL_SUBTYPE", "values": [ { "value": "IDHmut-codel" } ] } ] } }, { "name": "IDHmut-non-codel", "studyViewFilter": { "clinicalDataFilters": [ { "attributeId": "IDH_CODEL_SUBTYPE", "values": [ { "value": "IDHmut-non-codel" } ] } ] } }, { "name": "IDHwt", "studyViewFilter": { "clinicalDataFilters": [ { "attributeId": "IDH_CODEL_SUBTYPE", "values": [ { "value": "IDHwt" } ] } ] } } ] } ◀ result {"success":true,"message":"Navigating to https://www.cbioportal.org/comparison/mutations?comparisonId=6ab5c978e497aad53593c26e&selectedGene=CIC","url":"https://www.cbioportal.org/comparison/mutations?comparisonId=6ab5c978e497aad53593c26e&selectedGene=CIC","data":{"description":"Group comparison (3 custom groups)","studies":["lgggbm_tcga_pub"],"totalGroups":3,"groups":[{"name":"IDHmut-codel (1p/19q-codeleted)","sampleCount":151},{"name":"IDHmut-non-codel","sampleCount":218},{"name":"IDHwt","sampleCount":86}],"studyViewUrl":"https://www.cbioportal.org/study?id=lgggbm_tcga_pub#filterJson=%7B%22clinicalDataFilters%22%3A%5B%7B%22attributeId%22%3A%22HISTOLOGICAL_DIAGNOSIS%22%2C%22values%22%3A%5B%7B%22value%22%3A%22astrocytoma%22%7D%2C%7B%22value%22%3A%22oligodendroglioma%22%7D%2C%7B%22value%22%3A%22oligoastrocytoma%22%7D%5D%7D%5D%7D","groupUrls":[{"groupName":"IDHmut-codel (1p/19q-codeleted)","url":"https://www.cbioportal.org/study?id=lgggbm_tcga_pub#filterJson=%7B%22studyIds%22%3A%5B%22lgggbm_tcga_pub%22%5D%2C%22clinicalDataFilters%22%3A%5B%7B%22attributeId%22%3A%22HISTOLOGICAL_DIAGNOSIS%22%2C%22values%22%3A%5B%7B%22value%22%3A%22astrocytoma%22%7D%2C%7B%22value%22%3A%22oligodendroglioma%22%7D%2C%7B%22value%22%3A%22oligoastrocytoma%22%7D%5D%7D%2C%7B%22attributeId%22%3A%22IDH_CODEL_SUBTYPE%22%2C%22values%22%3A%5B%7B%22value%22%3A%22IDHmut-codel%22%7D%5D%7D%5D%7D"},{"groupName":"IDHmut-non-codel","url":"https://www.cbioportal.org/study?id=lgggbm_tcga_pub#filterJson=%7B%22studyIds%22%3A%5B%22lgggbm_tcga_pub%22%5D%2C%22clinicalDataFilters%22%3A%5B%7B%22attributeId%22%3A%22HISTOLOGICAL_DIAGNOSIS%22%2C%22values%22%3A%5B%7B%22value%22%3A%22astrocytoma%22%7D%2C%7B%22value%22%3A%22oligodendroglioma%22%7D%2C%7B%22value%22%3A%22oligoastrocytoma%22%7D%5D%7D%2C%7B%22attributeId%22%3A%22IDH_CODEL_SUBTYPE%22%2C%22values%22%3A%5B%7B%22value%22%3A%22IDHmut-non-codel%22%7D%5D%7D%5D%7D"},{"groupName":"IDHwt","url":"https://www.cbioportal.org/study?id=lgggbm_tcga_pub#filterJson=%7B%22studyIds%22%3A%5B%22lgggbm_tcga_pub%22%5D%2C%22clinicalDataFilters%22%3A%5B%7B%22attributeId%22%3A%22HISTOLOGICAL_DIAGNOSIS%22%2C%22values%22%3A%5B%7B%22value%22%3A%22astrocytoma%22%7D%2C%7B%22value%22%3A%22oligodendroglioma%22%7D%2C%7B%22value%22%3A%22oligoastrocytoma%22%7D%5D%7D%2C%7B%22attributeId%22%3A%22IDH_CODEL_SUBTYPE%22%2C%22values%22%3A%5B%7B%22value%22%3A%22IDHwt%22%7D%5D%7D%5D%7D"}],"pageDescription":"Mutation frequency (protein change) compared across IDHmut-codel (1p/19q-codeleted) (151) vs IDHmut-non-codel (218) vs IDHwt (86)."}} ═ answer (success) ### [View CIC mutation frequency across 1p/19q-codeletion groups](https://www.cbioportal.org/comparison/mutations?comparisonId=6ab5c978e497aad53593c26e&selectedGene=CIC) Group Comparison — Mutations tab, `lgggbm_tcga_pub` (TCGA, Cell 2016), restricted to LGG histologies (astrocytoma/oligodendroglioma/oligoastrocytoma): - IDHmut-codel (1p/19q-codeleted): 151 samples - IDHmut-non-codel: 218 samples - IDHwt: 86 samples *Mutation frequency (protein change) compared across IDHmut-codel (1p/19q-codeleted) (151) vs IDHmut-non-codel (218) vs IDHwt (86).* This view shows CIC mutation frequency by group directly and includes an on-page Fisher's/chi-squared test I cannot replicate in SQL. --- **Summary of what the query showed:** Among 455 LGG samples with both CIC mutation and 1p/19q-codeletion status annotated, CIC mutations were found exclusively in the IDHmut-codel (1p/19q-codeleted) group — 71/151 (47.0%) — versus 0/218 in IDHmut-non-codel and 0/86 in IDHwt. This is a striking, near-complete separation, but confirming statistical association (Fisher's exact, odds ratio) should be done via the link above or `fisher.test(matrix(c(71,80,0,304), nrow=2))` in R.