Q (sonnet): what other genes are altered in kras mutant crc or luad ▶ 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": "Colorectal Adenocarcinoma TCGA PanCancer" } ▶ list_studies { "search": "Lung Adenocarcinoma TCGA PanCancer" } ◀ result {"result":[{"cancer_study_identifier":"coadread_tcga_pan_can_atlas_2018","name":"Colorectal Adenocarcinoma (TCGA, PanCancer Atlas)","type_of_cancer_id":"coadread","sample_count":594,"has_guide":true,"url":"https://www.cbioportal.org/study/summary?id=coadread_tcga_pan_can_atlas_2018"}]} ◀ result {"result":[{"cancer_study_identifier":"luad_tcga_pan_can_atlas_2018","name":"Lung Adenocarcinoma (TCGA, PanCancer Atlas)","type_of_cancer_id":"luad","sample_count":566,"has_guide":true,"url":"https://www.cbioportal.org/study/summary?id=luad_tcga_pan_can_atlas_2018"}]} ▶ clickhouse_run_select_query { "query": "SELECT * FROM co_altered_genes_in_study(study = 'coadread_tcga_pan_can_atlas_2018', gene = 'KRAS', top_n = 20)" } ▶ clickhouse_run_select_query { "query": "SELECT * FROM co_altered_genes_in_study(study = 'luad_tcga_pan_can_atlas_2018', gene = 'KRAS', top_n = 20)" } ◀ result {"rows":[{"hugo_gene_symbol":"APC","mutant_altered":182,"mutant_profiled":218,"mutant_pct":83.5,"wildtype_altered":205,"wildtype_profiled":316,"wildtype_pct":64.9,"pct_difference":18.6},{"hugo_gene_symbol":"PIK3CA","mutant_altered":83,"mutant_profiled":218,"mutant_pct":38.1,"wildtype_altered":64,"wildtype_profiled":316,"wildtype_pct":20.3,"pct_difference":17.8},{"hugo_gene_symbol":"BRAF","mutant_altered":6,"mutant_profiled":218,"mutant_pct":2.8,"wildtype_altered":56,"wildtype_profiled":316,"wildtype_pct":17.7,"pct_difference":-14.9},{"hugo_gene_symbol":"COL7A1","mutant_altered":7,"mutant_profiled":218,"mutant_pct":3.2,"wildtype_altered":40,"wildtype_profiled":316,"wildtype_pct":12.7,"pct_difference":-9.5},{"hugo_gene_symbol":"PCBP1","mutant_altered":20,"mutant_profiled":218,"mutant_pct":9.2,"wildtype_altered":5,"wildtype_profiled":316,"wildtype_pct":1.6,"pct_difference":7.6},{"hugo_gene_symbol":"ABCA13","mutant_altered":22,"mutant_profiled":218,"mutant_pct":10.1,"wildtype_altered":55,"wildtype_profiled":316,"wildtype_pct":17.4,"pct_difference":-7.3},{"hugo_gene_symbol":"DOCK3","mutant_altered":11,"mutant_profiled":218,"mutant_pct":5,"wildtype_altered":38,"wildtype_profiled":316,"wildtype_pct":12,"pct_difference":-7},{"hugo_gene_symbol":"YLPM1","mutant_altered":6,"mutant_profiled":218,"mutant_pct":2.8,"wildtype_altered":31,"wildtype_profiled":316,"wildtype_pct":9.8,"pct_difference":-7},{"hugo_gene_symbol":"ZNF469","mutant_altered":11,"mutant_profiled":218,"mutant_pct":5,"wildtype_altered":38,"wildtype_profiled":316,"wildtype_pct":12,"pct_difference":-7},{"hugo_gene_symbol":"CHD7","mutant_altered":7,"mutant_profiled":218,"mutant_pct":3.2,"wildtype_altered":32,"wildtype_profiled":316,"wildtype_pct":10.1,"pct_difference":-6.9},{"hugo_gene_symbol":"ARID1A","mutant_altered":15,"mutant_profiled":218,"mutant_pct":6.9,"wildtype_altered":43,"wildtype_profiled":316,"wildtype_pct":13.6,"pct_difference":-6.7},{"hugo_gene_symbol":"CELSR2","mutant_altered":6,"mutant_profiled":218,"mutant_pct":2.8,"wildtype_altered":30,"wildtype_profiled":316,"wildtype_pct":9.5,"pct_difference":-6.7},{"hugo_gene_symbol":"NRAS","mutant_altered":5,"mutant_profiled":218,"mutant_pct":2.3,"wildtype_altered":28,"wildtype_profiled":316,"wildtype_pct":8.9,"pct_difference":-6.6},{"hugo_gene_symbol":"TMPRSS15","mutant_altered":19,"mutant_profiled":218,"mutant_pct":8.7,"wildtype_altered":7,"wildtype_profiled":316,"wildtype_pct":2.2,"pct_difference":6.5},{"hugo_gene_symbol":"DNAH1","mutant_altered":14,"mutant_profiled":218,"mutant_pct":6.4,"wildtype_altered":40,"wildtype_profiled":316,"wildtype_pct":12.7,"pct_difference":-6.3},{"hugo_gene_symbol":"SCN3A","mutant_altered":9,"mutant_profiled":218,"mutant_pct":4.1,"wildtype_altered":33,"wildtype_profiled":316,"wildtype_pct":10.4,"pct_difference":-6.3},{"hugo_gene_symbol":"CACNA1F","mutant_altered":4,"mutant_profiled":218,"mutant_pct":1.8,"wildtype_altered":25,"wildtype_profiled":316,"wildtype_pct":7.9,"pct_difference":-6.1},{"hugo_gene_symbol" … (505 more chars) ◀ result {"rows":[{"hugo_gene_symbol":"TP53","mutant_altered":62,"mutant_profiled":168,"mutant_pct":36.9,"wildtype_altered":233,"wildtype_profiled":398,"wildtype_pct":58.5,"pct_difference":-21.6},{"hugo_gene_symbol":"EGFR","mutant_altered":1,"mutant_profiled":168,"mutant_pct":0.6,"wildtype_altered":69,"wildtype_profiled":398,"wildtype_pct":17.3,"pct_difference":-16.7},{"hugo_gene_symbol":"STK11","mutant_altered":38,"mutant_profiled":168,"mutant_pct":22.6,"wildtype_altered":37,"wildtype_profiled":398,"wildtype_pct":9.3,"pct_difference":13.3},{"hugo_gene_symbol":"ATM","mutant_altered":28,"mutant_profiled":168,"mutant_pct":16.7,"wildtype_altered":19,"wildtype_profiled":398,"wildtype_pct":4.8,"pct_difference":11.9},{"hugo_gene_symbol":"MUC16","mutant_altered":84,"mutant_profiled":168,"mutant_pct":50,"wildtype_altered":158,"wildtype_profiled":398,"wildtype_pct":39.7,"pct_difference":10.3},{"hugo_gene_symbol":"NF1","mutant_altered":8,"mutant_profiled":168,"mutant_pct":4.8,"wildtype_altered":58,"wildtype_profiled":398,"wildtype_pct":14.6,"pct_difference":-9.8},{"hugo_gene_symbol":"CSMD1","mutant_altered":48,"mutant_profiled":168,"mutant_pct":28.6,"wildtype_altered":77,"wildtype_profiled":398,"wildtype_pct":19.3,"pct_difference":9.3},{"hugo_gene_symbol":"CNTNAP2","mutant_altered":32,"mutant_profiled":168,"mutant_pct":19,"wildtype_altered":39,"wildtype_profiled":398,"wildtype_pct":9.8,"pct_difference":9.2},{"hugo_gene_symbol":"RIMS2","mutant_altered":32,"mutant_profiled":168,"mutant_pct":19,"wildtype_altered":40,"wildtype_profiled":398,"wildtype_pct":10.1,"pct_difference":8.9},{"hugo_gene_symbol":"LRP1B","mutant_altered":69,"mutant_profiled":168,"mutant_pct":41.1,"wildtype_altered":132,"wildtype_profiled":398,"wildtype_pct":33.2,"pct_difference":7.9},{"hugo_gene_symbol":"LRRC7","mutant_altered":34,"mutant_profiled":168,"mutant_pct":20.2,"wildtype_altered":49,"wildtype_profiled":398,"wildtype_pct":12.3,"pct_difference":7.9},{"hugo_gene_symbol":"TNR","mutant_altered":19,"mutant_profiled":168,"mutant_pct":11.3,"wildtype_altered":76,"wildtype_profiled":398,"wildtype_pct":19.1,"pct_difference":-7.8},{"hugo_gene_symbol":"BRAF","mutant_altered":3,"mutant_profiled":168,"mutant_pct":1.8,"wildtype_altered":38,"wildtype_profiled":398,"wildtype_pct":9.5,"pct_difference":-7.7},{"hugo_gene_symbol":"RP1L1","mutant_altered":37,"mutant_profiled":168,"mutant_pct":22,"wildtype_altered":60,"wildtype_profiled":398,"wildtype_pct":15.1,"pct_difference":6.9},{"hugo_gene_symbol":"ZFHX4","mutant_altered":63,"mutant_profiled":168,"mutant_pct":37.5,"wildtype_altered":122,"wildtype_profiled":398,"wildtype_pct":30.7,"pct_difference":6.8},{"hugo_gene_symbol":"HECTD4","mutant_altered":18,"mutant_profiled":168,"mutant_pct":10.7,"wildtype_altered":16,"wildtype_profiled":398,"wildtype_pct":4,"pct_difference":6.7},{"hugo_gene_symbol":"KMT2C","mutant_altered":15,"mutant_profiled":168,"mutant_pct":8.9,"wildtype_altered":62,"wildtype_profiled":398,"wildtype_pct":15.6,"pct_difference":-6.7},{"hugo_gene_ … (513 more chars) ▶ resolve_and_route { "studyIds": [ "coadread_tcga_pan_can_atlas_2018", "luad_tcga_pan_can_atlas_2018" ] } ◀ result {"success":true,"message":"Found 2 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":2,"studiesWithMetadata":[{"studyId":"coadread_tcga_pan_can_atlas_2018","name":"Colorectal Adenocarcinoma (TCGA, PanCancer Atlas)","sampleCount":594,"studyViewUrl":"https://www.cbioportal.org/study?id=coadread_tcga_pan_can_atlas_2018","metadata":{"clinicalAttributeIds":["AGE","AJCC_PATHOLOGIC_TUMOR_STAGE","AJCC_STAGING_EDITION","ANEUPLOIDY_SCORE","BUFFA_HYPOXIA_SCORE","CANCER_TYPE","CANCER_TYPE_ACRONYM","CANCER_TYPE_DETAILED","DAYS_LAST_FOLLOWUP","DAYS_TO_BIRTH","DAYS_TO_INITIAL_PATHOLOGIC_DIAGNOSIS","DFS_MONTHS","DFS_STATUS","DSS_MONTHS","DSS_STATUS","ETHNICITY","FORM_COMPLETION_DATE","FRACTION_GENOME_ALTERED","GENETIC_ANCESTRY_LABEL","GRADE","HISTORY_NEOADJUVANT_TRTYN","ICD_10","ICD_O_3_HISTOLOGY","ICD_O_3_SITE","INFORMED_CONSENT_VERIFIED","IN_PANCANPATHWAYS_FREEZE","MSI_SCORE_MANTIS","MSI_SENSOR_SCORE","MUTATION_COUNT","NEW_TUMOR_EVENT_AFTER_INITIAL_TREATMENT","ONCOTREE_CODE","OS_MONTHS","OS_STATUS","OTHER_PATIENT_ID","PATH_M_STAGE","PATH_N_STAGE","PATH_T_STAGE","PERSON_NEOPLASM_CANCER_STATUS","PFS_MONTHS","PFS_STATUS","PRIMARY_LYMPH_NODE_PRESENTATION_ASSESSMENT","PRIOR_DX","RACE","RADIATION_THERAPY","RAGNUM_HYPOXIA_SCORE","SAMPLE_COUNT","SAMPLE_TYPE","SEX","SOMATIC_STATUS","SUBTYPE","TBL_SCORE","TISSUE_PROSPECTIVE_COLLECTION_INDICATOR","TISSUE_RETROSPECTIVE_COLLECTION_INDICATOR","TISSUE_SOURCE_SITE","TISSUE_SOURCE_SITE_CODE","TMB_NONSYNONYMOUS","TUMOR_TISSUE_SITE","TUMOR_TYPE","WEIGHT","WINTER_HYPOXIA_SCORE"],"molecularProfileIds":["coadread_tcga_pan_can_atlas_2018_gistic","coadread_tcga_pan_can_atlas_2018_log2CNA","coadread_tcga_pan_can_atlas_2018_mutations","coadread_tcga_pan_can_atlas_2018_protein_quantification","coadread_tcga_pan_can_atlas_2018_protein_quantification_zscores","coadread_tcga_pan_can_atlas_2018_rna_seq_v2_mrna","coadread_tcga_pan_can_atlas_2018_rna_seq_v2_mrna_median_Zscores","coadread_tcga_pan_can_atlas_2018_rna_seq_v2_mrna_median_all_sample_Zscores","coadread_tcga_pan_can_atlas_2018_rna_seq_v2_mrna_median_all_sample_ref_normal_Zscores","coadread_tcga_pan_can_atlas_2018_rppa","coadread_tcga_pan_can_atlas_2018_rppa_Zscores","coadread_tcga_pan_can_atlas_2018_structural_variants"],"genericAssayProfiles":["coadread_tcga_pan_can_atlas_2018_armlevel_cna","coadread_tcga_pan_can_atlas_2018_genetic_ancestry","coadread_tcga_pan_can_atlas_2018_methylation_hm27_hm450_merge","coadread_tcga_pan_can_atlas_2018_methylation_hm450"],"heatmapProfileIds":["coadread_tcga_pan_can_atlas_2018_protein_quantification_zscores","coadread_tcga_pan_can_atlas_2018_rna_seq_v2_mrna_median_Zscores","coadread_tcga_pan_can_atlas_2018_rna_seq_v2_mrna_median_all_sample_Zscores","coadread_tcga_pan_can_atlas_2018_rna_seq_v2_mrna_median_all_sample_ref_normal_Zscores","coadread_tcga_pan_can_atlas_2018_rp … (2852 more chars) ▶ navigate_to_results_view { "studyIds": [ "coadread_tcga_pan_can_atlas_2018" ], "genes": [ "KRAS", "APC", "PIK3CA", "BRAF", "TP53" ], "tab": "comparison/alterations", "comparisonSelectedGroups": [ "KRAS" ] } ◀ result {"success":true,"message":"Navigating to https://www.cbioportal.org/results/comparison/alterations?cancer_study_list=coadread_tcga_pan_can_atlas_2018&gene_list=KRAS%0AAPC%0APIK3CA%0ABRAF%0ATP53&case_set_id=coadread_tcga_pan_can_atlas_2018_all&comparison_selectedGroups=%5B%22KRAS%22%5D","url":"https://www.cbioportal.org/results/comparison/alterations?cancer_study_list=coadread_tcga_pan_can_atlas_2018&gene_list=KRAS%0AAPC%0APIK3CA%0ABRAF%0ATP53&case_set_id=coadread_tcga_pan_can_atlas_2018_all&comparison_selectedGroups=%5B%22KRAS%22%5D","data":{"studyIds":["coadread_tcga_pan_can_atlas_2018"],"studies":[{"studyId":"coadread_tcga_pan_can_atlas_2018","name":"Colorectal Adenocarcinoma (TCGA, PanCancer Atlas)","sampleCount":594}],"genes":["KRAS","APC","PIK3CA","BRAF","TP53"],"caseSetId":"coadread_tcga_pan_can_atlas_2018_all","pageDescription":"Genomic alteration rates compared across KRAS-altered."}} ▶ navigate_to_results_view { "studyIds": [ "luad_tcga_pan_can_atlas_2018" ], "genes": [ "KRAS", "TP53", "STK11", "EGFR", "ATM" ], "tab": "comparison/alterations", "comparisonSelectedGroups": [ "KRAS" ] } ◀ result {"success":true,"message":"Navigating to https://www.cbioportal.org/results/comparison/alterations?cancer_study_list=luad_tcga_pan_can_atlas_2018&gene_list=KRAS%0ATP53%0ASTK11%0AEGFR%0AATM&case_set_id=luad_tcga_pan_can_atlas_2018_all&comparison_selectedGroups=%5B%22KRAS%22%5D","url":"https://www.cbioportal.org/results/comparison/alterations?cancer_study_list=luad_tcga_pan_can_atlas_2018&gene_list=KRAS%0ATP53%0ASTK11%0AEGFR%0AATM&case_set_id=luad_tcga_pan_can_atlas_2018_all&comparison_selectedGroups=%5B%22KRAS%22%5D","data":{"studyIds":["luad_tcga_pan_can_atlas_2018"],"studies":[{"studyId":"luad_tcga_pan_can_atlas_2018","name":"Lung Adenocarcinoma (TCGA, PanCancer Atlas)","sampleCount":566}],"genes":["KRAS","TP53","STK11","EGFR","ATM"],"caseSetId":"luad_tcga_pan_can_atlas_2018_all","pageDescription":"Genomic alteration rates compared across KRAS-altered."}} ═ answer (success) Co-alteration patterns in KRAS-mutant tumors (mutation-only comparison, patient/sample counts are mutation-profiled samples), each from the **TCGA PanCancer Atlas** cohort, comparing KRAS-mutant vs KRAS-wild-type mutation rates: ## Colorectal Adenocarcinoma (COADREAD, n=594 samples; 218 KRAS-mutant / 316 wild-type profiled) | Gene | KRAS-mutant | KRAS-WT | Difference | |---|---|---|---| | **APC** | 182/218 (83.5%) | 205/316 (64.9%) | **+18.6 pts** (enriched with KRAS) | | **PIK3CA** | 83/218 (38.1%) | 64/316 (20.3%) | **+17.8 pts** (enriched with KRAS) | | **BRAF** | 6/218 (2.8%) | 56/316 (17.7%) | **−14.9 pts** (depleted — largely mutually exclusive, as expected since both activate the MAPK pathway) | | NRAS | 5/218 (2.3%) | 28/316 (8.9%) | −6.6 pts | APC and PIK3CA mutations co-occur with KRAS more often than in KRAS-wild-type tumors, while BRAF mutations are notably rarer in KRAS-mutant cases — consistent with both genes acting in the same RAS/MAPK pathway (mutual exclusivity here is a descriptive pattern, not a statistically tested claim). ## Lung Adenocarcinoma (LUAD, n=566 samples; 168 KRAS-mutant / 398 wild-type profiled) | Gene | KRAS-mutant | KRAS-WT | Difference | |---|---|---|---| | **STK11** | 38/168 (22.6%) | 37/398 (9.3%) | **+13.3 pts** (enriched with KRAS) | | **ATM** | 28/168 (16.7%) | 19/398 (4.8%) | **+11.9 pts** (enriched) | | TP53 | 62/168 (36.9%) | 233/398 (58.5%) | −21.6 pts (depleted) | | **EGFR** | 1/168 (0.6%) | 69/398 (17.3%) | **−16.7 pts** (largely mutually exclusive with KRAS, as expected — both are alternative RTK/RAS-pathway drivers) | STK11 (LKB1) and ATM co-mutation is notably enriched in KRAS-mutant LUAD (the STK11/KRAS co-mutant subgroup is a recognized molecular subtype in the literature, though I'm not asserting a clinical implication here). EGFR mutations are nearly absent in KRAS-mutant tumors, consistent with the general pattern of mutually exclusive oncogenic drivers. *Note: these are descriptive percentage-point differences in raw mutation frequency, not statistically tested co-occurrence/exclusivity (no p-values computed). Mutation-only — copy number and structural variants are excluded.* [View KRAS co-alterations — Colorectal Adenocarcinoma](https://www.cbioportal.org/results/comparison/alterations?cancer_study_list=coadread_tcga_pan_can_atlas_2018&gene_list=KRAS%0AAPC%0APIK3CA%0ABRAF%0ATP53&case_set_id=coadread_tcga_pan_can_atlas_2018_all&comparison_selectedGroups=%5B%22KRAS%22%5D) [View KRAS co-alterations — Lung Adenocarcinoma](https://www.cbioportal.org/results/comparison/alterations?cancer_study_list=luad_tcga_pan_can_atlas_2018&gene_list=KRAS%0ATP53%0ASTK11%0AEGFR%0AATM&case_set_id=luad_tcga_pan_can_atlas_2018_all&comparison_selectedGroups=%5B%22KRAS%22%5D) Both links open the Comparison/Alterations tab with the Altered (KRAS-mutant) group pre-selected against the Unaltered group, where you can run the formal mutual exclusivity/co-occurrence test.