Q (sonnet): Which genes are enriched for mutations between NSCLC vs squamous cell carcinoma? ▶ 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://statistical-tests-guide" } ▶ search_oncotree { "search_term": "squamous cell carcinoma lung" } ◀ result Statistical Test Selection Guide ================================ Purpose ------- This guide ensures the correct statistical test is selected before performing any group comparison, matching cBioPortal's own Group Comparison defaults. HARD RULES — NEVER FABRICATE A STATISTIC ---------------------------------------- ClickHouse cannot run statistical tests. The agent therefore must NEVER produce a derived statistic that is not a literal column value from a SQL result. Specifically: 1. **Never invent a p-value.** Not "p < 0.001", not "p ≈ 0.05", not any p-value. If the user asks "what is the p-value?", the answer is *"I can't compute that — here is the 2x2 contingency table (or group statistics). Run it in cBioPortal's Group Comparison tab, in R with `fisher.test(...)` / `wilcox.test(...)`, or in Python with `scipy.stats.fisher_exact(...)` / `mannwhitneyu(...)`."* 2. **Never claim mutual exclusivity (or co-occurrence) from a contingency table alone.** A 2x2 table is not a test. The shape "altered/not altered × group A/group B" needs Fisher's exact + a defined direction (odds ratio < 1 with significant p). Without that test, the agent presents the table and stops. Descriptive phrasing is also a claim: "largely/mostly mutually exclusive", "rarely co-occur", "tend to co-occur" are forbidden without the test — point to cBioPortal's Mutual Exclusivity tab instead. 3. **Never report a "median" that came from `AVG(...)` or any non-median aggregate.** "Median" and "mean" are different statistics; for skewed clinical distributions (especially survival) they differ substantially. Use ClickHouse's `quantile(0.5)(...)` for actual median, and label arithmetic averages as "mean", never "median". 4. **Never report a hazard ratio, odds ratio, risk ratio, or relative risk** that wasn't computed by an external tool. These require regression / model fitting that ClickHouse does not do. 5. **Never report median overall survival from `AVG(OS_MONTHS)` or even `quantile(0.5)(OS_MONTHS)`.** Median OS requires Kaplan-Meier estimation, which handles censoring (`OS_STATUS = 0:LIVING` means the event hasn't happened yet). Naive medians/means over `OS_MONTHS` ignore censoring and are systematically wrong. The correct handoff: return the raw `(OS_MONTHS, OS_STATUS)` pairs (or descriptive counts: N events, N censored, follow-up range) and tell the user to run KM in R (`survival::survfit`) or Python (`lifelines.KaplanMeierFitter`), or use cBioPortal's Survival comparison. If asked to do any of (1)–(5), respond with the appropriate handoff template from the "Approved Response Templates" section below — do not produce the number. Ambiguous-Term Clarification (before any analysis) -------------------------------------------------- If the user's question uses an ambiguous term, ask before computing anything. Examples: - **"aggressive"** → could mean shorter overall survival, higher metastasis rate, higher grade/stage, higher TMB, or specific molecular features. Ask which definit … (9984 more chars) ◀ result {"result":[{"code":"LUAS","name":"Lung Adenosquamous Carcinoma","score":55,"mainType":"Non-Small Cell Lung Cancer","tissue":"Lung","hierarchy":"LUNG > NSCLC > LUAS"},{"code":"LUSC","name":"Lung Squamous Cell Carcinoma","score":55,"mainType":"Non-Small Cell Lung Cancer","tissue":"Lung","hierarchy":"LUNG > NSCLC > LUSC"}]} ▶ read_guide { "uri": "cbioportal://mutation-frequency-guide" } ▶ list_studies { "search": "lung", "limit": 30 } ◀ 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 {"result":[{"cancer_study_identifier":"msk_met_2021","name":"MSK MetTropism (MSK, Cell 2021)","type_of_cancer_id":"mixed","sample_count":25775,"has_guide":false,"url":"https://www.cbioportal.org/study/summary?id=msk_met_2021"},{"cancer_study_identifier":"luad_mskcc_2023_met_organotropism","name":"Lung Adenocarcinoma Met Organotropism (MSK, Cancer Cell 2023)","type_of_cancer_id":"luad","sample_count":2653,"has_guide":false,"url":"https://www.cbioportal.org/study/summary?id=luad_mskcc_2023_met_organotropism"},{"cancer_study_identifier":"nsclc_ctdx_msk_2022","name":"Metastatic Non-Small Cell Lung Cancer (MSK, Nature Medicine 2022)","type_of_cancer_id":"nsclc","sample_count":2621,"has_guide":false,"url":"https://www.cbioportal.org/study/summary?id=nsclc_ctdx_msk_2022"},{"cancer_study_identifier":"nsclc_tcga_broad_2016","name":"Pan-Lung Cancer (TCGA, Nat Genet 2016)","type_of_cancer_id":"nsclc","sample_count":1144,"has_guide":false,"url":"https://www.cbioportal.org/study/summary?id=nsclc_tcga_broad_2016"},{"cancer_study_identifier":"lung_msk_2017","name":"Non-Small Cell Cancer (MSK, Cancer Discov 2017)","type_of_cancer_id":"luad","sample_count":915,"has_guide":false,"url":"https://www.cbioportal.org/study/summary?id=lung_msk_2017"},{"cancer_study_identifier":"luad_mskcc_2020","name":"Lung Adenocarcinoma (MSK, J Thorac Oncol 2020)","type_of_cancer_id":"luad","sample_count":604,"has_guide":false,"url":"https://www.cbioportal.org/study/summary?id=luad_mskcc_2020"},{"cancer_study_identifier":"luad_tcga","name":"Lung Adenocarcinoma (TCGA, Firehose Legacy)","type_of_cancer_id":"luad","sample_count":586,"has_guide":false,"url":"https://www.cbioportal.org/study/summary?id=luad_tcga"},{"cancer_study_identifier":"luad_tcga_gdc","name":"Lung Adenocarcinoma (TCGA GDC, 2025)","type_of_cancer_id":"luad","sample_count":571,"has_guide":false,"url":"https://www.cbioportal.org/study/summary?id=luad_tcga_gdc"},{"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"},{"cancer_study_identifier":"lusc_tcga","name":"Lung Squamous Cell Carcinoma (TCGA, Firehose Legacy)","type_of_cancer_id":"lusc","sample_count":511,"has_guide":false,"url":"https://www.cbioportal.org/study/summary?id=lusc_tcga"},{"cancer_study_identifier":"lusc_tcga_gdc","name":"Lung Squamous Cell Carcinoma (TCGA GDC, 2025)","type_of_cancer_id":"lusc","sample_count":503,"has_guide":false,"url":"https://www.cbioportal.org/study/summary?id=lusc_tcga_gdc"},{"cancer_study_identifier":"lusc_tcga_pan_can_atlas_2018","name":"Lung Squamous Cell Carcinoma (TCGA, PanCancer Atlas)","type_of_cancer_id":"lusc","sample_count":487,"has_guide":false,"url":"https://www.cbioportal.org/study/summary?id=lusc_tcga_pan_can_atlas_2018"},{"cancer_study_identifier":"nsclc_tracerx_2017","name":"Non-Small Cell Lung Cancer (TRACERx, NEJM & N … (4121 more chars) ▶ clickhouse_run_select_query { "query": "SELECT attribute_value, COUNT(DISTINCT sample_unique_id) AS n FROM clinical_data_derived WHERE cancer_study_identifier = 'nsclc_tcga_broad_2016' AND attribute_name IN ('CANCER_TYPE', 'CANCER_TYPE_DETAILED') GROUP BY attribute_value ORDER BY n DESC" } ◀ result {"rows":[{"attribute_value":"Non-Small Cell Lung Cancer","n":1144},{"attribute_value":"Lung Adenocarcinoma","n":660},{"attribute_value":"Lung Squamous Cell Carcinoma","n":484}]} ▶ clickhouse_run_select_query { "query": " WITH sample_hist AS ( SELECT sample_unique_id, attribute_value AS histology FROM clinical_data_derived WHERE cancer_study_identifier = 'nsclc_tcga_broad_2016' AND attribute_name = 'CANCER_TYPE_DETAILED' AND attribute_value IN ('Lung Adenocarcinoma', 'Lung Squamous Cell Carcinoma') ), altered AS ( SELECT sh.histology, ged.hugo_gene_symbol, COUNT(DISTINCT ged.sample_unique_id) AS altered_samples FROM genomic_event_derived ged JOIN sample_hist sh USING (sample_unique_id) WHERE ged.cancer_study_identifier = 'nsclc_tcga_broad_2016' AND ged.variant_type = 'mutation' AND ged.mutation_status != 'UNCALLED' AND ged.off_panel = 0 GROUP BY sh.histology, ged.hugo_gene_symbol ), profiled AS ( SELECT histology, COUNT(DISTINCT sample_unique_id) AS profiled_samples FROM sample_hist sh JOIN sample_to_gene_panel_derived stgp USING (sample_unique_id) WHERE stgp.cancer_study_identifier = 'nsclc_tcga_broad_2016' AND stgp.alteration_type = 'MUTATION_EXTENDED' GROUP BY histology ) SELECT a.hugo_gene_symbol, sumIf(a.altered_samples, a.histology='Lung Squamous Cell Carcinoma') AS lusc_altered, maxIf(p.profiled_samples, p.histology='Lung Squamous Cell Carcinoma') AS lusc_profiled, sumIf(a.altered_samples, a.histology='Lung Adenocarcinoma') AS luad_altered, maxIf(p.profiled_samples, p.histology='Lung Adenocarcinoma') AS luad_profiled FROM altered a JOIN profiled p USING (histology) GROUP BY a.hugo_gene_symbol HAVING (lusc_altered + luad_altered) >= 20 ORDER BY (lusc_altered*100.0/lusc_profiled) - (luad_altered*100.0/luad_profiled) DESC LIMIT 25 " } ◀ result {"rows":[{"hugo_gene_symbol":"TP53","lusc_altered":418,"lusc_profiled":484,"luad_altered":357,"luad_profiled":660},{"hugo_gene_symbol":"TTN","lusc_altered":357,"lusc_profiled":484,"luad_altered":325,"luad_profiled":660},{"hugo_gene_symbol":"SYNE1","lusc_altered":158,"lusc_profiled":484,"luad_altered":95,"luad_profiled":660},{"hugo_gene_symbol":"KMT2D","lusc_altered":114,"lusc_profiled":484,"luad_altered":49,"luad_profiled":660},{"hugo_gene_symbol":"NFE2L2","lusc_altered":70,"lusc_profiled":484,"luad_altered":14,"luad_profiled":660},{"hugo_gene_symbol":"CDKN2A","lusc_altered":75,"lusc_profiled":484,"luad_altered":27,"luad_profiled":660},{"hugo_gene_symbol":"PTEN","lusc_altered":56,"lusc_profiled":484,"luad_altered":11,"luad_profiled":660},{"hugo_gene_symbol":"FAM135B","lusc_altered":121,"lusc_profiled":484,"luad_altered":102,"luad_profiled":660},{"hugo_gene_symbol":"LRRK2","lusc_altered":67,"lusc_profiled":484,"luad_altered":37,"luad_profiled":660},{"hugo_gene_symbol":"ATP10A","lusc_altered":48,"lusc_profiled":484,"luad_altered":20,"luad_profiled":660},{"hugo_gene_symbol":"DNAH8","lusc_altered":86,"lusc_profiled":484,"luad_altered":76,"luad_profiled":660},{"hugo_gene_symbol":"DNAH5","lusc_altered":94,"lusc_profiled":484,"luad_altered":87,"luad_profiled":660},{"hugo_gene_symbol":"SCN1A","lusc_altered":62,"lusc_profiled":484,"luad_altered":45,"luad_profiled":660},{"hugo_gene_symbol":"DNAH7","lusc_altered":78,"lusc_profiled":484,"luad_altered":67,"luad_profiled":660},{"hugo_gene_symbol":"PKHD1L1","lusc_altered":92,"lusc_profiled":484,"luad_altered":87,"luad_profiled":660},{"hugo_gene_symbol":"PIK3CA","lusc_altered":55,"lusc_profiled":484,"luad_altered":39,"luad_profiled":660},{"hugo_gene_symbol":"ADGRV1","lusc_altered":77,"lusc_profiled":484,"luad_altered":70,"luad_profiled":660},{"hugo_gene_symbol":"HCN1","lusc_altered":80,"lusc_profiled":484,"luad_altered":75,"luad_profiled":660},{"hugo_gene_symbol":"PLCH1","lusc_altered":45,"lusc_profiled":484,"luad_altered":28,"luad_profiled":660},{"hugo_gene_symbol":"NCAM2","lusc_altered":48,"lusc_profiled":484,"luad_altered":34,"luad_profiled":660},{"hugo_gene_symbol":"CSMD3","lusc_altered":215,"lusc_profiled":484,"luad_altered":262,"luad_profiled":660},{"hugo_gene_symbol":"ZNF804B","lusc_altered":72,"lusc_profiled":484,"luad_altered":67,"luad_profiled":660},{"hugo_gene_symbol":"OR4C12","lusc_altered":35,"lusc_profiled":484,"luad_altered":17,"luad_profiled":660},{"hugo_gene_symbol":"PKHD1","lusc_altered":87,"lusc_profiled":484,"luad_altered":88,"luad_profiled":660},{"hugo_gene_symbol":"RIMS1","lusc_altered":45,"lusc_profiled":484,"luad_altered":31,"luad_profiled":660}]} ▶ clickhouse_run_select_query { "query": " WITH sample_hist AS ( SELECT sample_unique_id, attribute_value AS histology FROM clinical_data_derived WHERE cancer_study_identifier = 'nsclc_tcga_broad_2016' AND attribute_name = 'CANCER_TYPE_DETAILED' AND attribute_value IN ('Lung Adenocarcinoma', 'Lung Squamous Cell Carcinoma') ), altered AS ( SELECT sh.histology, ged.hugo_gene_symbol, COUNT(DISTINCT ged.sample_unique_id) AS altered_samples FROM genomic_event_derived ged JOIN sample_hist sh USING (sample_unique_id) WHERE ged.cancer_study_identifier = 'nsclc_tcga_broad_2016' AND ged.variant_type = 'mutation' AND ged.mutation_status != 'UNCALLED' AND ged.off_panel = 0 GROUP BY sh.histology, ged.hugo_gene_symbol ), profiled AS ( SELECT histology, COUNT(DISTINCT sample_unique_id) AS profiled_samples FROM sample_hist sh JOIN sample_to_gene_panel_derived stgp USING (sample_unique_id) WHERE stgp.cancer_study_identifier = 'nsclc_tcga_broad_2016' AND stgp.alteration_type = 'MUTATION_EXTENDED' GROUP BY histology ) SELECT a.hugo_gene_symbol, sumIf(a.altered_samples, a.histology='Lung Squamous Cell Carcinoma') AS lusc_altered, maxIf(p.profiled_samples, p.histology='Lung Squamous Cell Carcinoma') AS lusc_profiled, sumIf(a.altered_samples, a.histology='Lung Adenocarcinoma') AS luad_altered, maxIf(p.profiled_samples, p.histology='Lung Adenocarcinoma') AS luad_profiled FROM altered a JOIN profiled p USING (histology) GROUP BY a.hugo_gene_symbol HAVING (lusc_altered + luad_altered) >= 20 ORDER BY (luad_altered*100.0/luad_profiled) - (lusc_altered*100.0/lusc_profiled) DESC LIMIT 15 " } ◀ result {"rows":[{"hugo_gene_symbol":"KRAS","lusc_altered":8,"lusc_profiled":484,"luad_altered":214,"luad_profiled":660},{"hugo_gene_symbol":"STK11","lusc_altered":7,"lusc_profiled":484,"luad_altered":104,"luad_profiled":660},{"hugo_gene_symbol":"EGFR","lusc_altered":13,"lusc_profiled":484,"luad_altered":104,"luad_profiled":660},{"hugo_gene_symbol":"RP1L1","lusc_altered":38,"lusc_profiled":484,"luad_altered":118,"luad_profiled":660},{"hugo_gene_symbol":"PTPRD","lusc_altered":34,"lusc_profiled":484,"luad_altered":107,"luad_profiled":660},{"hugo_gene_symbol":"MXRA5","lusc_altered":34,"lusc_profiled":484,"luad_altered":107,"luad_profiled":660},{"hugo_gene_symbol":"PLPPR4","lusc_altered":13,"lusc_profiled":484,"luad_altered":73,"luad_profiled":660},{"hugo_gene_symbol":"SNTG1","lusc_altered":20,"lusc_profiled":484,"luad_altered":76,"luad_profiled":660},{"hugo_gene_symbol":"OBSCN","lusc_altered":51,"lusc_profiled":484,"luad_altered":116,"luad_profiled":660},{"hugo_gene_symbol":"TENM2","lusc_altered":18,"lusc_profiled":484,"luad_altered":70,"luad_profiled":660},{"hugo_gene_symbol":"FBN2","lusc_altered":46,"lusc_profiled":484,"luad_altered":108,"luad_profiled":660},{"hugo_gene_symbol":"ASXL3","lusc_altered":38,"lusc_profiled":484,"luad_altered":97,"luad_profiled":660},{"hugo_gene_symbol":"FAT3","lusc_altered":75,"lusc_profiled":484,"luad_altered":147,"luad_profiled":660},{"hugo_gene_symbol":"HRNR","lusc_altered":32,"lusc_profiled":484,"luad_altered":88,"luad_profiled":660},{"hugo_gene_symbol":"XIRP2","lusc_altered":95,"lusc_profiled":484,"luad_altered":173,"luad_profiled":660}]} ▶ resolve_and_route { "studyIds": [ "nsclc_tcga_broad_2016" ] } ◀ result {"success":true,"message":"Found 1 study. Use the metadata to call the appropriate navigation tool(s).","data":{"totalCount":1,"studiesWithMetadata":[{"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"]}}]}} ▶ navigate_to_group_comparison { "studyIds": [ "nsclc_tcga_broad_2016" ], "groups": [ { "name": "Lung Squamous Cell Carcinoma", "studyViewFilter": { "clinicalDataFilters": [ { "attributeId": "CANCER_TYPE_DETAILED", "values": [ { "value": "Lung Squamous Cell Carcinoma" } ] } ] } }, { "name": "Lung Adenocarcinoma (non-squamous NSCLC)", "studyViewFilter": { "clinicalDataFilters": [ { "attributeId": "CANCER_TYPE_DETAILED", "values": [ { "value": "Lung Adenocarcinoma" } ] } ] } } ], "tab": "mutations" } ◀ result {"success":true,"message":"Navigating to https://www.cbioportal.org/comparison/mutations?comparisonId=6ab5ca3be497aad53593c278","url":"https://www.cbioportal.org/comparison/mutations?comparisonId=6ab5ca3be497aad53593c278","data":{"description":"Group comparison (2 custom groups)","studies":["nsclc_tcga_broad_2016"],"totalGroups":2,"groups":[{"name":"Lung Squamous Cell Carcinoma","sampleCount":484},{"name":"Lung Adenocarcinoma (non-squamous NSCLC)","sampleCount":660}],"studyViewUrl":"https://www.cbioportal.org/study?id=nsclc_tcga_broad_2016","groupUrls":[{"groupName":"Lung Squamous Cell Carcinoma","url":"https://www.cbioportal.org/study?id=nsclc_tcga_broad_2016#filterJson=%7B%22clinicalDataFilters%22%3A%5B%7B%22attributeId%22%3A%22CANCER_TYPE_DETAILED%22%2C%22values%22%3A%5B%7B%22value%22%3A%22Lung%20Squamous%20Cell%20Carcinoma%22%7D%5D%7D%5D%7D"},{"groupName":"Lung Adenocarcinoma (non-squamous NSCLC)","url":"https://www.cbioportal.org/study?id=nsclc_tcga_broad_2016#filterJson=%7B%22clinicalDataFilters%22%3A%5B%7B%22attributeId%22%3A%22CANCER_TYPE_DETAILED%22%2C%22values%22%3A%5B%7B%22value%22%3A%22Lung%20Adenocarcinoma%22%7D%5D%7D%5D%7D"}],"pageDescription":"Mutation frequency (protein change) compared across Lung Squamous Cell Carcinoma (484) vs Lung Adenocarcinoma (non-squamous NSCLC) (660)."}} ▶ navigate_to_results_view { "studyIds": [ "nsclc_tcga_broad_2016" ], "genes": [ "TP53", "SYNE1", "KMT2D", "NFE2L2", "CDKN2A", "PTEN", "KRAS", "STK11", "EGFR", "PTPRD" ], "tab": "oncoprint", "oncoprintClinicalTracks": [ "CANCER_TYPE_DETAILED" ] } ◀ result {"success":true,"message":"Navigating to https://www.cbioportal.org/results/oncoprint?cancer_study_list=nsclc_tcga_broad_2016&gene_list=TP53%0ASYNE1%0AKMT2D%0ANFE2L2%0ACDKN2A%0APTEN%0AKRAS%0ASTK11%0AEGFR%0APTPRD&case_set_id=nsclc_tcga_broad_2016_all&clinicallist=CANCER_TYPE_DETAILED","url":"https://www.cbioportal.org/results/oncoprint?cancer_study_list=nsclc_tcga_broad_2016&gene_list=TP53%0ASYNE1%0AKMT2D%0ANFE2L2%0ACDKN2A%0APTEN%0AKRAS%0ASTK11%0AEGFR%0APTPRD&case_set_id=nsclc_tcga_broad_2016_all&clinicallist=CANCER_TYPE_DETAILED","data":{"studyIds":["nsclc_tcga_broad_2016"],"studies":[{"studyId":"nsclc_tcga_broad_2016","name":"Pan-Lung Cancer (TCGA, Nat Genet 2016)","sampleCount":1144}],"genes":["TP53","SYNE1","KMT2D","NFE2L2","CDKN2A","PTEN","KRAS","STK11","EGFR","PTPRD"],"caseSetId":"nsclc_tcga_broad_2016_all","pageDescription":"Visual summary of alterations in queried genes across samples."}} ═ answer (success) ## Framing the comparison "NSCLC" and "squamous cell carcinoma" aren't independent categories — LUSC is a histologic *subtype* of NSCLC (the other major subtype being LUAD, adenocarcinoma). I interpreted this as **LUSC vs. non-squamous NSCLC (LUAD)**, using the **Pan-Lung Cancer (TCGA, Nat Genet 2016)** cohort (`nsclc_tcga_broad_2016`), which contains both histologies in one non-overlapping WES cohort: 484 LUSC samples, 660 LUAD samples. I can't compute p-values in ClickHouse (Fisher's exact test is required for 2×2 alteration tables — no test was run here), but below are the mutation-frequency contingency counts, split by direction of enrichment. ### Genes more frequently mutated in LUSC than LUAD | Gene | LUSC altered/profiled (%) | LUAD altered/profiled (%) | |---|---|---| | NFE2L2 | 70/484 (14.5%) | 14/660 (2.1%) | | PTEN | 56/484 (11.6%) | 11/660 (1.7%) | | CDKN2A | 75/484 (15.5%) | 27/660 (4.1%) | | KMT2D | 114/484 (23.6%) | 49/660 (7.4%) | | SYNE1 | 158/484 (32.6%) | 95/660 (14.4%) | | TP53 | 418/484 (86.4%) | 357/660 (54.1%) | ### Genes more frequently mutated in LUAD than LUSC | Gene | LUAD altered/profiled (%) | LUSC altered/profiled (%) | |---|---|---| | KRAS | 214/660 (32.4%) | 8/484 (1.7%) | | STK11 | 104/660 (15.8%) | 7/484 (1.4%) | | EGFR | 104/660 (15.8%) | 13/484 (2.7%) | | PTPRD | 107/660 (16.2%) | 34/484 (7.0%) | These are frequency differences, not statistical enrichment — Fisher's exact test (two-tailed) is the appropriate test for each 2×2 table (altered/unaltered × LUSC/LUAD), given ≥2 groups and binary alteration status. Note: mutation frequency does not imply oncogenic driver status; several of the LUSC-side hits (TTN, SYNE1, DNAH5/7/8) are large, passenger-prone genes and their frequency likely reflects gene size rather than selection — TP53, CDKN2A, NFE2L2, and PTEN are the more biologically established squamous-associated genes, while KRAS, EGFR, and STK11 are the well-established LUAD drivers. To get the actual p-values, use cBioPortal's built-in Group Comparison → Mutations tab, or run `scipy.stats.fisher_exact` / R `fisher.test` on the counts above. ### Links [Group Comparison: LUSC vs. LUAD — Mutations tab](https://www.cbioportal.org/comparison/mutations?comparisonId=6ab5ca3be497aad53593c278) Mutation frequency (protein change) compared across Lung Squamous Cell Carcinoma (484) vs Lung Adenocarcinoma/non-squamous NSCLC (660). This tab computes the Fisher's exact/enrichment statistics directly. [OncoPrint: Top differential genes across the Pan-Lung cohort](https://www.cbioportal.org/results/oncoprint?cancer_study_list=nsclc_tcga_broad_2016&gene_list=TP53%0ASYNE1%0AKMT2D%0ANFE2L2%0ACDKN2A%0APTEN%0AKRAS%0ASTK11%0AEGFR%0APTPRD&case_set_id=nsclc_tcga_broad_2016_all&clinicallist=CANCER_TYPE_DETAILED) Visual summary of TP53, SYNE1, KMT2D, NFE2L2, CDKN2A, PTEN, KRAS, STK11, EGFR, PTPRD alterations across all 1,144 samples, annotated by histologic subtype (CANCER_TYPE_DETAILED track).