Q (sonnet): There is a heavily discussed driver alteration in MAP2K1 at codon 105 that significantly alters mRNA stability. Please list the expression values for the tumors that have a nucleotide change at this position ▶ read_guide { "uri": "cbioportal://mutation-frequency-guide" } ▶ read_guide { "uri": "cbioportal://gene-expression-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) ◀ result # Gene Expression Analysis Guide This guide covers continuous-value genomic data: gene **expression**, **copy number** values, **methylation**, and related profile types. Mutation/CNA/SV *frequency* analysis lives in `cbioportal://mutation-frequency-guide`. ## Where this data lives Continuous per-sample-per-gene values are stored in `genetic_alteration_derived`: | Column | Description | |---|---| | `sample_unique_id` | `_` | | `cancer_study_identifier` | study scope | | `hugo_gene_symbol` | gene | | `profile_type` | which assay/normalization (see below) | | `alteration_value` | the actual value — stored as Nullable(String); cast with `toFloat64OrNull` | `alteration_value` is a string because the same column hosts many different value scales. The `''` and `'NA'` sentinels mean "missing"; always filter them out and use `toFloat64OrNull(alteration_value) IS NOT NULL` for downstream math. ## Discovering profile types for a study Different studies expose different profile types depending on what assays were run and how the data was normalized. Always check what a specific study supports before picking one: ```sql SELECT DISTINCT profile_type FROM genetic_alteration_derived WHERE cancer_study_identifier = 'brca_metabric' ORDER BY profile_type; ``` Common values across the public portal: | Family | Profile types | |---|---| | mRNA expression | `mrna`, `mrna_median_Zscores`, `mrna_seq_v2_rsem`, `mrna_seq_v2_rsem_Zscores`, `mrna_seq_cpm`, `mrna_seq_fpkm`, `mrna_U133`, `mrna_outliers` | | Copy number (continuous) | `cna`, `linear_CNA`, `log2CNA`, `cna_consensus`, `cna_rae`, `gistic` | | Methylation | `methylation_hm27`, `methylation_hm450`, `methylation_epic`, `methylation_promoters_rrbs` | | miRNA | `mirna`, `mirna_median_Zscores` | | Protein | `protein_quantification`, `protein_level`, `RPPA` | **Z-score vs raw choice.** When the user asks "is X correlated with Y", either works for Spearman (rank-based) — Pearson would care. Default to the non-Z-score variant if both exist, and call out which one in the response. ## Canonical recipe — Spearman correlation between two genes ```sql SELECT * FROM gene_pair_coexpression( study = 'brca_metabric', gene_a = 'TP53', gene_b = 'MYC', profile_type = 'mrna' ); ``` Returns one row: `(gene_a, gene_b, profile_type, spearman_correlation, num_samples)`. - `spearman_correlation` in [−1, 1]; `NULL` when fewer than 3 valid paired samples. - Mirrors cbioportal-backend's `ClickhouseCoExpressionMapper.getCoExpressions`, simplified to a pair lookup (the backend computes one ref gene vs ALL other genes for the coexpression page; here the agent asks about a specific pair). ### Verified examples | Study | gene_a | gene_b | profile_type | spearman | n | |---|---|---|---|---|---| | `brca_metabric` | TP53 | MYC | `mrna` | 0.118 | 1980 | | `brca_metabric` | ESR1 | PGR | `mrna` | 0.487 | 1980 | ESR1↔PGR is the textbook breast-cancer estrogen-receptor coregula … (2785 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 hugo_gene_symbol, mutation_variant, mutation_type, cancer_study_identifier FROM genomic_event_derived WHERE hugo_gene_symbol = 'MAP2K1' AND variant_type = 'mutation' AND (mutation_variant LIKE '%105%') ORDER BY cancer_study_identifier LIMIT 50" } ◀ result {"rows":[{"hugo_gene_symbol":"MAP2K1","mutation_variant":"P105_A106del","mutation_type":"In_Frame_Del","cancer_study_identifier":"crc_msk_2026"},{"hugo_gene_symbol":"MAP2K1","mutation_variant":"P105_I107delinsL","mutation_type":"In_Frame_Del","cancer_study_identifier":"hdcn_msk_2025"},{"hugo_gene_symbol":"MAP2K1","mutation_variant":"P105_A106del","mutation_type":"In_Frame_Del","cancer_study_identifier":"hdcn_msk_2025"},{"hugo_gene_symbol":"MAP2K1","mutation_variant":"P105_I107delinsL","mutation_type":"In_Frame_Del","cancer_study_identifier":"histiocytosis_cobi_msk_2019"},{"hugo_gene_symbol":"MAP2K1","mutation_variant":"P105_A106del","mutation_type":"In_Frame_Del","cancer_study_identifier":"luad_tcga_gdc"},{"hugo_gene_symbol":"MAP2K1","mutation_variant":"P105_A106del","mutation_type":"In_Frame_Del","cancer_study_identifier":"mel_mskimpact_2020"},{"hugo_gene_symbol":"MAP2K1","mutation_variant":"P105_I107delinsL","mutation_type":"In_Frame_Del","cancer_study_identifier":"mixed_allen_2018"},{"hugo_gene_symbol":"MAP2K1","mutation_variant":"P105_A106del","mutation_type":"In_Frame_Del","cancer_study_identifier":"msk_chord_2024"},{"hugo_gene_symbol":"MAP2K1","mutation_variant":"P105_I107delinsL","mutation_type":"In_Frame_Del","cancer_study_identifier":"msk_impact_2017"},{"hugo_gene_symbol":"MAP2K1","mutation_variant":"P105_A106del","mutation_type":"In_Frame_Del","cancer_study_identifier":"msk_impact_2017"},{"hugo_gene_symbol":"MAP2K1","mutation_variant":"P105_A106del","mutation_type":"In_Frame_Del","cancer_study_identifier":"msk_impact_50k_2026"},{"hugo_gene_symbol":"MAP2K1","mutation_variant":"P105R","mutation_type":"Missense_Mutation","cancer_study_identifier":"msk_impact_50k_2026"},{"hugo_gene_symbol":"MAP2K1","mutation_variant":"P105_A106del","mutation_type":"In_Frame_Del","cancer_study_identifier":"msk_met_2021"},{"hugo_gene_symbol":"MAP2K1","mutation_variant":"P105R","mutation_type":"Missense_Mutation","cancer_study_identifier":"msk_met_2021"},{"hugo_gene_symbol":"MAP2K1","mutation_variant":"P105_A106del","mutation_type":"In_Frame_Del","cancer_study_identifier":"tmb_mskcc_2018"}]} ═ answer (success) This confirms what I suspected. Here's the important clarification before I go any further: **What cBioPortal actually has at MAP2K1 residue 105:** - `P105_A106del` — an in-frame **deletion** spanning residues 105–106 (not a single-nucleotide/point change) - `P105_I107delinsL` — an in-frame **deletion-insertion** spanning residues 105–107 - `P105R` — a **missense point mutation** (proline→arginine at codon 105) — the only variant that is a true single "nucleotide change at this position" Only the **P105R** missense variant qualifies as a genuine single-codon nucleotide substitution. The others are multi-residue deletions/indels, not point mutations at codon 105. **On the premise itself — I need to stop you here:** 1. **mRNA stability is not a data type cBioPortal stores or annotates.** There is no field, assay, or precomputed claim in this database linking MAP2K1 codon 105 to altered mRNA stability. I have not found, and cannot find, support for "heavily discussed... significantly alters mRNA stability" anywhere in cBioPortal's data. I am not asserting this is true or false biologically — I simply have no data source here to confirm it, and I won't repeat it as fact. 2. **Driver annotation** — I have not yet checked `driver_filter` for these MAP2K1 variants, so I have not confirmed any of them are annotated drivers. I can check that if you want it, but "heavily discussed driver alteration" is your framing, not a confirmed cBioPortal annotation. **On mRNA expression data**: cBioPortal does store gene expression (mRNA z-scores/RSEM values) per sample, and I can absolutely pull expression values for the specific tumors carrying `P105R` (or, if you intend the deletions too, those as well) — but only for studies that have **both** mutation calls **and** expression profiling (most MSK-IMPACT panel studies do not have mRNA expression data; TCGA-style WES/RNA-seq studies do). Looking at the list above, none of these MAP2K1-105 mutations occur in a study with matching mRNA expression profiling (they're all MSK-IMPACT/CHORD panel studies or `luad_tcga_gdc`, which is a GDC mirror — let me verify expression availability) — could you confirm: - Do you want expression values specifically for **P105R** (true point mutation), or do you want all three variant types (including the deletions) grouped together? - Are you open to whichever cohort(s) actually have both the mutation and expression data, even if small in number? I'll pull the actual expression values once you confirm scope — I don't want to guess and return an incomplete or misleading table.