Q (sonnet): show me cholangio with idh1 mutations other than r132 ▶ read_guide { "uri": "cbioportal://mutation-frequency-guide" } ◀ result # Mutation Frequency Analysis Guide ## IMPORTANT: Reporting Mutation Frequencies - **ALWAYS report frequencies as percentages**, not raw counts: `frequency = (altered_samples / total_profiled_samples) × 100` - For quick frequency lookups, **prefer the TCGA Pan-Cancer Atlas study first**, then offer to expand to other studies - When reporting across multiple studies, show **ranges** (e.g., "TP53 is mutated in 30–60% of samples") rather than a single average - **NEVER** sum mutation events across studies to compute an aggregate frequency — this can exceed 100% due to double-counting - Warn users that samples may overlap across cohorts (e.g., MSK studies may share patients) - **Choose and state the counting unit**: use patient-level frequencies for prevalence/rate questions unless the user explicitly asks for samples; use sample-level frequencies when the user asks about samples. - **For "across cancer types" questions**, jump to the [Cross-Cancer-Type Mutation Frequency](#cross-cancer-type-mutation-frequency) section below — there is one correct recipe and several common wrong ones. ## Counting Unit: Samples vs Patients Before answering any mutation count or frequency question, decide whether the unit is samples or patients and state that choice in the answer. | User wording | Counting unit | |--------------|---------------| | "prevalence", "rate", "fraction of patients", "patients with", "how common is" | Patient-level: `COUNT(DISTINCT patient_unique_id)` | | "samples", "specimens", "biopsies", sample-level cohort composition | Sample-level: `COUNT(DISTINCT sample_unique_id)` | | Ambiguous | Ask, or default to patient-level for prevalence/rate language and say so | ### Cross-study sample-count caveat When an answer touches more than one study and reports a sample count, prepend a one-line caveat: > Sample IDs are unique within cBioPortal study prefixes, not guaranteed biological-sample identifiers across studies; overlapping cohorts can count the same patient/sample more than once. Prefer one of these safer approaches: - Use a shipped `cancer_study_query_preferences` cohort such as `pan_cancer_tcga` or `all_studies_non_redundant`. - Restrict to one named study. - Aggregate by `patient_unique_id` when the biological question is patient prevalence. ## STOP rule: a frequency above 100% means your query is wrong If your query returns a frequency over 100%, **do not try to debug or explain the data inconsistency to the user**. The cause is always one of these query bugs: - Summing mutation events instead of `COUNT(DISTINCT sample_unique_id)` for the numerator - Using a study-wide sample count as the denominator instead of the gene-specific profiled count - Cross-study aggregation where the same biological sample appears under multiple `sample_unique_id` values (e.g., MSK-IMPACT and MSK-CHORD share patients) - **Joining the profiled CTE through `gene_panel` / `gene_panel_list` without a WES branch.** `gene_panel_id = 'WES'` is *not* a row in … (35166 more chars) ▶ list_studies { "search": "cholangiocarcinoma" } ▶ search_oncotree { "search_term": "cholangiocarcinoma" } ◀ result {"result":[{"cancer_study_identifier":"chol_icgc_2017","name":"Cholangiocarcinoma (ICGC, Cancer Discov 2017)","type_of_cancer_id":"chol","sample_count":489,"has_guide":false,"url":"https://www.cbioportal.org/study/summary?id=chol_icgc_2017"},{"cancer_study_identifier":"ihch_msk_2021","name":"Intrahepatic Cholangiocarcinoma (MSK, Hepatology 2021)","type_of_cancer_id":"ihch","sample_count":412,"has_guide":false,"url":"https://www.cbioportal.org/study/summary?id=ihch_msk_2021"},{"cancer_study_identifier":"ihch_mskcc_2020","name":"Intrahepatic Cholangiocarcinoma (MSK, Clin Cancer Res 2021)","type_of_cancer_id":"ihch","sample_count":219,"has_guide":false,"url":"https://www.cbioportal.org/study/summary?id=ihch_mskcc_2020"},{"cancer_study_identifier":"chol_msk_2018","name":"Cholangiocarcinoma (MSK, Clin Cancer Res 2018)","type_of_cancer_id":"chol","sample_count":195,"has_guide":false,"url":"https://www.cbioportal.org/study/summary?id=chol_msk_2018"},{"cancer_study_identifier":"hccihch_pku_2019","name":"Combined Hepatocellular and Intrahepatic Cholangiocarcinoma (Peking University, Cancer Cell 2019)","type_of_cancer_id":"hccihch","sample_count":173,"has_guide":false,"url":"https://www.cbioportal.org/study/summary?id=hccihch_pku_2019"},{"cancer_study_identifier":"ihch_smmu_2014","name":"Intrahepatic Cholangiocarcinoma (Shanghai, Nat Commun 2014)","type_of_cancer_id":"ihch","sample_count":103,"has_guide":false,"url":"https://www.cbioportal.org/study/summary?id=ihch_smmu_2014"},{"cancer_study_identifier":"chol_tcga_gdc","name":"Cholangiocarcinoma (TCGA GDC, 2025)","type_of_cancer_id":"chol","sample_count":51,"has_guide":false,"url":"https://www.cbioportal.org/study/summary?id=chol_tcga_gdc"},{"cancer_study_identifier":"chol_tcga","name":"Cholangiocarcinoma (TCGA, Firehose Legacy)","type_of_cancer_id":"chol","sample_count":51,"has_guide":false,"url":"https://www.cbioportal.org/study/summary?id=chol_tcga"},{"cancer_study_identifier":"chol_jhu_2013","name":"Intrahepatic Cholangiocarcinoma (JHU, Nat Genet 2013)","type_of_cancer_id":"chol","sample_count":40,"has_guide":false,"url":"https://www.cbioportal.org/study/summary?id=chol_jhu_2013"},{"cancer_study_identifier":"chol_tcga_pan_can_atlas_2018","name":"Cholangiocarcinoma (TCGA, PanCancer Atlas)","type_of_cancer_id":"chol","sample_count":36,"has_guide":false,"url":"https://www.cbioportal.org/study/summary?id=chol_tcga_pan_can_atlas_2018"},{"cancer_study_identifier":"chol_nccs_2013","name":"Cholangiocarcinoma (National Cancer Centre of Singapore, Nat Genet 2013)","type_of_cancer_id":"chol","sample_count":15,"has_guide":false,"url":"https://www.cbioportal.org/study/summary?id=chol_nccs_2013"},{"cancer_study_identifier":"ihch_ismms_2015","name":"Intrahepatic Cholangiocarcinoma (Mount Sinai 2015)","type_of_cancer_id":"ihch","sample_count":8,"has_guide":false,"url":"https://www.cbioportal.org/study/summary?id=ihch_ismms_2015"},{"cancer_study_identifier":"chol_nus_2012","name":"Cholangiocarcinoma (National Universit … (163 more chars) ◀ result {"result":[{"code":"CHOL","name":"Cholangiocarcinoma","score":80,"mainType":"Hepatobiliary Cancer","tissue":"Biliary Tract","hierarchy":"BILIARY_TRACT > IPN > CHOL"},{"code":"EHCH","name":"Extrahepatic Cholangiocarcinoma","score":50,"mainType":"Hepatobiliary Cancer","tissue":"Biliary Tract","hierarchy":"BILIARY_TRACT > IPN > CHOL > EHCH"},{"code":"HCCIHCH","name":"Hepatocellular Carcinoma plus Intrahepatic Cholangiocarcinoma","score":50,"mainType":"Hepatobiliary Cancer","tissue":"Liver","hierarchy":"LIVER > HCCIHCH"},{"code":"IHCH","name":"Intrahepatic Cholangiocarcinoma","score":50,"mainType":"Hepatobiliary Cancer","tissue":"Biliary Tract","hierarchy":"BILIARY_TRACT > IPN > CHOL > IHCH"},{"code":"PHCH","name":"Perihilar Cholangiocarcinoma","score":50,"mainType":"Hepatobiliary Cancer","tissue":"Biliary Tract","hierarchy":"BILIARY_TRACT > IPN > CHOL > PHCH"}]} ▶ clickhouse_run_select_query { "query": "SELECT 'chol_icgc_2017' AS study, * FROM gene_mutation_variants_in_study(study = 'chol_icgc_2017', gene = 'IDH1') UNION ALL SELECT 'chol_msk_2018' AS study, * FROM gene_mutation_variants_in_study(study = 'chol_msk_2018', gene = 'IDH1') UNION ALL SELECT 'ihch_msk_2021' AS study, * FROM gene_mutation_variants_in_study(study = 'ihch_msk_2021', gene = 'IDH1') UNION ALL SELECT 'ihch_mskcc_2020' AS study, * FROM gene_mutation_variants_in_study(study = 'ihch_mskcc_2020', gene = 'IDH1') UNION ALL SELECT 'chol_tcga_pan_can_atlas_2018' AS study, * FROM gene_mutation_variants_in_study(study = 'chol_tcga_pan_can_atlas_2018', gene = 'IDH1') ORDER BY study, altered_samples DESC" } ◀ result {"rows":[{"study":"ihch_msk_2021","mutation_variant":"R132C","mutation_type":"Missense_Mutation","altered_samples":62,"profiled_samples":412,"frequency_pct":15,"total_mutation_events":62},{"study":"ihch_msk_2021","mutation_variant":"R132L","mutation_type":"Missense_Mutation","altered_samples":15,"profiled_samples":412,"frequency_pct":3.6,"total_mutation_events":15},{"study":"ihch_msk_2021","mutation_variant":"R132G","mutation_type":"Missense_Mutation","altered_samples":5,"profiled_samples":412,"frequency_pct":1.2,"total_mutation_events":5},{"study":"ihch_msk_2021","mutation_variant":"R132S","mutation_type":"Missense_Mutation","altered_samples":2,"profiled_samples":412,"frequency_pct":0.5,"total_mutation_events":2},{"study":"ihch_msk_2021","mutation_variant":"N349S","mutation_type":"Missense_Mutation","altered_samples":1,"profiled_samples":412,"frequency_pct":0.2,"total_mutation_events":1},{"study":"chol_icgc_2017","mutation_variant":"R132C","mutation_type":"Missense_Mutation","altered_samples":9,"profiled_samples":417,"frequency_pct":2.2,"total_mutation_events":9},{"study":"chol_icgc_2017","mutation_variant":"R132G","mutation_type":"Missense_Mutation","altered_samples":4,"profiled_samples":417,"frequency_pct":1,"total_mutation_events":4},{"study":"chol_icgc_2017","mutation_variant":"R132L","mutation_type":"Missense_Mutation","altered_samples":3,"profiled_samples":417,"frequency_pct":0.7,"total_mutation_events":3},{"study":"chol_icgc_2017","mutation_variant":"R132S","mutation_type":"Missense_Mutation","altered_samples":2,"profiled_samples":417,"frequency_pct":0.5,"total_mutation_events":2},{"study":"chol_tcga_pan_can_atlas_2018","mutation_variant":"R132C","mutation_type":"Missense_Mutation","altered_samples":4,"profiled_samples":36,"frequency_pct":11.1,"total_mutation_events":4},{"study":"chol_tcga_pan_can_atlas_2018","mutation_variant":"R132S","mutation_type":"Missense_Mutation","altered_samples":1,"profiled_samples":36,"frequency_pct":2.8,"total_mutation_events":1},{"study":"chol_msk_2018","mutation_variant":"R132C","mutation_type":"Missense_Mutation","altered_samples":41,"profiled_samples":195,"frequency_pct":21,"total_mutation_events":41},{"study":"chol_msk_2018","mutation_variant":"R132L","mutation_type":"Missense_Mutation","altered_samples":5,"profiled_samples":195,"frequency_pct":2.6,"total_mutation_events":5},{"study":"chol_msk_2018","mutation_variant":"R132G","mutation_type":"Missense_Mutation","altered_samples":2,"profiled_samples":195,"frequency_pct":1,"total_mutation_events":2},{"study":"ihch_mskcc_2020","mutation_variant":"R132C","mutation_type":"Missense_Mutation","altered_samples":35,"profiled_samples":199,"frequency_pct":17.6,"total_mutation_events":35},{"study":"ihch_mskcc_2020","mutation_variant":"R132L","mutation_type":"Missense_Mutation","altered_samples":7,"profiled_samples":199,"frequency_pct":3.5,"total_mutation_events":7},{"study":"ihch_mskcc_2020","mutation_variant":"R132G","mutation_type":"Missense_Mutation","altered_samp … (256 more chars) ▶ resolve_and_route { "studyIds": [ "ihch_msk_2021", "ihch_mskcc_2020", "chol_msk_2018", "chol_icgc_2017", "chol_tcga_pan_can_atlas_2018" ] } ◀ result {"success":true,"message":"Found 5 matching studies. Pick the best match (prefer TCGA → prefer PanCancer Atlas), use its metadata to call the appropriate navigation tool(s) and generate URLs immediately. Present other studies as alternatives.","data":{"totalCount":5,"studiesWithMetadata":[{"studyId":"ihch_msk_2021","name":"Intrahepatic Cholangiocarcinoma (MSK, Hepatology 2021)","sampleCount":412,"studyViewUrl":"https://www.cbioportal.org/study?id=ihch_msk_2021","metadata":{"clinicalAttributeIds":["ADJUVANT_CHEMO","AGE","BMI","CA19","CA19_HIGH","CANCER_TYPE","CANCER_TYPE_DETAILED","CHRONIC_HEPATITIS_ANY_TYPE","CIRRHOSIS","CLIN_PSC","DIABETES_STATUS","DUCT_TYPE","DZ_EXTENT","ECOG_BIN","FRACTION_GENOME_ALTERED","HAIC","HEP_B","HEP_C","LVI","MUTATION_COUNT","NEOADJ_CHEMO","ONCOTREE_CODE","OS_MONTHS","OS_MONTHS_FROM_RX","OS_STATUS","PD_INF","PNI","POSITIVE_LYMPH_NODE","POSITIVE_MARGIN","RFS_MONTHS","RFS_STATUS","SAMPLE_COUNT","SEX","SMOKING_STATUS","STEATOSIS","SYSTEMIC_CHEMO","TMB_NONSYNONYMOUS","TREATMENT_GROUP","TUMOR_GRADE","TUMOR_SIZE"],"molecularProfileIds":["ihch_msk_2021_cna","ihch_msk_2021_mutations","ihch_msk_2021_structural_variants"],"availableComparisonTabs":["overlap","clinical","survival","alterations","mutations"]}},{"studyId":"ihch_mskcc_2020","name":"Intrahepatic Cholangiocarcinoma (MSK, Clin Cancer Res 2021)","sampleCount":219,"studyViewUrl":"https://www.cbioportal.org/study?id=ihch_mskcc_2020","metadata":{"clinicalAttributeIds":["AGE_AT_SEQ_REPORT","CANCER_TYPE","CANCER_TYPE_DETAILED","GENE_PANEL","INSTITUTE","METASTATIC_SITE","MSI_COMMENT","MSI_SCORE","MSI_TYPE","MUTATION_COUNT","ONCOTREE_CODE","PRIMARY_SITE","PROJECT_CODE","SAMPLE_COUNT","SAMPLE_COVERAGE","SOMATIC_STATUS","TMB_NONSYNONYMOUS","TUMOR_PURITY"],"molecularProfileIds":["ihch_mskcc_2020_cna","ihch_mskcc_2020_mutations","ihch_mskcc_2020_structural_variants"],"availableComparisonTabs":["overlap","clinical","alterations","mutations"]}},{"studyId":"chol_msk_2018","name":"Cholangiocarcinoma (MSK, Clin Cancer Res 2018)","sampleCount":195,"studyViewUrl":"https://www.cbioportal.org/study?id=chol_msk_2018","metadata":{"clinicalAttributeIds":["AGE","AGE_AT_SEQ_REPORT","AGE_CURRENT","CANCER_TYPE","CANCER_TYPE_DETAILED","ETHNICITY","FRACTION_GENOME_ALTERED","GENE_PANEL","INSTITUTE","METASTATIC_SITE","MSI_COMMENT","MSI_SCORE","MSI_TYPE","MUTATION_COUNT","ONCOTREE_CODE","OS_MONTHS","OS_STATUS","PARTC_CONSENTED_12_245","PED_IND","POD_FIRST_LINE","PRIMARY_SITE","RACE","RECURRENCE","RELIGION","SAMPLE_CLASS","SAMPLE_COUNT","SAMPLE_COVERAGE","SAMPLE_TYPE","SEX","SOMATIC_STATUS","STAGE_4_DX","SYSTEMIC_TREATMENT","TIME_TO_LAST_FOLLOWUP","TIME_TO_METASTASIS_MONTHS","TMB_NONSYNONYMOUS","TUMOR_PURITY"],"molecularProfileIds":["chol_msk_2018_cna","chol_msk_2018_mutations","chol_msk_2018_structural_variants"],"availableComparisonTabs":["overlap","clinical","survival","alterations","mutations"]}},{"studyId":"chol_icgc_2017","name":"Cholangiocarcinoma (ICGC, Cancer Discov 2017)","sampleCount":489," … (3139 more chars) ▶ navigate_to_results_view { "studyIds": [ "ihch_msk_2021", "ihch_mskcc_2020", "chol_msk_2018", "chol_icgc_2017", "chol_tcga_pan_can_atlas_2018" ], "genes": [ "IDH1" ], "tab": "mutations" } ◀ result {"success":true,"message":"Navigating to https://www.cbioportal.org/results/mutations?cancer_study_list=ihch_msk_2021%2Cihch_mskcc_2020%2Cchol_msk_2018%2Cchol_icgc_2017%2Cchol_tcga_pan_can_atlas_2018&gene_list=IDH1&case_set_id=all","url":"https://www.cbioportal.org/results/mutations?cancer_study_list=ihch_msk_2021%2Cihch_mskcc_2020%2Cchol_msk_2018%2Cchol_icgc_2017%2Cchol_tcga_pan_can_atlas_2018&gene_list=IDH1&case_set_id=all","data":{"studyIds":["ihch_msk_2021","ihch_mskcc_2020","chol_msk_2018","chol_icgc_2017","chol_tcga_pan_can_atlas_2018"],"studies":[{"studyId":"ihch_msk_2021","name":"Intrahepatic Cholangiocarcinoma (MSK, Hepatology 2021)","sampleCount":412},{"studyId":"ihch_mskcc_2020","name":"Intrahepatic Cholangiocarcinoma (MSK, Clin Cancer Res 2021)","sampleCount":219},{"studyId":"chol_msk_2018","name":"Cholangiocarcinoma (MSK, Clin Cancer Res 2018)","sampleCount":195},{"studyId":"chol_icgc_2017","name":"Cholangiocarcinoma (ICGC, Cancer Discov 2017)","sampleCount":489},{"studyId":"chol_tcga_pan_can_atlas_2018","name":"Cholangiocarcinoma (TCGA, PanCancer Atlas)","sampleCount":36}],"genes":["IDH1"],"caseSetId":"all","pageDescription":"Detailed mutation table with lollipop plot showing mutation positions, types, and frequencies for queried genes."}} ═ answer (success) [View IDH1 mutations across 5 cholangiocarcinoma cohorts (Mutations tab)](https://www.cbioportal.org/results/mutations?cancer_study_list=ihch_msk_2021%2Cihch_mskcc_2020%2Cchol_msk_2018%2Cchol_icgc_2017%2Cchol_tcga_pan_can_atlas_2018&gene_list=IDH1&case_set_id=all) Detailed mutation table with lollipop plot showing mutation positions, types, and frequencies across the 5 studies (1,351 total samples, biological overlap possible since MSK cohorts can share patients). **Bottom line:** Across all five cholangiocarcinoma cohorts I checked, essentially every IDH1 mutation is at codon **R132** (R132C, R132L, R132G, R132S — R132C being by far the most common, ~15–21% of samples in the MSK cohorts). The single exception is one **N349S** mutation in one sample from the MSK 2021 intrahepatic cholangiocarcinoma cohort — that is the only truly non-R132 IDH1 mutation found in this data. If by "other than R132" you meant "other substitutions at R132 besides the classic R132H" (R132C/L/G/S), those are common and shown in the table above. Let me know which definition you'd like emphasized.