Q (sonnet): show me P135L mutations in $p14^{ARF}$ ▶ 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://gene-resolution-guide" } ▶ read_guide { "uri": "cbioportal://mutation-frequency-guide" } ◀ result # Gene Resolution Guide Use this guide before querying gene expression, mutation, copy-number, methylation, or structural-variant data when the user's gene term may be ambiguous. ## Routing Triggers Read this guide when the user mentions: - a gene family shorthand: `CD3`, `HLA`, `KRT`, `MUC`, `MT-`, `IGH`, `IGK`, `IGL` - a marker name that may refer to multiple genes or proteins - a gene alias, old symbol, or informal name - a wildcard-like term such as "all CD3 genes" These examples are not exhaustive. Apply this guide to any gene term that may resolve to multiple symbols, aliases, paralogs, family members, or marker genes. ## Core Rule Do not silently aggregate multiple genes when the user names an ambiguous symbol. Either ask for clarification or choose a clearly standard marker and state the choice. For example, "CD3 expression" can refer to `CD3D`, `CD3E`, or `CD3G`; in many immune-marker contexts `CD3E` is the standard marker, but the agent must not average all CD3 genes unless the user asks for a combined signature. ## Gene Discovery Query After validating the gene table exists, search exact symbols first, then prefix/alias-like matches: ```sql SELECT hugo_gene_symbol, entrez_gene_id FROM gene WHERE upper(hugo_gene_symbol) = upper('CD3') OR upper(hugo_gene_symbol) LIKE upper('CD3%') ORDER BY hugo_gene_symbol LIMIT 50; ``` If aliases are available in this deployment, inspect the relevant alias table before assuming no match. If no alias table exists, state that alias resolution is limited to available gene symbols. ## Answer Pattern If multiple plausible genes are found: > "CD3" is ambiguous in cBioPortal gene-symbol terms. I found `CD3D`, `CD3E`, and `CD3G`. Did you mean `CD3E` as a T-cell marker, or should I analyze all three separately? If the user clearly asks for a combined family/signature: - report each gene separately by default - only compute an average/signature if the user explicitly requests it - state exactly how the combined value was calculated ## Do Not - Do not average multiple genes into one expression value without explicit permission. - Do not rewrite an ambiguous symbol to a single gene without telling the user. - Do not treat a prefix match as a validated gene symbol. ◀ 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 mutation_variant, mutation_type, count() AS n FROM genomic_event_derived WHERE hugo_gene_symbol = 'CDKN2A' AND variant_type = 'mutation' AND (mutation_variant LIKE '%P135L%' OR mutation_variant LIKE '%135%') GROUP BY mutation_variant, mutation_type ORDER BY n DESC LIMIT 50" } ◀ result {"rows":[{"mutation_variant":"P135S","mutation_type":"Missense_Mutation","n":8},{"mutation_variant":"G135R","mutation_type":"Missense_Mutation","n":6},{"mutation_variant":"P135Q","mutation_type":"Missense_Mutation","n":5},{"mutation_variant":"G135E","mutation_type":"Missense_Mutation","n":5}]} ▶ clickhouse_run_select_query { "query": "SELECT DISTINCT mutation_variant, mutation_type, count() AS n FROM genomic_event_derived WHERE hugo_gene_symbol = 'CDKN2A' AND variant_type = 'mutation' AND mutation_variant LIKE '%L%' AND mutation_variant LIKE 'P135%' GROUP BY mutation_variant, mutation_type ORDER BY n DESC LIMIT 50" } ▶ clickhouse_list_table_columns { "table": "genomic_event_derived" } ◀ result {"rows":[]} ◀ 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, count() AS n FROM genomic_event_derived WHERE hugo_gene_symbol = 'CDKN2A' AND variant_type = 'mutation' GROUP BY mutation_variant ORDER BY n DESC LIMIT 100" } ◀ result {"rows":[{"mutation_variant":"R80*","n":1199},{"mutation_variant":"R58*","n":819},{"mutation_variant":"H83Y","n":734},{"mutation_variant":"X51_splice","n":522},{"mutation_variant":"W110*","n":387},{"mutation_variant":"Y44*","n":371},{"mutation_variant":"X153_splice","n":219},{"mutation_variant":"P114L","n":215},{"mutation_variant":"L16Pfs*9","n":208},{"mutation_variant":"D84N","n":203},{"mutation_variant":"E120*","n":188},{"mutation_variant":"E88*","n":151},{"mutation_variant":"E69*","n":143},{"mutation_variant":"V28_E33del","n":140},{"mutation_variant":"D108N","n":133},{"mutation_variant":"P48L","n":128},{"mutation_variant":"D108Y","n":123},{"mutation_variant":"P81L","n":122},{"mutation_variant":"E61*","n":120},{"mutation_variant":"D84Y","n":115},{"mutation_variant":"S12*","n":110},{"mutation_variant":"L78Hfs*41","n":108},{"mutation_variant":"X50_splice","n":103},{"mutation_variant":"W15*","n":96},{"mutation_variant":"Q50*","n":92},{"mutation_variant":"H83D","n":84},{"mutation_variant":"A102V","n":78},{"mutation_variant":"Y129*","n":78},{"mutation_variant":"L32_L37del","n":72},{"mutation_variant":"D74N","n":60},{"mutation_variant":"A36Rfs*17","n":58},{"mutation_variant":"E10*","n":56},{"mutation_variant":"A76Pfs*70","n":55},{"mutation_variant":"E88K","n":50},{"mutation_variant":"D108H","n":49},{"mutation_variant":"E119*","n":49},{"mutation_variant":"Y44Lfs*76","n":48},{"mutation_variant":"M53I","n":47},{"mutation_variant":"R58Efs*88","n":47},{"mutation_variant":"D153N","n":47},{"mutation_variant":"E33*","n":47},{"mutation_variant":"D74Y","n":47},{"mutation_variant":"H83R","n":45},{"mutation_variant":"D108G","n":41},{"mutation_variant":"MUTATED","n":41},{"mutation_variant":"T18Afs*15","n":41},{"mutation_variant":"H83N","n":41},{"mutation_variant":"L130Q","n":36},{"mutation_variant":"A102E","n":36},{"mutation_variant":"R22Gfs*4","n":35},{"mutation_variant":"A68T","n":35},{"mutation_variant":"T18_A19dup","n":34},{"mutation_variant":"A76Cfs*64","n":33},{"mutation_variant":"D84G","n":31},{"mutation_variant":"G67Afs*74","n":30},{"mutation_variant":"T79Nfs*41","n":30},{"mutation_variant":"L63Q","n":30},{"mutation_variant":"R80Dfs*66","n":29},{"mutation_variant":"G55Afs*91","n":28},{"mutation_variant":"C72*","n":28},{"mutation_variant":"S7Afs*19","n":28},{"mutation_variant":"S12L","n":27},{"mutation_variant":"F90L","n":26},{"mutation_variant":"R144H","n":25},{"mutation_variant":"R112C","n":25},{"mutation_variant":"D156Ifs*37","n":25},{"mutation_variant":"R87P","n":25},{"mutation_variant":"R22P","n":25},{"mutation_variant":"P81R","n":25},{"mutation_variant":"E27*","n":24},{"mutation_variant":"G136Afs*10","n":24},{"mutation_variant":"V82Rfs*44","n":24},{"mutation_variant":"Q50H","n":24},{"mutation_variant":"E149*","n":23},{"mutation_variant":"A4_P11del","n":23},{"mutation_variant":"T18Rfs*8","n":22},{"mutation_variant":"G45Vfs*8","n":22},{"mutation_variant":"D153Y","n":22},{"mutation_variant":"D84V","n":22},{"mutation_variant":"G111Afs*35","n":22},{"mutat … (728 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": [ "CDKN2A" ], "tab": "mutations" } ◀ result {"success":true,"message":"Navigating to https://www.cbioportal.org/results/mutations?cancer_study_list=msk_impact_50k_2026&gene_list=CDKN2A&case_set_id=msk_impact_50k_2026_all","url":"https://www.cbioportal.org/results/mutations?cancer_study_list=msk_impact_50k_2026&gene_list=CDKN2A&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":["CDKN2A"],"caseSetId":"msk_impact_50k_2026_all","pageDescription":"Detailed mutation table with lollipop plot showing mutation positions, types, and frequencies for queried genes."}} ═ answer (success) ## Summary **No P135L variant found.** I queried `genomic_event_derived` for CDKN2A mutations at protein position 135 and across the full variant list — the database contains **P135S** (n=8), **G135R** (n=6), **P135Q** (n=5), and **G135E** (n=5) at that position, but no P135L in either the ~54,331-sample MSK-IMPACT 50K cohort or elsewhere in the deployment. **Why this matters for p14^ARF specifically:** cBioPortal annotates all CDKN2A protein changes against the **p16^INK4A** reading frame (protein length ≤156 aa, consistent with the positions returned above — R80\*, H83Y, P114L, etc.). CDKN2A's alternate transcript, **p14^ARF**, uses exons 1β+2+3 translated in a *different reading frame*, so the same genomic nucleotide change produces a different amino acid and residue number in each frame. There is no separate p14^ARF-frame annotation stored in this database, so I cannot confirm whether a variant reported in the literature as "p14^ARF P135L" is present here under its (different) p16-frame designation without the underlying genomic coordinate or cDNA change. **To proceed, I'd need one of:** - The genomic coordinate (e.g., chr9:g.xxxxx) or cDNA notation (c.xxx) for this variant, or - Confirmation that you actually mean p16^INK4A P135 (in which case P135S/Q are present, not P135L) In the meantime, here's the CDKN2A mutation landscape (p16 frame, as stored) in the MSK-IMPACT 50K cohort, where you can inspect the lollipop plot around residue 135: [View CDKN2A Mutations](https://www.cbioportal.org/results/mutations?cancer_study_list=msk_impact_50k_2026&gene_list=CDKN2A&case_set_id=msk_impact_50k_2026_all)