Q (sonnet): In the TCGA Breast Cancer study, do TP53 mutations and high MYC expression co-occur or are they mutually exclusive? ▶ read_guide { "uri": "cbioportal://statistical-tests-guide" } ▶ list_studies { "search": "breast TCGA pan can atlas" } ◀ 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":[{"cancer_study_identifier":"brca_tcga_pan_can_atlas_2018","name":"Breast Invasive Carcinoma (TCGA, PanCancer Atlas)","type_of_cancer_id":"brca","sample_count":1084,"has_guide":true,"url":"https://www.cbioportal.org/study/summary?id=brca_tcga_pan_can_atlas_2018"}]} ▶ clickhouse_list_table_columns { "table": "genomic_event_derived" } ▶ clickhouse_list_table_columns { "table": "genetic_alteration_derived" } ◀ 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."}]} ◀ result {"columns":[{"name":"sample_unique_id","type":"String"},{"name":"cancer_study_identifier","type":"LowCardinality(String)"},{"name":"hugo_gene_symbol","type":"String"},{"name":"profile_type","type":"LowCardinality(String)"},{"name":"alteration_value","type":"Nullable(String)"}]} ▶ clickhouse_run_select_query { "query": " WITH tp53_mut AS ( SELECT DISTINCT sample_unique_id FROM genomic_event_derived WHERE cancer_study_identifier = 'brca_tcga_pan_can_atlas_2018' AND hugo_gene_symbol = 'TP53' AND variant_type = 'mutation' AND mutation_status != 'UNCALLED' AND off_panel = 0 ), myc_expr AS ( SELECT sample_unique_id, toFloat64OrNull(alteration_value) AS zscore FROM genetic_alteration_derived WHERE cancer_study_identifier = 'brca_tcga_pan_can_atlas_2018' AND hugo_gene_symbol = 'MYC' AND profile_type = 'mrna_seq_v2_rna_seq_v2_zscores_ref_all_samples' ), mut_samples AS ( SELECT DISTINCT sample_unique_id FROM genomic_event_derived WHERE cancer_study_identifier = 'brca_tcga_pan_can_atlas_2018' AND variant_type = 'mutation' ) SELECT countIf(m.sample_unique_id != '' AND e.zscore > 2) AS tp53mut_myc_high, countIf(m.sample_unique_id != '' AND (e.zscore <= 2 OR e.zscore IS NULL)) AS tp53mut_myc_not_high, countIf(m.sample_unique_id = '' AND e.zscore > 2) AS tp53wt_myc_high, countIf(m.sample_unique_id = '' AND (e.zscore <= 2 OR e.zscore IS NULL)) AS tp53wt_myc_not_high, count() AS total_profiled FROM myc_expr e LEFT JOIN tp53_mut m ON e.sample_unique_id = m.sample_unique_id WHERE e.sample_unique_id IN (SELECT sample_unique_id FROM mut_samples) " } ◀ result {"rows":[{"tp53mut_myc_high":0,"tp53mut_myc_not_high":0,"tp53wt_myc_high":0,"tp53wt_myc_not_high":0,"total_profiled":0}]} ▶ clickhouse_run_select_query { "query": " SELECT DISTINCT profile_type FROM genetic_alteration_derived WHERE cancer_study_identifier = 'brca_tcga_pan_can_atlas_2018' AND hugo_gene_symbol = 'MYC' " } ◀ result {"rows":[{"profile_type":"gistic"},{"profile_type":"log2CNA"},{"profile_type":"rna_seq_v2_mrna"},{"profile_type":"rna_seq_v2_mrna_median_Zscores"},{"profile_type":"rna_seq_v2_mrna_median_all_sample_Zscores"},{"profile_type":"rna_seq_v2_mrna_median_all_sample_ref_normal_Zscores"},{"profile_type":"rppa"},{"profile_type":"rppa_Zscores"}]} ▶ clickhouse_run_select_query { "query": " WITH tp53_mut AS ( SELECT DISTINCT sample_unique_id FROM genomic_event_derived WHERE cancer_study_identifier = 'brca_tcga_pan_can_atlas_2018' AND hugo_gene_symbol = 'TP53' AND variant_type = 'mutation' AND mutation_status != 'UNCALLED' AND off_panel = 0 ), myc_expr AS ( SELECT sample_unique_id, toFloat64OrNull(alteration_value) AS zscore FROM genetic_alteration_derived WHERE cancer_study_identifier = 'brca_tcga_pan_can_atlas_2018' AND hugo_gene_symbol = 'MYC' AND profile_type = 'rna_seq_v2_mrna_median_all_sample_Zscores' ), mut_samples AS ( SELECT DISTINCT sample_unique_id FROM genomic_event_derived WHERE cancer_study_identifier = 'brca_tcga_pan_can_atlas_2018' AND variant_type = 'mutation' ) SELECT countIf(m.sample_unique_id != '' AND e.zscore > 2) AS tp53mut_myc_high, countIf(m.sample_unique_id != '' AND (e.zscore <= 2 OR e.zscore IS NULL)) AS tp53mut_myc_not_high, countIf(m.sample_unique_id = '' AND e.zscore > 2) AS tp53wt_myc_high, countIf(m.sample_unique_id = '' AND (e.zscore <= 2 OR e.zscore IS NULL)) AS tp53wt_myc_not_high, count() AS total_profiled FROM myc_expr e LEFT JOIN tp53_mut m ON e.sample_unique_id = m.sample_unique_id WHERE e.sample_unique_id IN (SELECT sample_unique_id FROM mut_samples) " } ◀ result {"rows":[{"tp53mut_myc_high":10,"tp53mut_myc_not_high":337,"tp53wt_myc_high":6,"tp53wt_myc_not_high":654,"total_profiled":1007}]} ▶ resolve_and_route { "studyIds": [ "brca_tcga_pan_can_atlas_2018" ] } ◀ result {"success":true,"message":"Found 1 study. Use the metadata to call the appropriate navigation tool(s).","data":{"totalCount":1,"studiesWithMetadata":[{"studyId":"brca_tcga_pan_can_atlas_2018","name":"Breast Invasive Carcinoma (TCGA, PanCancer Atlas)","sampleCount":1084,"studyViewUrl":"https://www.cbioportal.org/study?id=brca_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":["brca_tcga_pan_can_atlas_2018_gistic","brca_tcga_pan_can_atlas_2018_log2CNA","brca_tcga_pan_can_atlas_2018_mutations","brca_tcga_pan_can_atlas_2018_protein_quantification","brca_tcga_pan_can_atlas_2018_protein_quantification_zscores","brca_tcga_pan_can_atlas_2018_rna_seq_v2_mrna","brca_tcga_pan_can_atlas_2018_rna_seq_v2_mrna_median_Zscores","brca_tcga_pan_can_atlas_2018_rna_seq_v2_mrna_median_all_sample_Zscores","brca_tcga_pan_can_atlas_2018_rna_seq_v2_mrna_median_all_sample_ref_normal_Zscores","brca_tcga_pan_can_atlas_2018_rppa","brca_tcga_pan_can_atlas_2018_rppa_Zscores","brca_tcga_pan_can_atlas_2018_structural_variants"],"genericAssayProfiles":["brca_tcga_pan_can_atlas_2018_armlevel_cna","brca_tcga_pan_can_atlas_2018_genetic_ancestry","brca_tcga_pan_can_atlas_2018_methylation_hm27_hm450_merge","brca_tcga_pan_can_atlas_2018_methylation_hm450","brca_tcga_pan_can_atlas_2018_phosphoprotein_quantification"],"heatmapProfileIds":["brca_tcga_pan_can_atlas_2018_protein_quantification_zscores","brca_tcga_pan_can_atlas_2018_rna_seq_v2_mrna_median_Zscores","brca_tcga_pan_can_atlas_2018_rna_seq_v2_mrna_median_all_sample_Zscores","brca_tcga_pan_can_atlas_2018_rna_seq_v2_mrna_median_all_sample_ref_normal_Zscores","brca_tcga_pan_can_atlas_2018_rppa_Zscores"],"availableComparisonTabs":["overlap","clinical","survival","alterations","mutations","mrna","protein","generic_assay_armlevel_cna","generic_assay_genetic_anc … (83 more chars) ▶ navigate_to_results_view { "studyIds": [ "brca_tcga_pan_can_atlas_2018" ], "genes": [ "TP53: MUT", "MYC: EXP>2" ], "tab": "plots", "profileFilter": "mutations,rna_seq_v2_mrna_median_all_sample_Zscores", "plotsHorzSelection": { "dataType": "MUTATION_EXTENDED", "selectedGeneOption": "TP53" }, "plotsVertSelection": { "dataType": "mrna", "selectedGeneOption": "MYC", "selectedDataSourceOption": "brca_tcga_pan_can_atlas_2018_rna_seq_v2_mrna_median_all_sample_Zscores" } } ◀ result {"success":true,"message":"Navigating to https://www.cbioportal.org/results/plots?cancer_study_list=brca_tcga_pan_can_atlas_2018&gene_list=TP53%3A+MUT%0AMYC%3A+EXP%3E2&case_set_id=brca_tcga_pan_can_atlas_2018_all&profileFilter=mutations%2Crna_seq_v2_mrna_median_all_sample_Zscores&plots_horz_selection=%7B%22selectedGeneOption%22%3A%227157%22%2C%22dataType%22%3A%22MUTATION_EXTENDED%22%7D&plots_vert_selection=%7B%22selectedGeneOption%22%3A%224609%22%2C%22dataType%22%3A%22mrna%22%2C%22selectedDataSourceOption%22%3A%22brca_tcga_pan_can_atlas_2018_rna_seq_v2_mrna_median_all_sample_Zscores%22%7D","url":"https://www.cbioportal.org/results/plots?cancer_study_list=brca_tcga_pan_can_atlas_2018&gene_list=TP53%3A+MUT%0AMYC%3A+EXP%3E2&case_set_id=brca_tcga_pan_can_atlas_2018_all&profileFilter=mutations%2Crna_seq_v2_mrna_median_all_sample_Zscores&plots_horz_selection=%7B%22selectedGeneOption%22%3A%227157%22%2C%22dataType%22%3A%22MUTATION_EXTENDED%22%7D&plots_vert_selection=%7B%22selectedGeneOption%22%3A%224609%22%2C%22dataType%22%3A%22mrna%22%2C%22selectedDataSourceOption%22%3A%22brca_tcga_pan_can_atlas_2018_rna_seq_v2_mrna_median_all_sample_Zscores%22%7D","data":{"studyIds":["brca_tcga_pan_can_atlas_2018"],"studies":[{"studyId":"brca_tcga_pan_can_atlas_2018","name":"Breast Invasive Carcinoma (TCGA, PanCancer Atlas)","sampleCount":1084}],"genes":["TP53","MYC"],"caseSetId":"brca_tcga_pan_can_atlas_2018_all","pageDescription":"Scatter/box plots: MYC mrna (y-axis) by TP53 mutation (x-axis)."}} ═ answer (success) ## TP53 mutation vs. high MYC expression — Breast Invasive Carcinoma (TCGA, PanCancer Atlas) Cohort: **1,007 samples** with both mutation and mRNA expression data profiled (of 1,084 in the study). "High MYC expression" defined as mRNA z-score (RNA-Seq v2, log-normal reference: all samples) **> 2**. **2×2 contingency table (samples):** | | MYC high (z>2) | MYC not high | Total | |---|---|---|---| | **TP53 mutated** | 10 | 337 | 347 | | **TP53 wild-type** | 6 | 654 | 660 | | **Total** | 16 | 991 | 1,007 | Within this table, MYC-high samples are somewhat enriched in the TP53-mutant group (10/347 = 2.9%) versus TP53-wild-type (6/660 = 0.9%), but **I have not run a statistical test on these counts, so I cannot state whether this co-occurrence is statistically significant, nor can I claim mutual exclusivity in either direction.** Determining that requires Fisher's exact test (with an odds ratio), which cBioPortal's own tools compute — this contingency table alone is not a test result. To get the actual test statistic, use: - **R:** `fisher.test(matrix(c(10, 337, 6, 654), nrow=2))` - **Python:** `from scipy.stats import fisher_exact; fisher_exact([[10, 337], [6, 654]])` - **cBioPortal's own Mutual Exclusivity / Group Comparison tabs** (recommended, matches portal defaults) ### View the data directly in cBioPortal [MYC mRNA expression by TP53 mutation status (Plots tab)](https://www.cbioportal.org/results/plots?cancer_study_list=brca_tcga_pan_can_atlas_2018&gene_list=TP53%3A+MUT%0AMYC%3A+EXP%3E2&case_set_id=brca_tcga_pan_can_atlas_2018_all&profileFilter=mutations%2Crna_seq_v2_mrna_median_all_sample_Zscores&plots_horz_selection=%7B%22selectedGeneOption%22%3A%227157%22%2C%22dataType%22%3A%22MUTATION_EXTENDED%22%7D&plots_vert_selection=%7B%22selectedGeneOption%22%3A%224609%22%2C%22dataType%22%3A%22mrna%22%2C%22selectedDataSourceOption%22%3A%22brca_tcga_pan_can_atlas_2018_rna_seq_v2_mrna_median_all_sample_Zscores%22%7D) This scatter/box plot shows MYC mRNA z-scores split by TP53 mutation status across all 1,084 samples in the study, and lets you switch to the built-in Mutual Exclusivity tab for the formal test if desired. One note on interpretation: "high expression" (z>2) is a strict, conventional cutoff that captures only the upper tail (16/1,007 samples here). If you'd prefer a different threshold (e.g., top quartile, or continuous MYC expression compared as a numeric variable between TP53-mutant and wild-type groups via a t-test), let me know and I can rebuild the table.