Q (sonnet): What are the key genomic differences between lung adenocarcinomas and squamous cell carcinomas identified in the Pan-Lung Cancer TCGA study? ▶ 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"}]} ▶ get_study_guide { "study_id": "nsclc_tcga_broad_2016" } ▶ list_studies { "search": "pan-lung" } ◀ result # Study Guide: Pan-Lung Cancer (TCGA, Nat Genet 2016) **Study ID:** `nsclc_tcga_broad_2016` **Cancer Type:** nsclc **Description:** Whole-exome sequencing of 660 lung ADC and 484 lung SqCC tumor/normal pairs. ## Cohort Statistics - **Patients:** 1,144 - **Samples:** 1,145 ## Available Data Types - **COPY_NUMBER_ALTERATION**: Putative copy-number alterations - **MUTATION_EXTENDED**: Somatic mutations - **STRUCTURAL_VARIANT**: Structural variants ## Gene Panels - **WES** (Whole Exome): 1,144 samples — all genes profiled ## Available Clinical Attributes | Attribute | Samples with Data | |-----------|------------------| | CANCER_TYPE_DETAILED | 1,144 | | MUTATION_COUNT | 1,144 | | SOMATIC_STATUS | 1,144 | | FRACTION_GENOME_ALTERED | 1,144 | | TMB_NONSYNONYMOUS | 1,144 | | ONCOTREE_CODE | 1,144 | | T_STAGE | 1,144 | | CANCER_TYPE | 1,144 | | OS_MONTHS | 1 | | DAYS_TO_DEATH | 1 | | SMOKING_HISTORY | 1 | | DAYS_TO_LAST_FOLLOWUP | 1 | | SEX | 1 | | HISTORY_OTHER_MALIGNANCY | 1 | | STAGE | 1 | | SMOKING_PACK_YEARS | 1 | | HISTORY_NEOADJUVANT_TRTYN | 1 | | SAMPLE_COUNT | 1 | | AGE | 1 | | AGE_AT_SURGERY | 1 | ## Top Mutated Genes | Gene | Altered Samples | |------|----------------| | TP53 | 775 | | TTN | 682 | | CSMD3 | 477 | | MUC16 | 463 | | RYR2 | 448 | | LRP1B | 402 | | USH2A | 390 | | ZFHX4 | 356 | | SPTA1 | 284 | | XIRP2 | 268 | ## Query Tips for nsclc_tcga_broad_2016 ```sql -- Get all samples in this study SELECT DISTINCT sample_unique_id, patient_unique_id FROM clinical_data_derived WHERE cancer_study_identifier = 'nsclc_tcga_broad_2016'; -- Get mutations for a specific gene SELECT sample_unique_id, hugo_gene_symbol, mutation_variant, mutation_type FROM genomic_event_derived WHERE cancer_study_identifier = 'nsclc_tcga_broad_2016' AND hugo_gene_symbol = 'TP53' AND variant_type = 'mutation'; -- Get clinical data for specific attributes SELECT sample_unique_id, attribute_name, attribute_value FROM clinical_data_derived WHERE cancer_study_identifier = 'nsclc_tcga_broad_2016' AND attribute_name IN ('CANCER_TYPE', 'SAMPLE_TYPE', 'OS_MONTHS'); ``` ◀ result {"result":[{"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":"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_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_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"}]} ▶ read_guide { "uri": "cbioportal://mutation-frequency-guide" } ▶ clickhouse_list_table_columns { "table": "genomic_event_derived" } ◀ 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 {"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": " WITH samp 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' ), mut AS ( SELECT s.histology, g.hugo_gene_symbol, COUNT(DISTINCT g.sample_unique_id) AS altered FROM genomic_event_derived g JOIN samp s USING (sample_unique_id) WHERE g.cancer_study_identifier = 'nsclc_tcga_broad_2016' AND g.variant_type = 'mutation' AND g.mutation_status != 'UNCALLED' AND g.off_panel = 0 AND g.hugo_gene_symbol IN ('TP53','KRAS','EGFR','STK11','KEAP1','NFE2L2','PIK3CA','PTEN','CDKN2A','NOTCH1','RB1','SMARCA4','ARID1A','SETD2','MET','BRAF','U2AF1','RBM10') GROUP BY s.histology, g.hugo_gene_symbol ), tot AS ( SELECT histology, COUNT(DISTINCT sample_unique_id) AS n FROM samp GROUP BY histology ) SELECT m.histology, m.hugo_gene_symbol, m.altered, t.n, round(m.altered*100.0/t.n,1) AS pct FROM mut m JOIN tot t USING (histology) ORDER BY hugo_gene_symbol, histology " } ◀ result {"rows":[{"histology":"Non-Small Cell Lung Cancer","hugo_gene_symbol":"ARID1A","altered":80,"n":1144,"pct":7},{"histology":"Non-Small Cell Lung Cancer","hugo_gene_symbol":"BRAF","altered":70,"n":1144,"pct":6.1},{"histology":"Non-Small Cell Lung Cancer","hugo_gene_symbol":"CDKN2A","altered":102,"n":1144,"pct":8.9},{"histology":"Non-Small Cell Lung Cancer","hugo_gene_symbol":"EGFR","altered":117,"n":1144,"pct":10.2},{"histology":"Non-Small Cell Lung Cancer","hugo_gene_symbol":"KEAP1","altered":162,"n":1144,"pct":14.2},{"histology":"Non-Small Cell Lung Cancer","hugo_gene_symbol":"KRAS","altered":222,"n":1144,"pct":19.4},{"histology":"Non-Small Cell Lung Cancer","hugo_gene_symbol":"MET","altered":34,"n":1144,"pct":3},{"histology":"Non-Small Cell Lung Cancer","hugo_gene_symbol":"NFE2L2","altered":84,"n":1144,"pct":7.3},{"histology":"Non-Small Cell Lung Cancer","hugo_gene_symbol":"NOTCH1","altered":71,"n":1144,"pct":6.2},{"histology":"Non-Small Cell Lung Cancer","hugo_gene_symbol":"PIK3CA","altered":94,"n":1144,"pct":8.2},{"histology":"Non-Small Cell Lung Cancer","hugo_gene_symbol":"PTEN","altered":67,"n":1144,"pct":5.9},{"histology":"Non-Small Cell Lung Cancer","hugo_gene_symbol":"RB1","altered":73,"n":1144,"pct":6.4},{"histology":"Non-Small Cell Lung Cancer","hugo_gene_symbol":"RBM10","altered":47,"n":1144,"pct":4.1},{"histology":"Non-Small Cell Lung Cancer","hugo_gene_symbol":"SETD2","altered":52,"n":1144,"pct":4.5},{"histology":"Non-Small Cell Lung Cancer","hugo_gene_symbol":"SMARCA4","altered":79,"n":1144,"pct":6.9},{"histology":"Non-Small Cell Lung Cancer","hugo_gene_symbol":"STK11","altered":111,"n":1144,"pct":9.7},{"histology":"Non-Small Cell Lung Cancer","hugo_gene_symbol":"TP53","altered":775,"n":1144,"pct":67.7},{"histology":"Non-Small Cell Lung Cancer","hugo_gene_symbol":"U2AF1","altered":17,"n":1144,"pct":1.5}]} ▶ clickhouse_run_select_query { "query": " SELECT attribute_value AS histology, COUNT(DISTINCT sample_unique_id) AS n FROM clinical_data_derived WHERE cancer_study_identifier = 'nsclc_tcga_broad_2016' AND attribute_name = 'CANCER_TYPE' GROUP BY attribute_value " } ◀ result {"rows":[{"histology":"Non-Small Cell Lung Cancer","n":1144}]} ▶ clickhouse_run_select_query { "query": " WITH samp 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' ), tmb AS ( SELECT sample_unique_id, toFloat64OrNull(attribute_value) AS tmb FROM clinical_data_derived WHERE cancer_study_identifier = 'nsclc_tcga_broad_2016' AND attribute_name = 'TMB_NONSYNONYMOUS' ), fga AS ( SELECT sample_unique_id, toFloat64OrNull(attribute_value) AS fga FROM clinical_data_derived WHERE cancer_study_identifier = 'nsclc_tcga_broad_2016' AND attribute_name = 'FRACTION_GENOME_ALTERED' ) SELECT s.histology, round(avg(t.tmb),2) AS mean_tmb, round(median(t.tmb),2) AS median_tmb, round(avg(f.fga),3) AS mean_fga, round(median(f.fga),3) AS median_fga, count() AS n FROM samp s LEFT JOIN tmb t USING (sample_unique_id) LEFT JOIN fga f USING (sample_unique_id) GROUP BY s.histology " } ◀ result {"rows":[{"histology":"Non-Small Cell Lung Cancer","mean_tmb":8.81,"median_tmb":6.73,"mean_fga":0.318,"median_fga":0.316,"n":1144}]} ▶ clickhouse_run_select_query { "query": " WITH samp 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' ), cna AS ( SELECT s.histology, g.hugo_gene_symbol, g.cna_alteration, COUNT(DISTINCT g.sample_unique_id) AS altered FROM genomic_event_derived g JOIN samp s USING (sample_unique_id) WHERE g.cancer_study_identifier = 'nsclc_tcga_broad_2016' AND g.variant_type = 'cna' AND g.hugo_gene_symbol IN ('SOX2','TP63','PIK3CA','FGFR1','EGFR','MDM2','CCND1','NKX2-1','MYC','CDKN2A') GROUP BY s.histology, g.hugo_gene_symbol, g.cna_alteration ), tot AS ( SELECT histology, COUNT(DISTINCT sample_unique_id) AS n FROM samp GROUP BY histology ) SELECT c.histology, c.hugo_gene_symbol, CASE WHEN c.cna_alteration = 2 THEN 'AMP' ELSE 'HOMDEL' END AS cna_type, c.altered, t.n, round(c.altered*100.0/t.n,1) AS pct FROM cna c JOIN tot t USING (histology) ORDER BY hugo_gene_symbol, cna_type, histology " } ◀ result {"rows":[{"histology":"Non-Small Cell Lung Cancer","hugo_gene_symbol":"CCND1","cna_type":"AMP","altered":89,"n":1144,"pct":7.8},{"histology":"Non-Small Cell Lung Cancer","hugo_gene_symbol":"CCND1","cna_type":"HOMDEL","altered":1,"n":1144,"pct":0.1},{"histology":"Non-Small Cell Lung Cancer","hugo_gene_symbol":"CDKN2A","cna_type":"AMP","altered":3,"n":1144,"pct":0.3},{"histology":"Non-Small Cell Lung Cancer","hugo_gene_symbol":"CDKN2A","cna_type":"HOMDEL","altered":241,"n":1144,"pct":21.1},{"histology":"Non-Small Cell Lung Cancer","hugo_gene_symbol":"EGFR","cna_type":"AMP","altered":69,"n":1144,"pct":6},{"histology":"Non-Small Cell Lung Cancer","hugo_gene_symbol":"EGFR","cna_type":"HOMDEL","altered":5,"n":1144,"pct":0.4},{"histology":"Non-Small Cell Lung Cancer","hugo_gene_symbol":"FGFR1","cna_type":"AMP","altered":102,"n":1144,"pct":8.9},{"histology":"Non-Small Cell Lung Cancer","hugo_gene_symbol":"FGFR1","cna_type":"HOMDEL","altered":12,"n":1144,"pct":1},{"histology":"Non-Small Cell Lung Cancer","hugo_gene_symbol":"MDM2","cna_type":"AMP","altered":46,"n":1144,"pct":4},{"histology":"Non-Small Cell Lung Cancer","hugo_gene_symbol":"MDM2","cna_type":"HOMDEL","altered":1,"n":1144,"pct":0.1},{"histology":"Non-Small Cell Lung Cancer","hugo_gene_symbol":"MYC","cna_type":"AMP","altered":100,"n":1144,"pct":8.7},{"histology":"Non-Small Cell Lung Cancer","hugo_gene_symbol":"NKX2-1","cna_type":"AMP","altered":92,"n":1144,"pct":8},{"histology":"Non-Small Cell Lung Cancer","hugo_gene_symbol":"NKX2-1","cna_type":"HOMDEL","altered":3,"n":1144,"pct":0.3},{"histology":"Non-Small Cell Lung Cancer","hugo_gene_symbol":"PIK3CA","cna_type":"AMP","altered":208,"n":1144,"pct":18.2},{"histology":"Non-Small Cell Lung Cancer","hugo_gene_symbol":"PIK3CA","cna_type":"HOMDEL","altered":3,"n":1144,"pct":0.3},{"histology":"Non-Small Cell Lung Cancer","hugo_gene_symbol":"SOX2","cna_type":"AMP","altered":220,"n":1144,"pct":19.2},{"histology":"Non-Small Cell Lung Cancer","hugo_gene_symbol":"SOX2","cna_type":"HOMDEL","altered":3,"n":1144,"pct":0.3},{"histology":"Non-Small Cell Lung Cancer","hugo_gene_symbol":"TP63","cna_type":"AMP","altered":176,"n":1144,"pct":15.4},{"histology":"Non-Small Cell Lung Cancer","hugo_gene_symbol":"TP63","cna_type":"HOMDEL","altered":5,"n":1144,"pct":0.4}]} ▶ 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 = 'CANCER_TYPE_DETAILED' GROUP BY attribute_value " } ◀ result {"rows":[{"attribute_value":"Lung Adenocarcinoma","n":660},{"attribute_value":"Lung Squamous Cell Carcinoma","n":484}]} ▶ clickhouse_run_select_query { "query": " WITH samp 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' ), mut AS ( SELECT s.histology, g.hugo_gene_symbol, COUNT(DISTINCT g.sample_unique_id) AS altered FROM genomic_event_derived g JOIN samp s USING (sample_unique_id) WHERE g.cancer_study_identifier = 'nsclc_tcga_broad_2016' AND g.variant_type = 'mutation' AND g.mutation_status != 'UNCALLED' AND g.off_panel = 0 AND g.hugo_gene_symbol IN ('TP53','KRAS','EGFR','STK11','KEAP1','NFE2L2','PIK3CA','PTEN','CDKN2A','NOTCH1','RB1','SMARCA4','ARID1A','SETD2','MET','BRAF','U2AF1','RBM10','NF1','MGA') GROUP BY s.histology, g.hugo_gene_symbol ), tot AS ( SELECT histology, COUNT(DISTINCT sample_unique_id) AS n FROM samp GROUP BY histology ) SELECT m.hugo_gene_symbol, m.histology, m.altered, t.n, round(m.altered*100.0/t.n,1) AS pct FROM mut m JOIN tot t USING (histology) ORDER BY hugo_gene_symbol, histology " } ◀ result {"rows":[{"hugo_gene_symbol":"ARID1A","histology":"Lung Adenocarcinoma","altered":48,"n":660,"pct":7.3},{"hugo_gene_symbol":"ARID1A","histology":"Lung Squamous Cell Carcinoma","altered":32,"n":484,"pct":6.6},{"hugo_gene_symbol":"BRAF","histology":"Lung Adenocarcinoma","altered":54,"n":660,"pct":8.2},{"hugo_gene_symbol":"BRAF","histology":"Lung Squamous Cell Carcinoma","altered":16,"n":484,"pct":3.3},{"hugo_gene_symbol":"CDKN2A","histology":"Lung Adenocarcinoma","altered":27,"n":660,"pct":4.1},{"hugo_gene_symbol":"CDKN2A","histology":"Lung Squamous Cell Carcinoma","altered":75,"n":484,"pct":15.5},{"hugo_gene_symbol":"EGFR","histology":"Lung Adenocarcinoma","altered":104,"n":660,"pct":15.8},{"hugo_gene_symbol":"EGFR","histology":"Lung Squamous Cell Carcinoma","altered":13,"n":484,"pct":2.7},{"hugo_gene_symbol":"KEAP1","histology":"Lung Adenocarcinoma","altered":110,"n":660,"pct":16.7},{"hugo_gene_symbol":"KEAP1","histology":"Lung Squamous Cell Carcinoma","altered":52,"n":484,"pct":10.7},{"hugo_gene_symbol":"KRAS","histology":"Lung Adenocarcinoma","altered":214,"n":660,"pct":32.4},{"hugo_gene_symbol":"KRAS","histology":"Lung Squamous Cell Carcinoma","altered":8,"n":484,"pct":1.7},{"hugo_gene_symbol":"MET","histology":"Lung Adenocarcinoma","altered":28,"n":660,"pct":4.2},{"hugo_gene_symbol":"MET","histology":"Lung Squamous Cell Carcinoma","altered":6,"n":484,"pct":1.2},{"hugo_gene_symbol":"MGA","histology":"Lung Adenocarcinoma","altered":42,"n":660,"pct":6.4},{"hugo_gene_symbol":"MGA","histology":"Lung Squamous Cell Carcinoma","altered":17,"n":484,"pct":3.5},{"hugo_gene_symbol":"NF1","histology":"Lung Adenocarcinoma","altered":76,"n":660,"pct":11.5},{"hugo_gene_symbol":"NF1","histology":"Lung Squamous Cell Carcinoma","altered":51,"n":484,"pct":10.5},{"hugo_gene_symbol":"NFE2L2","histology":"Lung Adenocarcinoma","altered":14,"n":660,"pct":2.1},{"hugo_gene_symbol":"NFE2L2","histology":"Lung Squamous Cell Carcinoma","altered":70,"n":484,"pct":14.5},{"hugo_gene_symbol":"NOTCH1","histology":"Lung Adenocarcinoma","altered":31,"n":660,"pct":4.7},{"hugo_gene_symbol":"NOTCH1","histology":"Lung Squamous Cell Carcinoma","altered":40,"n":484,"pct":8.3},{"hugo_gene_symbol":"PIK3CA","histology":"Lung Adenocarcinoma","altered":39,"n":660,"pct":5.9},{"hugo_gene_symbol":"PIK3CA","histology":"Lung Squamous Cell Carcinoma","altered":55,"n":484,"pct":11.4},{"hugo_gene_symbol":"PTEN","histology":"Lung Adenocarcinoma","altered":11,"n":660,"pct":1.7},{"hugo_gene_symbol":"PTEN","histology":"Lung Squamous Cell Carcinoma","altered":56,"n":484,"pct":11.6},{"hugo_gene_symbol":"RB1","histology":"Lung Adenocarcinoma","altered":38,"n":660,"pct":5.8},{"hugo_gene_symbol":"RB1","histology":"Lung Squamous Cell Carcinoma","altered":35,"n":484,"pct":7.2},{"hugo_gene_symbol":"RBM10","histology":"Lung Adenocarcinoma","altered":41,"n":660,"pct":6.2},{"hugo_gene_symbol":"RBM10","histology":"Lung Squamous Cell Carcinoma","altered":6,"n":484,"pct":1.2},{"hugo_gene_symbol":"SETD2","histology": … (850 more chars) ▶ clickhouse_run_select_query { "query": " WITH samp 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' ), tmb AS ( SELECT sample_unique_id, toFloat64OrNull(attribute_value) AS tmb FROM clinical_data_derived WHERE cancer_study_identifier = 'nsclc_tcga_broad_2016' AND attribute_name = 'TMB_NONSYNONYMOUS' ), fga AS ( SELECT sample_unique_id, toFloat64OrNull(attribute_value) AS fga FROM clinical_data_derived WHERE cancer_study_identifier = 'nsclc_tcga_broad_2016' AND attribute_name = 'FRACTION_GENOME_ALTERED' ) SELECT s.histology, round(avg(t.tmb),2) AS mean_tmb, round(median(t.tmb),2) AS median_tmb, round(avg(f.fga),3) AS mean_fga, round(median(f.fga),3) AS median_fga, count() AS n FROM samp s LEFT JOIN tmb t USING (sample_unique_id) LEFT JOIN fga f USING (sample_unique_id) GROUP BY s.histology " } ▶ clickhouse_run_select_query { "query": " WITH samp 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' ), cna AS ( SELECT s.histology, g.hugo_gene_symbol, g.cna_alteration, COUNT(DISTINCT g.sample_unique_id) AS altered FROM genomic_event_derived g JOIN samp s USING (sample_unique_id) WHERE g.cancer_study_identifier = 'nsclc_tcga_broad_2016' AND g.variant_type = 'cna' AND g.hugo_gene_symbol IN ('SOX2','TP63','PIK3CA','FGFR1','EGFR','MDM2','CCND1','NKX2-1','MYC','CDKN2A') GROUP BY s.histology, g.hugo_gene_symbol, g.cna_alteration ), tot AS ( SELECT histology, COUNT(DISTINCT sample_unique_id) AS n FROM samp GROUP BY histology ) SELECT c.hugo_gene_symbol, CASE WHEN c.cna_alteration = 2 THEN 'AMP' ELSE 'HOMDEL' END AS cna_type, c.histology, c.altered, t.n, round(c.altered*100.0/t.n,1) AS pct FROM cna c JOIN tot t USING (histology) ORDER BY hugo_gene_symbol, cna_type, histology " } ◀ result {"rows":[{"histology":"Lung Adenocarcinoma","mean_tmb":9.01,"median_tmb":6.27,"mean_fga":0.264,"median_fga":0.236,"n":660},{"histology":"Lung Squamous Cell Carcinoma","mean_tmb":8.53,"median_tmb":7.07,"mean_fga":0.392,"median_fga":0.392,"n":484}]} ◀ result {"rows":[{"hugo_gene_symbol":"CCND1","cna_type":"AMP","histology":"Lung Adenocarcinoma","altered":26,"n":660,"pct":3.9},{"hugo_gene_symbol":"CCND1","cna_type":"AMP","histology":"Lung Squamous Cell Carcinoma","altered":63,"n":484,"pct":13},{"hugo_gene_symbol":"CCND1","cna_type":"HOMDEL","histology":"Lung Adenocarcinoma","altered":1,"n":660,"pct":0.2},{"hugo_gene_symbol":"CDKN2A","cna_type":"AMP","histology":"Lung Adenocarcinoma","altered":1,"n":660,"pct":0.2},{"hugo_gene_symbol":"CDKN2A","cna_type":"AMP","histology":"Lung Squamous Cell Carcinoma","altered":2,"n":484,"pct":0.4},{"hugo_gene_symbol":"CDKN2A","cna_type":"HOMDEL","histology":"Lung Adenocarcinoma","altered":112,"n":660,"pct":17},{"hugo_gene_symbol":"CDKN2A","cna_type":"HOMDEL","histology":"Lung Squamous Cell Carcinoma","altered":129,"n":484,"pct":26.7},{"hugo_gene_symbol":"EGFR","cna_type":"AMP","histology":"Lung Adenocarcinoma","altered":36,"n":660,"pct":5.5},{"hugo_gene_symbol":"EGFR","cna_type":"AMP","histology":"Lung Squamous Cell Carcinoma","altered":33,"n":484,"pct":6.8},{"hugo_gene_symbol":"EGFR","cna_type":"HOMDEL","histology":"Lung Adenocarcinoma","altered":3,"n":660,"pct":0.5},{"hugo_gene_symbol":"EGFR","cna_type":"HOMDEL","histology":"Lung Squamous Cell Carcinoma","altered":2,"n":484,"pct":0.4},{"hugo_gene_symbol":"FGFR1","cna_type":"AMP","histology":"Lung Adenocarcinoma","altered":19,"n":660,"pct":2.9},{"hugo_gene_symbol":"FGFR1","cna_type":"AMP","histology":"Lung Squamous Cell Carcinoma","altered":83,"n":484,"pct":17.1},{"hugo_gene_symbol":"FGFR1","cna_type":"HOMDEL","histology":"Lung Adenocarcinoma","altered":10,"n":660,"pct":1.5},{"hugo_gene_symbol":"FGFR1","cna_type":"HOMDEL","histology":"Lung Squamous Cell Carcinoma","altered":2,"n":484,"pct":0.4},{"hugo_gene_symbol":"MDM2","cna_type":"AMP","histology":"Lung Adenocarcinoma","altered":36,"n":660,"pct":5.5},{"hugo_gene_symbol":"MDM2","cna_type":"AMP","histology":"Lung Squamous Cell Carcinoma","altered":10,"n":484,"pct":2.1},{"hugo_gene_symbol":"MDM2","cna_type":"HOMDEL","histology":"Lung Adenocarcinoma","altered":1,"n":660,"pct":0.2},{"hugo_gene_symbol":"MYC","cna_type":"AMP","histology":"Lung Adenocarcinoma","altered":62,"n":660,"pct":9.4},{"hugo_gene_symbol":"MYC","cna_type":"AMP","histology":"Lung Squamous Cell Carcinoma","altered":38,"n":484,"pct":7.9},{"hugo_gene_symbol":"NKX2-1","cna_type":"AMP","histology":"Lung Adenocarcinoma","altered":79,"n":660,"pct":12},{"hugo_gene_symbol":"NKX2-1","cna_type":"AMP","histology":"Lung Squamous Cell Carcinoma","altered":13,"n":484,"pct":2.7},{"hugo_gene_symbol":"NKX2-1","cna_type":"HOMDEL","histology":"Lung Squamous Cell Carcinoma","altered":3,"n":484,"pct":0.6},{"hugo_gene_symbol":"PIK3CA","cna_type":"AMP","histology":"Lung Adenocarcinoma","altered":14,"n":660,"pct":2.1},{"hugo_gene_symbol":"PIK3CA","cna_type":"AMP","histology":"Lung Squamous Cell Carcinoma","altered":194,"n":484,"pct":40.1},{"hugo_gene_symbol":"PIK3CA","cna_type":"HOMDEL","histology":"Lung Adenocarcinoma","alte … (711 more chars) ▶ 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"]}}]}} ▶ get_studyviewfilter_options { "studyId": "nsclc_tcga_broad_2016", "attributeIds": [ "CANCER_TYPE_DETAILED" ] } ◀ result {"success":true,"message":"Successfully retrieved StudyView filter options","data":{"studyId":"nsclc_tcga_broad_2016","attributes":[{"attributeId":"CANCER_TYPE_DETAILED","displayName":"Cancer Type Detailed","description":"Cancer Type Detailed","datatype":"STRING","values":["Lung Adenocarcinoma","Lung Squamous Cell Carcinoma"]}]}} ▶ navigate_to_group_comparison { "studyIds": [ "nsclc_tcga_broad_2016" ], "groups": [ { "name": "Lung Adenocarcinoma", "studyViewFilter": { "clinicalDataFilters": [ { "attributeId": "CANCER_TYPE_DETAILED", "values": [ { "value": "Lung Adenocarcinoma" } ] } ] } }, { "name": "Lung Squamous Cell Carcinoma", "studyViewFilter": { "clinicalDataFilters": [ { "attributeId": "CANCER_TYPE_DETAILED", "values": [ { "value": "Lung Squamous Cell Carcinoma" } ] } ] } } ], "tab": "alterations" } ◀ result {"success":true,"message":"Navigating to https://www.cbioportal.org/comparison/alterations?comparisonId=6ab4329ee497aad53593be0b","url":"https://www.cbioportal.org/comparison/alterations?comparisonId=6ab4329ee497aad53593be0b","data":{"description":"Group comparison (2 custom groups)","studies":["nsclc_tcga_broad_2016"],"totalGroups":2,"groups":[{"name":"Lung Adenocarcinoma","sampleCount":660},{"name":"Lung Squamous Cell Carcinoma","sampleCount":484}],"studyViewUrl":"https://www.cbioportal.org/study?id=nsclc_tcga_broad_2016","groupUrls":[{"groupName":"Lung Adenocarcinoma","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"},{"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"}],"pageDescription":"Comparison of genomic alteration rates across Lung Adenocarcinoma (660) vs Lung Squamous Cell Carcinoma (484)."}} ▶ navigate_to_results_view { "studyIds": [ "nsclc_tcga_broad_2016" ], "genes": [ "TP53", "KRAS", "EGFR", "STK11", "KEAP1", "NFE2L2", "PTEN", "CDKN2A", "SOX2", "TP63", "PIK3CA", "FGFR1" ], "tab": "oncoprint", "oncoprintClinicalTracks": [ "CANCER_TYPE_DETAILED", "SMOKING_HISTORY" ] } ◀ result {"success":true,"message":"Navigating to https://www.cbioportal.org/results/oncoprint?cancer_study_list=nsclc_tcga_broad_2016&gene_list=TP53%0AKRAS%0AEGFR%0ASTK11%0AKEAP1%0ANFE2L2%0APTEN%0ACDKN2A%0ASOX2%0ATP63%0APIK3CA%0AFGFR1&case_set_id=nsclc_tcga_broad_2016_all&clinicallist=CANCER_TYPE_DETAILED%2CSMOKING_HISTORY","url":"https://www.cbioportal.org/results/oncoprint?cancer_study_list=nsclc_tcga_broad_2016&gene_list=TP53%0AKRAS%0AEGFR%0ASTK11%0AKEAP1%0ANFE2L2%0APTEN%0ACDKN2A%0ASOX2%0ATP63%0APIK3CA%0AFGFR1&case_set_id=nsclc_tcga_broad_2016_all&clinicallist=CANCER_TYPE_DETAILED%2CSMOKING_HISTORY","data":{"studyIds":["nsclc_tcga_broad_2016"],"studies":[{"studyId":"nsclc_tcga_broad_2016","name":"Pan-Lung Cancer (TCGA, Nat Genet 2016)","sampleCount":1144}],"genes":["TP53","KRAS","EGFR","STK11","KEAP1","NFE2L2","PTEN","CDKN2A","SOX2","TP63","PIK3CA","FGFR1"],"caseSetId":"nsclc_tcga_broad_2016_all","pageDescription":"Visual summary of alterations in queried genes across samples."}} ═ answer (success) ## Genomic Differences: LUAD vs. LUSC (Pan-Lung Cancer, TCGA, *Nat Genet* 2016) **Study:** `nsclc_tcga_broad_2016` — 660 Lung Adenocarcinoma (LUAD) samples, 484 Lung Squamous Cell Carcinoma (LUSC) samples (1,144 total, WES). ### Mutation frequency by gene (% of samples altered/profiled) | Gene | LUAD | LUSC | Pattern | |------|------|------|---------| | TP53 | 54.1% (357/660) | 86.4% (418/484) | Enriched in LUSC | | KRAS | 32.4% (214/660) | 1.7% (8/484) | Enriched in LUAD | | EGFR | 15.8% (104/660) | 2.7% (13/484) | Enriched in LUAD | | STK11 | 15.8% (104/660) | 1.4% (7/484) | Enriched in LUAD | | KEAP1 | 16.7% (110/660) | 10.7% (52/484) | Enriched in LUAD | | RBM10 | 6.2% (41/660) | 1.2% (6/484) | Enriched in LUAD | | SMARCA4 | 9.2% (61/660) | 3.7% (18/484) | Enriched in LUAD | | BRAF | 8.2% (54/660) | 3.3% (16/484) | Enriched in LUAD | | NFE2L2 | 2.1% (14/660) | 14.5% (70/484) | Enriched in LUSC | | PTEN | 1.7% (11/660) | 11.6% (56/484) | Enriched in LUSC | | PIK3CA (mutation) | 5.9% (39/660) | 11.4% (55/484) | Enriched in LUSC | | CDKN2A (mutation) | 4.1% (27/660) | 15.5% (75/484) | Enriched in LUSC | | NOTCH1 | 4.7% (31/660) | 8.3% (40/484) | Enriched in LUSC | ### Copy-number alterations | Gene | Alteration | LUAD | LUSC | Pattern | |------|-----------|------|------|---------| | SOX2 | AMP | 2.3% | 42.4% | Strongly enriched in LUSC (3q26 amplicon) | | TP63 | AMP | 2.0% | 33.7% | Strongly enriched in LUSC | | PIK3CA | AMP | 2.1% | 40.1% | Strongly enriched in LUSC | | FGFR1 | AMP | 2.9% | 17.1% | Enriched in LUSC | | CCND1 | AMP | 3.9% | 13.0% | Enriched in LUSC | | CDKN2A | HOMDEL | 17.0% | 26.7% | Enriched in LUSC | | NKX2-1 (TTF-1) | AMP | 12.0% | 2.7% | Enriched in LUAD | | MDM2 | AMP | 5.5% | 2.1% | Enriched in LUAD | ### Genome-wide burden | Metric | LUAD | LUSC | |--------|------|------| | Mean TMB (nonsynonymous) | 9.01 | 8.53 | | Median TMB | 6.27 | 7.07 | | Mean fraction genome altered (FGA) | 0.264 | 0.392 | | Median FGA | 0.236 | 0.392 | ### Summary - **LUSC** is defined by near-universal TP53 mutation (86%), squamous-lineage 3q26 amplicon (SOX2/PIK3CA/TP63 co-amplification), higher genomic instability (FGA), and enrichment of PTEN/NFE2L2/CDKN2A alterations (oxidative-stress and cell-cycle pathways). - **LUAD** is defined by lower TP53 mutation rate (54%), strong enrichment for classic oncogenic drivers (KRAS, EGFR, BRAF) and tumor suppressors STK11/KEAP1/SMARCA4/RBM10, and NKX2-1 (lineage-specific) amplification — consistent with an adenocarcinoma differentiation program. - Overall mutation burden (TMB) is similar between histologies, but LUSC shows substantially greater copy-number instability. These frequencies are gene-specific (numerator/denominator both restricted to WES-profiled samples in each histology group), following cBioPortal's standard mutation-frequency methodology. ### Explore Interactively [Group Comparison: LUAD vs LUSC — Alterations Tab](https://www.cbioportal.org/comparison/alterations?comparisonId=6ab4329ee497aad53593be0b) — statistical enrichment comparison (660 LUAD vs 484 LUSC samples), including odds ratios and q-values for each gene. [OncoPrint: Key Driver Genes Across LUAD/LUSC](https://www.cbioportal.org/results/oncoprint?cancer_study_list=nsclc_tcga_broad_2016&gene_list=TP53%0AKRAS%0AEGFR%0ASTK11%0AKEAP1%0ANFE2L2%0APTEN%0ACDKN2A%0ASOX2%0ATP63%0APIK3CA%0AFGFR1&case_set_id=nsclc_tcga_broad_2016_all&clinicallist=CANCER_TYPE_DETAILED%2CSMOKING_HISTORY) — visual per-sample alteration pattern with histology and smoking-history annotation tracks. [Study Overview: Pan-Lung Cancer (TCGA, Nat Genet 2016)](https://www.cbioportal.org/study?id=nsclc_tcga_broad_2016) — full cohort summary.