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 … (36467 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"}]} ═ answer (success) There are many cholangiocarcinoma cohorts in cBioPortal. Since "cholangio" matches multiple studies of different sizes and origins (broad CHOL vs. intrahepatic-only IHCH cohorts), I want to confirm scope before running the query across all of them. **Matching studies:** | Study | ID | Samples | |---|---|---| | [Cholangiocarcinoma (ICGC, Cancer Discov 2017)](https://www.cbioportal.org/study/summary?id=chol_icgc_2017) | `chol_icgc_2017` | 489 | | [Intrahepatic Cholangiocarcinoma (MSK, Hepatology 2021)](https://www.cbioportal.org/study/summary?id=ihch_msk_2021) | `ihch_msk_2021` | 412 | | [Intrahepatic Cholangiocarcinoma (MSK, Clin Cancer Res 2021)](https://www.cbioportal.org/study/summary?id=ihch_mskcc_2020) | `ihch_mskcc_2020` | 219 | | [Cholangiocarcinoma (MSK, Clin Cancer Res 2018)](https://www.cbioportal.org/study/summary?id=chol_msk_2018) | `chol_msk_2018` | 195 | | [Combined HCC + Intrahepatic Cholangio (Peking Univ, Cancer Cell 2019)](https://www.cbioportal.org/study/summary?id=hccihch_pku_2019) | `hccihch_pku_2019` | 173 | | [Intrahepatic Cholangiocarcinoma (Shanghai, Nat Commun 2014)](https://www.cbioportal.org/study/summary?id=ihch_smmu_2014) | `ihch_smmu_2014` | 103 | | [Cholangiocarcinoma (TCGA GDC, 2025)](https://www.cbioportal.org/study/summary?id=chol_tcga_gdc) | `chol_tcga_gdc` | 51 | | [Cholangiocarcinoma (TCGA, Firehose Legacy)](https://www.cbioportal.org/study/summary?id=chol_tcga) | `chol_tcga` | 51 | | [Intrahepatic Cholangiocarcinoma (JHU, Nat Genet 2013)](https://www.cbioportal.org/study/summary?id=chol_jhu_2013) | `chol_jhu_2013` | 40 | | [Cholangiocarcinoma (TCGA, PanCancer Atlas)](https://www.cbioportal.org/study/summary?id=chol_tcga_pan_can_atlas_2018) | `chol_tcga_pan_can_atlas_2018` | 36 | | [Cholangiocarcinoma (NCC Singapore, Nat Genet 2013)](https://www.cbioportal.org/study/summary?id=chol_nccs_2013) | `chol_nccs_2013` | 15 | | [Intrahepatic Cholangiocarcinoma (Mount Sinai 2015)](https://www.cbioportal.org/study/summary?id=ihch_ismms_2015) | `ihch_ismms_2015` | 8 | | [Cholangiocarcinoma (NUS Singapore, Nat Genet 2012)](https://www.cbioportal.org/study/summary?id=chol_nus_2012) | `chol_nus_2012` | 8 | Since IDH1 mutations occur almost exclusively in the **intrahepatic** subtype, would you like me to: 1. Run this across **all** cholangiocarcinoma studies listed above (largest, most comprehensive — recommended, since IDH1 hits are sparse per-cohort), or 2. Restrict to a specific study/subset (e.g., just the MSK intrahepatic cohorts, or just TCGA)? Let me know, or say "all of them" and I'll pull IDH1 mutation variants excluding R132* across every cholangio cohort above.