Q (haiku): Which cancer types have the highest frequency of EGFR mutations across all TCGA Pan-Cancer Atlas studies? ▶ 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 … (35166 more chars) ▶ clickhouse_run_select_query { "query": " SELECT * FROM gene_mutation_frequency_by_cancer_type( preference = 'pan_cancer_tcga', gene = 'EGFR' ) ORDER BY frequency_pct DESC; ", "max_rows": 50 } ◀ result {"rows":[{"cancer_type":"Glioblastoma","altered_samples":94,"profiled_samples":397,"frequency_pct":23.7},{"cancer_type":"Non-Small Cell Lung Cancer","altered_samples":84,"profiled_samples":1050,"frequency_pct":8},{"cancer_type":"Melanoma","altered_samples":35,"profiled_samples":440,"frequency_pct":8},{"cancer_type":"Glioma","altered_samples":35,"profiled_samples":514,"frequency_pct":6.8},{"cancer_type":"Endometrial Cancer","altered_samples":36,"profiled_samples":574,"frequency_pct":6.3},{"cancer_type":"Esophagogastric Cancer","altered_samples":26,"profiled_samples":618,"frequency_pct":4.2},{"cancer_type":"Colorectal Cancer","altered_samples":15,"profiled_samples":534,"frequency_pct":2.8},{"cancer_type":"Head and Neck Cancer","altered_samples":13,"profiled_samples":515,"frequency_pct":2.5},{"cancer_type":"Cervical Cancer","altered_samples":7,"profiled_samples":291,"frequency_pct":2.4},{"cancer_type":"Adrenocortical Carcinoma","altered_samples":2,"profiled_samples":91,"frequency_pct":2.2},{"cancer_type":"Bladder Cancer","altered_samples":8,"profiled_samples":410,"frequency_pct":2},{"cancer_type":"Sarcoma","altered_samples":4,"profiled_samples":255,"frequency_pct":1.6},{"cancer_type":"Hepatobiliary Cancer","altered_samples":6,"profiled_samples":366,"frequency_pct":1.6},{"cancer_type":"Breast Cancer","altered_samples":15,"profiled_samples":1066,"frequency_pct":1.4},{"cancer_type":"Non-Seminomatous Germ Cell Tumor","altered_samples":1,"profiled_samples":86,"frequency_pct":1.2},{"cancer_type":"Ovarian Epithelial Tumor","altered_samples":6,"profiled_samples":523,"frequency_pct":1.1},{"cancer_type":"Leukemia","altered_samples":2,"profiled_samples":200,"frequency_pct":1},{"cancer_type":"Pancreatic Cancer","altered_samples":1,"profiled_samples":179,"frequency_pct":0.6},{"cancer_type":"Prostate Cancer","altered_samples":3,"profiled_samples":494,"frequency_pct":0.6},{"cancer_type":"Renal Clear Cell Carcinoma","altered_samples":2,"profiled_samples":402,"frequency_pct":0.5},{"cancer_type":"Renal Non-Clear Cell Carcinoma","altered_samples":1,"profiled_samples":341,"frequency_pct":0.3}]} ▶ resolve_and_route { "studyKeywords": [ "TCGA", "pan_cancer_atlas" ] } ◀ result {"success":false,"error":"No matching studies found","details":{"searchTerms":["TCGA","pan_cancer_atlas"]}} ▶ resolve_and_route { "studyKeywords": [ "TCGA", "pan" ] } ◀ result {"success":true,"message":"Found 36 matching studies (top 5 with full metadata, rest with basic info). 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":36,"studiesWithMetadata":[{"studyId":"pancan_pcawg_2020","name":"Pan-cancer analysis of whole genomes (ICGC/TCGA, Nature 2020)","sampleCount":2922,"studyViewUrl":"https://www.cbioportal.org/study?id=pancan_pcawg_2020","metadata":{"clinicalAttributeIds":["AGE","ALCOHOL","ALCOHOL_HISTORY_INTENSITY","ANCESTRY_PRIMARY","CANCER_TYPE","CANCER_TYPE_DETAILED","CELLULARITY","FIRST THERAPY_RESPONSE","FIRST_THERAPY","GRADE","HISTOLOGY","HISTOLOGY_ABBREVIATION","HISTOLOGY_TIER1","HISTOLOGY_TIER2","HISTOLOGY_TIER3","HISTOLOGY_TIER4","ICD_10","ICGC_SAMPLE_ID","MUTATION_COUNT","ONCOTREE_CODE","ORGAN_SYSTEM","OS_MONTHS","OS_STATUS","PLOIDY","PROJECT_CODE","PURITY","PURITY_CONFUGURATION","SAMPLE_CLASS","SAMPLE_COUNT","SAMPLE_TYPE","SEQUENCING_TYPE","SEX","STAGE","TBL_SCORE","TMB_NONSYNONYMOUS","TOBACCO_SMOKING_HISTORY_INDICATOR","TOBACCO_SMOKING_INTENSITY","TUMOR_SAMPLE_HISTOLOGY_CODE","WGD"],"molecularProfileIds":["pancan_pcawg_2020_cna","pancan_pcawg_2020_mirna","pancan_pcawg_2020_mirna_median_Zscores","pancan_pcawg_2020_mrna_seq_fpkm_capture","pancan_pcawg_2020_mrna_seq_fpkm_capture_all_sample_Zscores","pancan_pcawg_2020_mutations"],"genericAssayProfiles":["pancan_pcawg_2020_mutational_signatures_contribution_DBS","pancan_pcawg_2020_mutational_signatures_contribution_ID","pancan_pcawg_2020_mutational_signatures_contribution_SBS","pancan_pcawg_2020_mutational_signatures_counts_DBS","pancan_pcawg_2020_mutational_signatures_counts_ID","pancan_pcawg_2020_mutational_signatures_counts_SBS"],"heatmapProfileIds":["pancan_pcawg_2020_mirna_median_Zscores","pancan_pcawg_2020_mrna_seq_fpkm_capture_all_sample_Zscores"],"availableComparisonTabs":["overlap","clinical","survival","alterations","mutations","mrna","generic_assay_mutational_signature"]}},{"studyId":"nsclc_tcga_broad_2016","name":"Pan-Lung Cancer (TCGA, Nat Genet 2016)","sampleCount":1144,"studyViewUrl":"https://www.cbioportal.org/study?id=nsclc_tcga_broad_2016","metadata":{"clinicalAttributeIds":["AGE","AGE_AT_SURGERY","CANCER_TYPE","CANCER_TYPE_DETAILED","DAYS_TO_DEATH","DAYS_TO_LAST_FOLLOWUP","FRACTION_GENOME_ALTERED","HISTORY_NEOADJUVANT_TRTYN","HISTORY_OTHER_MALIGNANCY","MUTATION_COUNT","M_STAGE","N_STAGE","ONCOTREE_CODE","OS_MONTHS","OS_STATUS","SAMPLE_COUNT","SEX","SMOKING_HISTORY","SMOKING_PACK_YEARS","SOMATIC_STATUS","STAGE","TMB_NONSYNONYMOUS","T_STAGE"],"molecularProfileIds":["nsclc_tcga_broad_2016_cna","nsclc_tcga_broad_2016_mutations","nsclc_tcga_broad_2016_structural_variants"],"availableComparisonTabs":["overlap","clinical","survival","alterations","mutations"]}},{"studyId":"brca_tcga_pan_can_atlas_2018","name":"Breast Invasive Carcinoma (TCGA, PanCancer Atlas)","sampleCount":1084,"studyVi … (20825 more chars) ▶ navigate_to_results_view { "studyIds": [ "gbm_tcga_pan_can_atlas_2018", "luad_tcga_pan_can_atlas_2018", "skcm_tcga_pan_can_atlas_2018", "lgg_tcga_pan_can_atlas_2018", "ucec_tcga_pan_can_atlas_2018", "stad_tcga_pan_can_atlas_2018", "hnsc_tcga_pan_can_atlas_2018", "coadread_tcga_pan_can_atlas_2018", "kich_tcga_pan_can_atlas_2018", "acc_tcga_pan_can_atlas_2018", "blca_tcga_pan_can_atlas_2018", "lihc_tcga_pan_can_atlas_2018", "cesc_tcga_pan_can_atlas_2018", "kirc_tcga_pan_can_atlas_2018", "thca_tcga_pan_can_atlas_2018", "ov_tcga_pan_can_atlas_2018", "brca_tcga_pan_can_atlas_2018", "paad_tcga_pan_can_atlas_2018", "prad_tcga_pan_can_atlas_2018", "esca_tcga_pan_can_atlas_2018", "lusc_tcga_pan_can_atlas_2018", "kirp_tcga_pan_can_atlas_2018", "tgct_tcga_pan_can_atlas_2018", "sarc_tcga_pan_can_atlas_2018", "laml_tcga_pan_can_atlas_2018", "uvm_tcga_pan_can_atlas_2018", "pcpg_tcga_pan_can_atlas_2018", "thym_tcga_pan_can_atlas_2018", "meso_tcga_pan_can_atlas_2018", "ucs_tcga_pan_can_atlas_2018", "dlbc_tcga_pan_can_atlas_2018", "chol_tcga_pan_can_atlas_2018" ], "genes": [ "EGFR" ], "tab": "oncoprint" } ◀ result {"success":true,"message":"Navigating to https://www.cbioportal.org/results/oncoprint?cancer_study_list=gbm_tcga_pan_can_atlas_2018%2Cluad_tcga_pan_can_atlas_2018%2Cskcm_tcga_pan_can_atlas_2018%2Clgg_tcga_pan_can_atlas_2018%2Cucec_tcga_pan_can_atlas_2018%2Cstad_tcga_pan_can_atlas_2018%2Chnsc_tcga_pan_can_atlas_2018%2Ccoadread_tcga_pan_can_atlas_2018%2Ckich_tcga_pan_can_atlas_2018%2Cacc_tcga_pan_can_atlas_2018%2Cblca_tcga_pan_can_atlas_2018%2Clihc_tcga_pan_can_atlas_2018%2Ccesc_tcga_pan_can_atlas_2018%2Ckirc_tcga_pan_can_atlas_2018%2Cthca_tcga_pan_can_atlas_2018%2Cov_tcga_pan_can_atlas_2018%2Cbrca_tcga_pan_can_atlas_2018%2Cpaad_tcga_pan_can_atlas_2018%2Cprad_tcga_pan_can_atlas_2018%2Cesca_tcga_pan_can_atlas_2018%2Clusc_tcga_pan_can_atlas_2018%2Ckirp_tcga_pan_can_atlas_2018%2Ctgct_tcga_pan_can_atlas_2018%2Csarc_tcga_pan_can_atlas_2018%2Claml_tcga_pan_can_atlas_2018%2Cuvm_tcga_pan_can_atlas_2018%2Cpcpg_tcga_pan_can_atlas_2018%2Cthym_tcga_pan_can_atlas_2018%2Cmeso_tcga_pan_can_atlas_2018%2Cucs_tcga_pan_can_atlas_2018%2Cdlbc_tcga_pan_can_atlas_2018%2Cchol_tcga_pan_can_atlas_2018&gene_list=EGFR&case_set_id=all","url":"https://www.cbioportal.org/results/oncoprint?cancer_study_list=gbm_tcga_pan_can_atlas_2018%2Cluad_tcga_pan_can_atlas_2018%2Cskcm_tcga_pan_can_atlas_2018%2Clgg_tcga_pan_can_atlas_2018%2Cucec_tcga_pan_can_atlas_2018%2Cstad_tcga_pan_can_atlas_2018%2Chnsc_tcga_pan_can_atlas_2018%2Ccoadread_tcga_pan_can_atlas_2018%2Ckich_tcga_pan_can_atlas_2018%2Cacc_tcga_pan_can_atlas_2018%2Cblca_tcga_pan_can_atlas_2018%2Clihc_tcga_pan_can_atlas_2018%2Ccesc_tcga_pan_can_atlas_2018%2Ckirc_tcga_pan_can_atlas_2018%2Cthca_tcga_pan_can_atlas_2018%2Cov_tcga_pan_can_atlas_2018%2Cbrca_tcga_pan_can_atlas_2018%2Cpaad_tcga_pan_can_atlas_2018%2Cprad_tcga_pan_can_atlas_2018%2Cesca_tcga_pan_can_atlas_2018%2Clusc_tcga_pan_can_atlas_2018%2Ckirp_tcga_pan_can_atlas_2018%2Ctgct_tcga_pan_can_atlas_2018%2Csarc_tcga_pan_can_atlas_2018%2Claml_tcga_pan_can_atlas_2018%2Cuvm_tcga_pan_can_atlas_2018%2Cpcpg_tcga_pan_can_atlas_2018%2Cthym_tcga_pan_can_atlas_2018%2Cmeso_tcga_pan_can_atlas_2018%2Cucs_tcga_pan_can_atlas_2018%2Cdlbc_tcga_pan_can_atlas_2018%2Cchol_tcga_pan_can_atlas_2018&gene_list=EGFR&case_set_id=all","data":{"studyIds":["gbm_tcga_pan_can_atlas_2018","luad_tcga_pan_can_atlas_2018","skcm_tcga_pan_can_atlas_2018","lgg_tcga_pan_can_atlas_2018","ucec_tcga_pan_can_atlas_2018","stad_tcga_pan_can_atlas_2018","hnsc_tcga_pan_can_atlas_2018","coadread_tcga_pan_can_atlas_2018","kich_tcga_pan_can_atlas_2018","acc_tcga_pan_can_atlas_2018","blca_tcga_pan_can_atlas_2018","lihc_tcga_pan_can_atlas_2018","cesc_tcga_pan_can_atlas_2018","kirc_tcga_pan_can_atlas_2018","thca_tcga_pan_can_atlas_2018","ov_tcga_pan_can_atlas_2018","brca_tcga_pan_can_atlas_2018","paad_tcga_pan_can_atlas_2018","prad_tcga_pan_can_atlas_2018","esca_tcga_pan_can_atlas_2018","lusc_tcga_pan_can_atlas_2018","kirp_tcga_pan_can_atlas_2018","tgct_tcga_pan_can_atlas_2018","sarc_tcga_pan_can_atlas_2018","laml_tcga_pan_can_atlas_ … (4163 more chars) ═ answer (success) ## EGFR Mutation Frequency Across TCGA Pan-Cancer Atlas **Sample-level analysis** (counting altered samples profiled for EGFR in each cancer type). ### Top Cancer Types by EGFR Mutation Frequency | Cancer Type | EGFR Mutant Samples | Profiled Samples | Frequency | |---|---|---|---| | **Glioblastoma** | 94 | 397 | **23.7%** | | **Non-Small Cell Lung Cancer** | 84 | 1,050 | **8.0%** | | **Melanoma** | 35 | 440 | **8.0%** | | **Glioma** (Lower Grade) | 35 | 514 | **6.8%** | | **Endometrial Cancer** | 36 | 574 | **6.3%** | | **Esophagogastric Cancer** | 26 | 618 | **4.2%** | | **Colorectal Cancer** | 15 | 534 | **2.8%** | | **Head and Neck Cancer** | 13 | 515 | **2.5%** | **Key findings:** - **Glioblastoma leads by far** at 23.7% (94/397 samples), more than 3-fold higher than any other cancer type - **Non-Small Cell Lung Cancer (NSCLC)** and **Melanoma** tie at 8.0%, driven by large sample sizes (1,050 and 440 samples respectively) - **Lower-grade gliomas** show 6.8% frequency, consistent with CNS malignancies having elevated EGFR mutation rates - All other cancer types show EGFR mutation rates ≤ 4.2% --- ### Explore the Data [View EGFR mutations across TCGA Pan-Cancer Atlas (OncoPrint)](https://www.cbioportal.org/results/oncoprint?cancer_study_list=gbm_tcga_pan_can_atlas_2018%2Cluad_tcga_pan_can_atlas_2018%2Cskcm_tcga_pan_can_atlas_2018%2Clgg_tcga_pan_can_atlas_2018%2Cucec_tcga_pan_can_atlas_2018%2Cstad_tcga_pan_can_atlas_2018%2Chnsc_tcga_pan_can_atlas_2018%2Ccoadread_tcga_pan_can_atlas_2018%2Ckich_tcga_pan_can_atlas_2018%2Cacc_tcga_pan_can_atlas_2018%2Cblca_tcga_pan_can_atlas_2018%2Clihc_tcga_pan_can_atlas_2018%2Ccesc_tcga_pan_can_atlas_2018%2Ckirc_tcga_pan_can_atlas_2018%2Cthca_tcga_pan_can_atlas_2018%2Cov_tcga_pan_can_atlas_2018%2Cbrca_tcga_pan_can_atlas_2018%2Cpaad_tcga_pan_can_atlas_2018%2Cprad_tcga_pan_can_atlas_2018%2Cesca_tcga_pan_can_atlas_2018%2Clusc_tcga_pan_can_atlas_2018%2Ckirp_tcga_pan_can_atlas_2018%2Ctgct_tcga_pan_can_atlas_2018%2Csarc_tcga_pan_can_atlas_2018%2Claml_tcga_pan_can_atlas_2018%2Cuvm_tcga_pan_can_atlas_2018%2Cpcpg_tcga_pan_can_atlas_2018%2Cthym_tcga_pan_can_atlas_2018%2Cmeso_tcga_pan_can_atlas_2018%2Cucs_tcga_pan_can_atlas_2018%2Cdlbc_tcga_pan_can_atlas_2018%2Cchol_tcga_pan_can_atlas_2018&gene_list=EGFR&case_set_id=all) — Visual summary of EGFR mutations in the OncoPrint.