Q (sonnet): show me a histogram of C228T mutations in the tert promoter across cancer types ▶ read_guide { "uri": "cbioportal://common-pitfalls#16" } ▶ read_guide { "uri": "cbioportal://mutation-frequency-guide" } ◀ result ### 16. 🚨 SILENT QUERY SUBSTITUTION ("did you mean...") When the user's wording differs from canonical terminology (e.g. "V600V" looks like "V600E" with a typo, or "point mutation" sounds like "missense"), it is forbidden to silently rewrite the question and answer the rewritten version. Doing so produces an answer that looks confident but is for a different question — the user cannot tell what was changed. #### ❌ Wrong: silently substitute > User: *"Find patients in colorectal cancer with the V600V alteration in BRAF"* > Agent: *(internally treats this as V600E)* "I found 412 samples with BRAF V600E in colorectal studies..." > User: *"What is the most prevalent TP53 mutation in uterine cancer that is not a point mutation?"* > Agent: *(internally treats "point mutation" = "missense", silently excludes only missense)* "The most prevalent non-missense TP53 mutation is..." #### ✅ Correct: answer the literal question, flag any normalization For an unusual-looking variant the user may have typed deliberately: - Query for what was asked, literally. - If 0 rows come back, **explain *why* zero is the expected answer** before suggesting a likely-intended alternative. For synonymous variants (e.g. BRAF V600V, TP53 R175R), the explanation is: *cBioPortal's mutation tables filter out synonymous (silent) variants in most studies, so 0 hits means "filtered upstream", not "no such variant exists in any patient"*. Then ask: *"Did you mean V600E (the canonical activating variant)? Or would you like me to look for V600V in the studies that do retain synonymous calls?"* - If the wording is ambiguous (e.g. "point mutation"), ask the user which definition they meant before querying — do not pick one silently. #### Mutation-type terminology mapping (use this to disambiguate) | User says | Canonical definition | `mutation_type` filter | |---|---|---| | "point mutation" | Any SNV (single-nucleotide variant) — includes missense, nonsense, synonymous, splice-site SNVs | `mutation_type IN ('Missense_Mutation','Nonsense_Mutation','Silent','Splice_Site')` — **but ask the user to confirm scope first** | | "missense" | Single amino-acid substitution that changes the protein | `mutation_type = 'Missense_Mutation'` | | "nonsense" / "stop-gain" | Premature stop codon | `mutation_type = 'Nonsense_Mutation'` | | "synonymous" / "silent" | Nucleotide change with no amino-acid change | `mutation_type = 'Silent'` (**often filtered out of public datasets** — see below) | | "splice site" | Mutation in canonical splice acceptor/donor | `mutation_type = 'Splice_Site'` | | "frameshift" | Indel changing reading frame | `mutation_type IN ('Frame_Shift_Ins','Frame_Shift_Del')` | | "indel" / "in-frame" | In-frame insertion or deletion | `mutation_type IN ('In_Frame_Ins','In_Frame_Del')` | | "truncating" | Anything that disrupts the protein early | `mutation_type IN ('Nonsense_Mutation','Frame_Shift_Ins','Frame_Shift_Del','Splice_Site','Nonstop_Mutation')` | **Synonymous-variant filter. … (785 more chars) ◀ 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) ▶ clickhouse_run_select_query { "query": " SELECT DISTINCT cancer_study_identifier, genetic_profile_id, genetic_alteration_type, datatype, name FROM genetic_profile WHERE lower(genetic_profile_id) LIKE '%promoter%' OR lower(name) LIKE '%promoter%' ORDER BY genetic_profile_id LIMIT 50 " } ◀ result {"error_message":"Query execution failed: HTTPDriver for https://dl96orhu96.us-east-1.aws.clickhouse.cloud:8443 received ClickHouse error code 47\n Code: 47. DB::Exception: Unknown expression identifier `cancer_study_identifier` in scope SELECT DISTINCT cancer_study_identifier, genetic_profile_id, genetic_alteration_type, datatype, name FROM genetic_profile WHERE (lower(genetic_profile_id) LIKE '%promoter%') OR (lower(name) LIKE '%promoter%') ORDER BY genetic_profile_id ASC LIMIT 50. (UNKNOWN_IDENTIFIER) (version 26.4.1.2359 (official build))\n"} ▶ clickhouse_run_select_query { "query": " SELECT * FROM genomic_event_derived WHERE hugo_gene_symbol = 'TERT' AND variant_type = 'mutation' LIMIT 20 " } ◀ result {"rows":[{"sample_unique_id":"acc_2019_M9671","hugo_gene_symbol":"TERT","entrez_gene_id":7015,"gene_panel_stable_id":"WES","cancer_study_identifier":"acc_2019","genetic_profile_stable_id":"acc_2019_mutations","variant_type":"mutation","mutation_variant":"P376L","mutation_type":"Missense_Mutation","mutation_status":"SOMATIC","patient_unique_id":"acc_2019_M9671","off_panel":false},{"sample_unique_id":"acc_2019_P-0000717-T01-IM3","hugo_gene_symbol":"TERT","entrez_gene_id":7015,"gene_panel_stable_id":"WES","cancer_study_identifier":"acc_2019","genetic_profile_stable_id":"acc_2019_mutations","variant_type":"mutation","mutation_variant":"Promoter","mutation_type":"5'Flank","mutation_status":"SOMATIC","patient_unique_id":"acc_2019_P-0000717","off_panel":false},{"sample_unique_id":"acc_2019_P-0001239-T01-IM3","hugo_gene_symbol":"TERT","entrez_gene_id":7015,"gene_panel_stable_id":"WES","cancer_study_identifier":"acc_2019","genetic_profile_stable_id":"acc_2019_mutations","variant_type":"mutation","mutation_variant":"Promoter","mutation_type":"5'Flank","mutation_status":"SOMATIC","patient_unique_id":"acc_2019_P-0001239","off_panel":false},{"sample_unique_id":"acc_2019_P-0002189-T01-IM3","hugo_gene_symbol":"TERT","entrez_gene_id":7015,"gene_panel_stable_id":"WES","cancer_study_identifier":"acc_2019","genetic_profile_stable_id":"acc_2019_mutations","variant_type":"mutation","mutation_variant":"Promoter","mutation_type":"5'Flank","mutation_status":"SOMATIC","patient_unique_id":"acc_2019_P-0002189","off_panel":false},{"sample_unique_id":"acc_2019_P-0003699-T01-IM5","hugo_gene_symbol":"TERT","entrez_gene_id":7015,"gene_panel_stable_id":"WES","cancer_study_identifier":"acc_2019","genetic_profile_stable_id":"acc_2019_mutations","variant_type":"mutation","mutation_variant":"Promoter","mutation_type":"5'Flank","mutation_status":"SOMATIC","patient_unique_id":"acc_2019_P-0003699","off_panel":false},{"sample_unique_id":"acc_2019_P-0004334-T01-IM5","hugo_gene_symbol":"TERT","entrez_gene_id":7015,"gene_panel_stable_id":"WES","cancer_study_identifier":"acc_2019","genetic_profile_stable_id":"acc_2019_mutations","variant_type":"mutation","mutation_variant":"Promoter","mutation_type":"5'Flank","mutation_status":"SOMATIC","patient_unique_id":"acc_2019_P-0004334","off_panel":false},{"sample_unique_id":"acc_2019_P-0006032-T01-IM5","hugo_gene_symbol":"TERT","entrez_gene_id":7015,"gene_panel_stable_id":"WES","cancer_study_identifier":"acc_2019","genetic_profile_stable_id":"acc_2019_mutations","variant_type":"mutation","mutation_variant":"Promoter","mutation_type":"5'Flank","mutation_status":"SOMATIC","patient_unique_id":"acc_2019_P-0006032","off_panel":false},{"sample_unique_id":"acc_2019_P-0007777-T01-IM5","hugo_gene_symbol":"TERT","entrez_gene_id":7015,"gene_panel_stable_id":"WES","cancer_study_identifier":"acc_2019","genetic_profile_stable_id":"acc_2019_mutations","variant_type":"mutation","mutation_variant":"Promoter","mutation_type":"5'Flank","mutation_status":"SOMATIC","pat … (4629 more chars) ▶ clickhouse_list_table_columns { "table": "genomic_event_derived" } ◀ 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 mutation_variant, mutation_type, count() as n FROM genomic_event_derived WHERE hugo_gene_symbol = 'TERT' AND variant_type = 'mutation' GROUP BY mutation_variant, mutation_type ORDER BY n DESC LIMIT 30 " } ◀ result {"rows":[{"mutation_variant":"Promoter","mutation_type":"5'Flank","n":19590},{"mutation_variant":"E113Rfs*15","mutation_type":"Frame_Shift_Del","n":74},{"mutation_variant":"G926S","mutation_type":"Missense_Mutation","n":38},{"mutation_variant":"A670V","mutation_type":"Missense_Mutation","n":34},{"mutation_variant":"E280K","mutation_type":"Missense_Mutation","n":34},{"mutation_variant":"V1035I","mutation_type":"Missense_Mutation","n":33},{"mutation_variant":"R447H","mutation_type":"Missense_Mutation","n":27},{"mutation_variant":"R972H","mutation_type":"Missense_Mutation","n":27},{"mutation_variant":"R446H","mutation_type":"Missense_Mutation","n":26},{"mutation_variant":"R240C","mutation_type":"Missense_Mutation","n":26},{"mutation_variant":"G932S","mutation_type":"Missense_Mutation","n":25},{"mutation_variant":"R521C","mutation_type":"Missense_Mutation","n":25},{"mutation_variant":"G225R","mutation_type":"Missense_Mutation","n":24},{"mutation_variant":"R470H","mutation_type":"Missense_Mutation","n":23},{"mutation_variant":"D637N","mutation_type":"Missense_Mutation","n":23},{"mutation_variant":"V791I","mutation_type":"Missense_Mutation","n":21},{"mutation_variant":"R696C","mutation_type":"Missense_Mutation","n":20},{"mutation_variant":"G110Afs*18","mutation_type":"Frame_Shift_Del","n":20},{"mutation_variant":"T839M","mutation_type":"Missense_Mutation","n":20},{"mutation_variant":"R390W","mutation_type":"Missense_Mutation","n":19},{"mutation_variant":"R742C","mutation_type":"Missense_Mutation","n":19},{"mutation_variant":"R889Q","mutation_type":"Missense_Mutation","n":19},{"mutation_variant":"T509M","mutation_type":"Missense_Mutation","n":19},{"mutation_variant":"D685N","mutation_type":"Missense_Mutation","n":19},{"mutation_variant":"R142C","mutation_type":"Missense_Mutation","n":19},{"mutation_variant":"V1090M","mutation_type":"Missense_Mutation","n":18},{"mutation_variant":"R515Q","mutation_type":"Missense_Mutation","n":18},{"mutation_variant":"E484K","mutation_type":"Missense_Mutation","n":17},{"mutation_variant":"A730T","mutation_type":"Missense_Mutation","n":17},{"mutation_variant":"R672C","mutation_type":"Missense_Mutation","n":17}]} ▶ clickhouse_run_select_query { "query": " WITH cohort AS ( SELECT cancer_study_identifier FROM cancer_study_query_preferences WHERE preference_name = 'pan_cancer_tcga' ), sample_cancer_type AS ( SELECT cd.sample_unique_id, cd.attribute_value AS cancer_type FROM clinical_data_derived cd JOIN cohort c USING (cancer_study_identifier) WHERE cd.attribute_name = 'CANCER_TYPE' ), altered AS ( SELECT sct.cancer_type, COUNT(DISTINCT ged.sample_unique_id) AS altered_samples FROM genomic_event_derived ged JOIN cohort c USING (cancer_study_identifier) JOIN sample_cancer_type sct USING (sample_unique_id) WHERE ged.variant_type = 'mutation' AND ged.mutation_status != 'UNCALLED' AND ged.hugo_gene_symbol = 'TERT' AND ged.mutation_type = '5\\'Flank' AND ged.off_panel = 0 GROUP BY sct.cancer_type ), profiled_samples_for_gene AS ( SELECT sample_unique_id, cancer_study_identifier FROM mutation_panel_gene_coverage WHERE hugo_gene_symbol = 'TERT' UNION ALL SELECT sample_unique_id, cancer_study_identifier FROM mutation_wes_coverage ), profiled AS ( SELECT sct.cancer_type, COUNT(DISTINCT p.sample_unique_id) AS profiled_samples FROM profiled_samples_for_gene p JOIN cohort c USING (cancer_study_identifier) JOIN sample_cancer_type sct USING (sample_unique_id) GROUP BY sct.cancer_type ) SELECT p.cancer_type, coalesce(a.altered_samples, 0) AS altered_samples, p.profiled_samples, ROUND(coalesce(a.altered_samples,0) * 100.0 / NULLIF(p.profiled_samples, 0), 2) AS frequency_pct FROM profiled p LEFT JOIN altered a USING (cancer_type) WHERE p.profiled_samples >= 50 ORDER BY frequency_pct DESC " } ◀ result {"rows":[{"cancer_type":"Bladder Cancer","altered_samples":0,"profiled_samples":410,"frequency_pct":0},{"cancer_type":"Breast Cancer","altered_samples":0,"profiled_samples":1066,"frequency_pct":0},{"cancer_type":"Pleural Mesothelioma","altered_samples":0,"profiled_samples":86,"frequency_pct":0},{"cancer_type":"Pheochromocytoma","altered_samples":0,"profiled_samples":147,"frequency_pct":0},{"cancer_type":"Pancreatic Cancer","altered_samples":0,"profiled_samples":179,"frequency_pct":0},{"cancer_type":"Melanoma","altered_samples":0,"profiled_samples":440,"frequency_pct":0},{"cancer_type":"Renal Non-Clear Cell Carcinoma","altered_samples":0,"profiled_samples":341,"frequency_pct":0},{"cancer_type":"Seminoma","altered_samples":0,"profiled_samples":63,"frequency_pct":0},{"cancer_type":"Glioblastoma","altered_samples":0,"profiled_samples":397,"frequency_pct":0},{"cancer_type":"Prostate Cancer","altered_samples":0,"profiled_samples":494,"frequency_pct":0},{"cancer_type":"Non-Small Cell Lung Cancer","altered_samples":0,"profiled_samples":1050,"frequency_pct":0},{"cancer_type":"Endometrial Cancer","altered_samples":0,"profiled_samples":574,"frequency_pct":0},{"cancer_type":"Thymic Epithelial Tumor","altered_samples":0,"profiled_samples":123,"frequency_pct":0},{"cancer_type":"Renal Clear Cell Carcinoma","altered_samples":0,"profiled_samples":402,"frequency_pct":0},{"cancer_type":"Head and Neck Cancer","altered_samples":0,"profiled_samples":515,"frequency_pct":0},{"cancer_type":"Non-Seminomatous Germ Cell Tumor","altered_samples":0,"profiled_samples":86,"frequency_pct":0},{"cancer_type":"Thyroid Cancer","altered_samples":0,"profiled_samples":490,"frequency_pct":0},{"cancer_type":"Leukemia","altered_samples":0,"profiled_samples":200,"frequency_pct":0},{"cancer_type":"Adrenocortical Carcinoma","altered_samples":0,"profiled_samples":91,"frequency_pct":0},{"cancer_type":"Sarcoma","altered_samples":0,"profiled_samples":255,"frequency_pct":0},{"cancer_type":"Hepatobiliary Cancer","altered_samples":0,"profiled_samples":366,"frequency_pct":0},{"cancer_type":"Cervical Cancer","altered_samples":0,"profiled_samples":291,"frequency_pct":0},{"cancer_type":"Ocular Melanoma","altered_samples":0,"profiled_samples":80,"frequency_pct":0},{"cancer_type":"Glioma","altered_samples":0,"profiled_samples":514,"frequency_pct":0},{"cancer_type":"Ovarian Epithelial Tumor","altered_samples":0,"profiled_samples":523,"frequency_pct":0},{"cancer_type":"Colorectal Cancer","altered_samples":0,"profiled_samples":534,"frequency_pct":0},{"cancer_type":"Esophagogastric Cancer","altered_samples":0,"profiled_samples":618,"frequency_pct":0}]} ▶ clickhouse_run_select_query { "query": " SELECT cancer_study_identifier, count() AS n, uniqExact(sample_unique_id) as n_samples FROM genomic_event_derived WHERE hugo_gene_symbol = 'TERT' AND variant_type = 'mutation' AND mutation_type = '5\\'Flank' GROUP BY cancer_study_identifier ORDER BY n DESC LIMIT 30 " } ◀ result {"rows":[{"cancer_study_identifier":"msk_impact_50k_2026","n":6870,"n_samples":6634},{"cancer_study_identifier":"msk_met_2021","n":2583,"n_samples":2472},{"cancer_study_identifier":"msk_impact_2017","n":1358,"n_samples":1325},{"cancer_study_identifier":"paired_bladder_2022","n":1209,"n_samples":1170},{"cancer_study_identifier":"pan_origimed_2020","n":738,"n_samples":734},{"cancer_study_identifier":"mel_mskimpact_2020","n":625,"n_samples":572},{"cancer_study_identifier":"glioma_mskcc_2019","n":596,"n_samples":594},{"cancer_study_identifier":"tmb_mskcc_2018","n":510,"n_samples":489},{"cancer_study_identifier":"msk_chord_2024","n":389,"n_samples":378},{"cancer_study_identifier":"bladder_msk_2023","n":378,"n_samples":367},{"cancer_study_identifier":"ccle_broad_2025","n":257,"n_samples":251},{"cancer_study_identifier":"hcc_msk_2024","n":224,"n_samples":221},{"cancer_study_identifier":"mycf_msk_2026","n":207,"n_samples":199},{"cancer_study_identifier":"blca_msk_2025","n":193,"n_samples":188},{"cancer_study_identifier":"hcc_clca_2024","n":170,"n_samples":170},{"cancer_study_identifier":"pancan_mimsi_msk_2024","n":169,"n_samples":161},{"cancer_study_identifier":"pancan_hcmi_2025","n":165,"n_samples":153},{"cancer_study_identifier":"crc_msk_2026","n":161,"n_samples":156},{"cancer_study_identifier":"msk_ctdna_vte_2024","n":159,"n_samples":154},{"cancer_study_identifier":"blca_msk_2024","n":148,"n_samples":140},{"cancer_study_identifier":"hcc_inserm_fr_2015","n":138,"n_samples":138},{"cancer_study_identifier":"sarcoma_mskcc_2022","n":120,"n_samples":119},{"cancer_study_identifier":"bladder_columbia_msk_2018","n":112,"n_samples":112},{"cancer_study_identifier":"blca_msk_tcga_2020","n":99,"n_samples":96},{"cancer_study_identifier":"msk_access_2021","n":95,"n_samples":94},{"cancer_study_identifier":"msk_ch_2023","n":85,"n_samples":83},{"cancer_study_identifier":"acc_2019","n":82,"n_samples":81},{"cancer_study_identifier":"blca_nmibc_2017","n":78,"n_samples":77},{"cancer_study_identifier":"blca_pdx_msk_2025","n":71,"n_samples":71},{"cancer_study_identifier":"hcc_mskimpact_2018","n":69,"n_samples":68}]} ▶ clickhouse_run_select_query { "query": " WITH sample_cancer_type AS ( SELECT cd.sample_unique_id, cd.attribute_value AS cancer_type FROM clinical_data_derived cd WHERE cd.cancer_study_identifier = 'msk_impact_50k_2026' AND cd.attribute_name = 'CANCER_TYPE' ), altered AS ( SELECT sct.cancer_type, COUNT(DISTINCT ged.sample_unique_id) AS altered_samples FROM genomic_event_derived ged JOIN sample_cancer_type sct USING (sample_unique_id) WHERE ged.cancer_study_identifier = 'msk_impact_50k_2026' AND ged.variant_type = 'mutation' AND ged.mutation_status != 'UNCALLED' AND ged.hugo_gene_symbol = 'TERT' AND ged.mutation_type = '5\\'Flank' AND ged.off_panel = 0 GROUP BY sct.cancer_type ), profiled_samples_for_gene AS ( SELECT sample_unique_id FROM mutation_panel_gene_coverage WHERE hugo_gene_symbol = 'TERT' AND cancer_study_identifier = 'msk_impact_50k_2026' UNION ALL SELECT sample_unique_id FROM mutation_wes_coverage WHERE cancer_study_identifier = 'msk_impact_50k_2026' ), profiled AS ( SELECT sct.cancer_type, COUNT(DISTINCT p.sample_unique_id) AS profiled_samples FROM profiled_samples_for_gene p JOIN sample_cancer_type sct USING (sample_unique_id) GROUP BY sct.cancer_type ) SELECT p.cancer_type, coalesce(a.altered_samples, 0) AS altered_samples, p.profiled_samples, ROUND(coalesce(a.altered_samples,0) * 100.0 / NULLIF(p.profiled_samples, 0), 2) AS frequency_pct FROM profiled p LEFT JOIN altered a USING (cancer_type) WHERE p.profiled_samples >= 50 AND coalesce(a.altered_samples,0) > 0 ORDER BY frequency_pct DESC LIMIT 40 " } ◀ result {"rows":[{"cancer_type":"Bladder Cancer","altered_samples":1781,"profiled_samples":2526,"frequency_pct":70.51},{"cancer_type":"Glioma","altered_samples":1528,"profiled_samples":2322,"frequency_pct":65.81},{"cancer_type":"Melanoma","altered_samples":1037,"profiled_samples":1831,"frequency_pct":56.64},{"cancer_type":"Thyroid Cancer","altered_samples":475,"profiled_samples":867,"frequency_pct":54.79},{"cancer_type":"Sex Cord Stromal Tumor","altered_samples":35,"profiled_samples":91,"frequency_pct":38.46},{"cancer_type":"Vaginal Cancer","altered_samples":20,"profiled_samples":57,"frequency_pct":35.09},{"cancer_type":"Head and Neck Cancer","altered_samples":199,"profiled_samples":657,"frequency_pct":30.29},{"cancer_type":"Skin Cancer, Non-Melanoma","altered_samples":136,"profiled_samples":455,"frequency_pct":29.89},{"cancer_type":"Embryonal Tumor","altered_samples":14,"profiled_samples":80,"frequency_pct":17.5},{"cancer_type":"Hepatobiliary Cancer","altered_samples":217,"profiled_samples":1431,"frequency_pct":15.16},{"cancer_type":"Cancer of Unknown Primary","altered_samples":180,"profiled_samples":1581,"frequency_pct":11.39},{"cancer_type":"Renal Cell Carcinoma","altered_samples":111,"profiled_samples":1209,"frequency_pct":9.18},{"cancer_type":"Salivary Gland Cancer","altered_samples":36,"profiled_samples":411,"frequency_pct":8.76},{"cancer_type":"Miscellaneous Brain Tumor","altered_samples":5,"profiled_samples":58,"frequency_pct":8.62},{"cancer_type":"Cervical Cancer","altered_samples":28,"profiled_samples":351,"frequency_pct":7.98},{"cancer_type":"Soft Tissue Sarcoma","altered_samples":177,"profiled_samples":2307,"frequency_pct":7.67},{"cancer_type":"Adrenocortical Carcinoma","altered_samples":6,"profiled_samples":88,"frequency_pct":6.82},{"altered_samples":3,"profiled_samples":50,"frequency_pct":6},{"cancer_type":"Mesothelioma","altered_samples":23,"profiled_samples":408,"frequency_pct":5.64},{"cancer_type":"Bone Cancer","altered_samples":29,"profiled_samples":590,"frequency_pct":4.92},{"cancer_type":"Anal Cancer","altered_samples":7,"profiled_samples":143,"frequency_pct":4.9},{"cancer_type":"CNS Cancer","altered_samples":8,"profiled_samples":170,"frequency_pct":4.71},{"cancer_type":"Small Bowel Cancer","altered_samples":6,"profiled_samples":161,"frequency_pct":3.73},{"cancer_type":"Ampullary Cancer","altered_samples":5,"profiled_samples":134,"frequency_pct":3.73},{"cancer_type":"Wilms Tumor","altered_samples":2,"profiled_samples":68,"frequency_pct":2.94},{"cancer_type":"Nerve Sheath Tumor","altered_samples":4,"profiled_samples":142,"frequency_pct":2.82},{"cancer_type":"Uterine Sarcoma","altered_samples":9,"profiled_samples":344,"frequency_pct":2.62},{"cancer_type":"Ovarian Cancer","altered_samples":54,"profiled_samples":2140,"frequency_pct":2.52},{"cancer_type":"Endometrial Cancer","altered_samples":59,"profiled_samples":2445,"frequency_pct":2.41},{"cancer_type":"Non-Small Cell Lung Cancer","altered_samples":189,"profiled_samples":7867,"frequency … (1064 more chars) ▶ resolve_and_route { "studyIds": [ "msk_impact_50k_2026" ] } ◀ result {"success":true,"message":"Found 1 study. Use the metadata to call the appropriate navigation tool(s).","data":{"totalCount":1,"studiesWithMetadata":[{"studyId":"msk_impact_50k_2026","name":"MSK-IMPACT 50K Clinical Sequencing Cohort (MSK, Cancer Cell 2026)","sampleCount":54331,"studyViewUrl":"https://www.cbioportal.org/study?id=msk_impact_50k_2026","metadata":{"clinicalAttributeIds":["AGE_AT_DX","ANCESTRY_LABEL","CANCER_TYPE","CANCER_TYPE_DETAILED","DISEASE_STATUS","FACETS_PLOIDY","FACETS_PURITY","FACETS_QC","FACETS_SUITE_VERSION","FACETS_WGD","FRACTION_GENOME_ALTERED","GENE_PANEL","HLA-A1","HLA-A2","HLA-B1","HLA-B2","HLA-C1","HLA-C2","HLA_A1_LOH","HLA_A2_LOH","HLA_B1_LOH","HLA_B2_LOH","HLA_C1_LOH","HLA_C2_LOH","HLA_GENOTYPE_AVAILABLE","METASTATIC_SITE","MSI_SCORE","MSI_TYPE","MUTATION_COUNT","N_OTHER_CANCER_TYPES","ONCOTREE_CODE","OS_MONTHS","OS_STATUS","PRIMARY_SITE","PURITY_ESTIMATE_FROM_MUTATIONS","SAMPLE_COUNT","SAMPLE_COVERAGE","SAMPLE_TYPE","SEX","SOMATIC_STATUS","TMB_SCORE","TUMOR_PURITY"],"molecularProfileIds":["msk_impact_50k_2026_gistic","msk_impact_50k_2026_mutations","msk_impact_50k_2026_structural_variants"],"genericAssayProfiles":["msk_impact_50k_2026_armlevel_cna","msk_impact_50k_2026_loh_hla","msk_impact_50k_2026_mutational_signatures_contribution_v2"],"availableComparisonTabs":["overlap","clinical","survival","alterations","mutations","generic_assay_armlevel_cna","generic_assay_loh_hla","generic_assay_mutational_signature"]}}]}} ▶ navigate_to_results_view { "studyIds": [ "msk_impact_50k_2026" ], "genes": [ "TERT: MUT = PROMOTER" ], "tab": "cancerTypesSummary" } ◀ result {"success":true,"message":"Navigating to https://www.cbioportal.org/results/cancerTypesSummary?cancer_study_list=msk_impact_50k_2026&gene_list=TERT%3A+MUT+%3D+PROMOTER&case_set_id=msk_impact_50k_2026_all","url":"https://www.cbioportal.org/results/cancerTypesSummary?cancer_study_list=msk_impact_50k_2026&gene_list=TERT%3A+MUT+%3D+PROMOTER&case_set_id=msk_impact_50k_2026_all","data":{"studyIds":["msk_impact_50k_2026"],"studies":[{"studyId":"msk_impact_50k_2026","name":"MSK-IMPACT 50K Clinical Sequencing Cohort (MSK, Cancer Cell 2026)","sampleCount":54331}],"genes":["TERT"],"caseSetId":"msk_impact_50k_2026_all","pageDescription":"Alteration frequencies for queried genes by cancer type."}} ═ answer (success) ## Important caveat first **The database cannot distinguish C228T from C250T.** Across every study I checked (TCGA and MSK targeted-panel cohorts alike), TERT promoter mutations are stored generically as `mutation_variant = "Promoter"` (`mutation_type = 5'Flank`) — there is no genomic-position or HGVS field that separates the two canonical hotspots (C228T/−124C>T vs C250T/−146C>T). So what follows is a histogram of **all TERT promoter mutations combined**, not C228T specifically. **A second finding worth flagging:** TCGA PanCancer Atlas (the usual default cohort for "across cancer types" questions) returned **zero** TERT promoter calls in every cancer type — its WES pipeline does not reliably call this non-coding hotspot. I switched to the **MSK-IMPACT 50K cohort** (`msk_impact_50k_2026`, 54,331 samples), whose targeted panel explicitly covers the TERT promoter region, and used patient/sample counts profiled specifically for TERT as the denominator. ## TERT promoter mutation frequency by cancer type (MSK-IMPACT 50K, sample-level) | Cancer type | Samples with promoter mutation | Profiled samples | Frequency | |---|---:|---:|---:| | Bladder Cancer | 1,781 | 2,526 | **70.5%** | | Glioma | 1,528 | 2,322 | **65.8%** | | Melanoma | 1,037 | 1,831 | **56.6%** | | Thyroid Cancer | 475 | 867 | **54.8%** | | Sex Cord Stromal Tumor | 35 | 91 | 38.5% | | Vaginal Cancer | 20 | 57 | 35.1% | | Head and Neck Cancer | 199 | 657 | 30.3% | | Skin Cancer, Non-Melanoma | 136 | 455 | 29.9% | | Hepatobiliary Cancer | 217 | 1,431 | 15.2% | | Renal Cell Carcinoma | 111 | 1,209 | 9.2% | | Soft Tissue Sarcoma | 177 | 2,307 | 7.7% | | Non-Small Cell Lung Cancer | 189 | 7,867 | 2.4% | | Colorectal Cancer | 99 | 5,277 | 1.9% | | Breast Cancer | 46 | 6,807 | 0.7% | (Full list has ~38 cancer types with at least one hit; smaller/rare types with <50 profiled samples were excluded for reliability.) This ranking matches the well-established biology of TERT promoter hotspots (bladder, glioma, melanoma, thyroid as the top four), which supports the query logic despite the C228T/C250T conflation. [View TERT promoter mutation frequencies across cancer types (Cancer Types Summary)](https://www.cbioportal.org/results/cancerTypesSummary?cancer_study_list=msk_impact_50k_2026&gene_list=TERT%3A+MUT+%3D+PROMOTER&case_set_id=msk_impact_50k_2026_all) This link opens cBioPortal's built-in histogram/bar-chart view for the TERT promoter alteration across all cancer types in the MSK-IMPACT 50K cohort — alteration frequencies by cancer type, exactly as computed above. If you want the TCGA Pan-Cancer Atlas view instead (despite its 0% calls) for comparison, or want me to check a single specific study (e.g., a glioma- or bladder-only cohort) for whether raw MAF files there separate the two hotspot positions, let me know.