Q (sonnet): are lung carcinosarcomas associated with BRIP1 mutations? ▶ read_guide { "uri": "cbioportal://mutation-frequency-guide" } ▶ search_oncotree { "search_term": "carcinosarcoma lung" } ◀ 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) ▶ list_studies { "search": "lung", "limit": 40 } ◀ result {"result":[]} ◀ 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 … (6438 more chars) ▶ search_oncotree { "search_term": "carcinosarcoma" } ◀ result {"result":[{"code":"CSNOS","name":"Breast Invasive Carcinosarcoma, NOS","score":50,"mainType":"Breast Cancer","tissue":"Breast","hierarchy":"BREAST > BRCA > CSNOS"},{"code":"MCS","name":"Metaplastic Carcinosarcoma","score":50,"mainType":"Breast Cancer","tissue":"Breast","hierarchy":"BREAST > MBC > MMBC > MCS"},{"code":"OCS","name":"Ovarian Carcinosarcoma/Malignant Mixed Mesodermal Tumor","score":50,"mainType":"Ovarian Cancer","tissue":"Ovary/Fallopian Tube","hierarchy":"OVARY > OVT > OCS"},{"code":"UCS","name":"Uterine Carcinosarcoma/Uterine Malignant Mixed Mullerian Tumor","score":50,"mainType":"Endometrial Cancer","tissue":"Uterus","hierarchy":"UTERUS > UCEC > UCS"}]} ▶ clickhouse_run_select_query { "query": "SELECT DISTINCT cancer_study_identifier, attribute_value, count() as n FROM clinical_data_derived WHERE attribute_name = 'CANCER_TYPE_DETAILED' AND lower(attribute_value) LIKE '%carcinosarcoma%' GROUP BY cancer_study_identifier, attribute_value ORDER BY n DESC" } ◀ result {"rows":[{"cancer_study_identifier":"msk_impact_50k_2026","attribute_value":"Uterine Carcinosarcoma/Uterine Malignant Mixed Mullerian Tumor","n":293},{"cancer_study_identifier":"ucec_ancestry_cds_msk_2023","attribute_value":"Uterine Carcinosarcoma/Uterine Malignant Mixed Mullerian Tumor","n":225},{"cancer_study_identifier":"msk_met_2021","attribute_value":"Uterine Carcinosarcoma/Uterine Malignant Mixed Mullerian Tumor","n":192},{"cancer_study_identifier":"pancan_mimsi_msk_2024","attribute_value":"Uterine Carcinosarcoma/Uterine Malignant Mixed Mullerian Tumor","n":136},{"cancer_study_identifier":"pancan_pdmr_2025","attribute_value":"Uterine Carcinosarcoma/Uterine Malignant Mixed Mullerian Tumor","n":105},{"cancer_study_identifier":"msk_impact_50k_2026","attribute_value":"Ovarian Carcinosarcoma/Malignant Mixed Mesodermal Tumor","n":81},{"cancer_study_identifier":"ucs_tcga_gdc","attribute_value":"Uterine Carcinosarcoma/Uterine Malignant Mixed Mullerian Tumor","n":57},{"cancer_study_identifier":"ucs_tcga","attribute_value":"Uterine Carcinosarcoma/Uterine Malignant Mixed Mullerian Tumor","n":57},{"cancer_study_identifier":"ucs_tcga_pan_can_atlas_2018","attribute_value":"Uterine Carcinosarcoma/Uterine Malignant Mixed Mullerian Tumor","n":57},{"cancer_study_identifier":"cellline_ccle_broad","attribute_value":"Ovarian Carcinosarcoma/Malignant Mixed Mesodermal Tumor","n":47},{"cancer_study_identifier":"mycf_msk_2026","attribute_value":"Uterine Carcinosarcoma/Uterine Malignant Mixed Mullerian Tumor","n":40},{"cancer_study_identifier":"msk_impact_2017","attribute_value":"Uterine Carcinosarcoma/Uterine Malignant Mixed Mullerian Tumor","n":38},{"cancer_study_identifier":"ucec_msk_2018","attribute_value":"Uterine Carcinosarcoma/Uterine Malignant Mixed Mullerian Tumor","n":37},{"cancer_study_identifier":"ucs_jhu_2014","attribute_value":"Uterine Carcinosarcoma/Uterine Malignant Mixed Mullerian Tumor","n":22},{"cancer_study_identifier":"pancan_pdmr_2025","attribute_value":"Ovarian Carcinosarcoma/Malignant Mixed Mesodermal Tumor","n":15},{"cancer_study_identifier":"msk_impact_2017","attribute_value":"Ovarian Carcinosarcoma/Malignant Mixed Mesodermal Tumor","n":12},{"cancer_study_identifier":"mycf_msk_2026","attribute_value":"Ovarian Carcinosarcoma/Malignant Mixed Mesodermal Tumor","n":11},{"cancer_study_identifier":"pancan_pdmr_2025","attribute_value":"Breast Invasive Carcinosarcoma, NOS","n":11},{"cancer_study_identifier":"pancan_mimsi_msk_2024","attribute_value":"Ovarian Carcinosarcoma/Malignant Mixed Mesodermal Tumor","n":9},{"cancer_study_identifier":"ccle_broad_2025","attribute_value":"Uterine Carcinosarcoma/Uterine Malignant Mixed Mullerian Tumor","n":7},{"cancer_study_identifier":"msk_ctdna_vte_2024","attribute_value":"Uterine Carcinosarcoma/Uterine Malignant Mixed Mullerian Tumor","n":7},{"cancer_study_identifier":"pog570_bcgsc_2020","attribute_value":"Uterine Carcinosarcoma/Uterine Malignant Mixed Mullerian Tumor","n":5},{"cancer_study_identifier":"ucs_ms … (1418 more chars) ═ answer (success) This confirms the premise doesn't hold in this database: OncoTree has no "lung carcinosarcoma" code, and no study in cBioPortal contains samples annotated as lung/pulmonary carcinosarcoma. Carcinosarcoma diagnoses present here are limited to uterine (UCS), ovarian (OCS), and breast (metaplastic/CSNOS) — not lung. Pulmonary carcinosarcoma is an extremely rare entity and does not appear to be represented as a distinct cohort or annotated subtype in any cBioPortal study. I can't answer the BRIP1 association question as posed, because there's no lung carcinosarcoma cohort in cBioPortal to query. A few options if you'd like to proceed: 1. **Broaden to "sarcomatoid lung carcinoma"** — a related but distinct entity (pleomorphic/sarcomatoid carcinoma of the lung) that *may* appear as a detailed histology label within NSCLC studies (e.g., MSK-IMPACT, MSK-CHORD, TCGA Pan-Lung). I can search for that label specifically and pull BRIP1 mutation frequency if samples exist. 2. **Check BRIP1 in NSCLC generally** (LUAD/LUSC, TCGA PanCancer Atlas or MSK cohorts) as a reference point, while being explicit that this is not carcinosarcoma-specific. 3. Confirm whether you actually meant one of the carcinosarcoma types that do exist here (uterine, ovarian, or breast) — I found BRIP1 has been implicated in hereditary contexts (ovarian/breast) and I could check somatic/germline BRIP1 mutation rates in the uterine or ovarian carcinosarcoma cohorts instead. Would you like me to pursue option 1 (sarcomatoid lung carcinoma) or one of the others?