Q (sonnet): Can you please generate a survival curve for colorectal cancer patients based on the expression levels of IMPDH2? ▶ read_guide { "uri": "cbioportal://statistical-tests-guide" } ▶ resolve_and_route { "studyKeywords": [ "colorectal", "TCGA" ] } ◀ 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 {"success":true,"message":"Found 3 matching studies. Pick the best match (prefer TCGA → prefer PanCancer Atlas), use its metadata to call the appropriate navigation tool(s) and generate URLs immediately. Present other studies as alternatives.","data":{"totalCount":3,"studiesWithMetadata":[{"studyId":"coadread_tcga","name":"Colorectal Adenocarcinoma (TCGA, Firehose Legacy)","sampleCount":640,"studyViewUrl":"https://www.cbioportal.org/study?id=coadread_tcga","metadata":{"clinicalAttributeIds":["AGE","AJCC_METASTASIS_PATHOLOGIC_PM","AJCC_NODES_PATHOLOGIC_PN","AJCC_PATHOLOGIC_TUMOR_STAGE","AJCC_STAGING_EDITION","AJCC_TUMOR_PATHOLOGIC_PT","BRAF_GENE_ANALYSIS_INDICATOR","BRAF_GENE_ANALYSIS_RESULT","CANCER_TYPE","CANCER_TYPE_DETAILED","CLINICAL_STAGE","CLIN_M_STAGE","CLIN_N_STAGE","CLIN_T_STAGE","DAYS_TO_COLLECTION","DAYS_TO_INITIAL_PATHOLOGIC_DIAGNOSIS","DAYS_TO_PATIENT_PROGRESSION_FREE","DAYS_TO_SPECIMEN_COLLECTION","DAYS_TO_TUMOR_PROGRESSION","DFS_MONTHS","DFS_STATUS","DISEASE_CODE","ETHNICITY","EXTRANODAL_INVOLVEMENT","FORM_COMPLETION_DATE","FRACTION_GENOME_ALTERED","HEIGHT","HISTOLOGICAL_DIAGNOSIS","HISTORY_NEOADJUVANT_TRTYN","HISTORY_OTHER_MALIGNANCY","ICD_10","ICD_O_3_HISTOLOGY","ICD_O_3_SITE","INFORMED_CONSENT_VERIFIED","INITIAL_PATHOLOGIC_DIAGNOSIS_METHOD","INITIAL_PATHOLOGIC_DX_YEAR","IS_FFPE","KRAS_GENE_ANALYSIS_INDICATOR","KRAS_MUTATION","LONGEST_DIMENSION","LYMPHOVASCULAR_INVASION_INDICATOR","LYMPH_NODES_EXAMINED","LYMPH_NODES_EXAMINED_HE_COUNT","LYMPH_NODES_EXAMINED_IHC_COUNT","LYMPH_NODE_EXAMINED_COUNT","METHOD_OF_SAMPLE_PROCUREMENT","MUTATION_COUNT","NEW_TUMOR_EVENT_AFTER_INITIAL_TREATMENT","OCT_EMBEDDED","ONCOTREE_CODE","OS_MONTHS","OS_STATUS","OTHER_METHOD_OF_SAMPLE_PROCUREMENT","OTHER_PATIENT_ID","OTHER_SAMPLE_ID","PATHOLOGY_REPORT_FILE_NAME","PATHOLOGY_REPORT_UUID","PERINEURAL_INVASION","PHARMACEUTICAL_TX_ADJUVANT","PRIMARY_SITE_PATIENT","PROJECT_CODE","PROSPECTIVE_COLLECTION","RACE","RADIATION_TREATMENT_ADJUVANT","RESIDUAL_TUMOR","RETROSPECTIVE_COLLECTION","SAMPLE_COUNT","SAMPLE_INITIAL_WEIGHT","SAMPLE_TYPE","SAMPLE_TYPE_ID","SEX","SHORTEST_DIMENSION","SITE_OF_TUMOR_TISSUE","SOMATIC_STATUS","SPECIMEN_CURRENT_WEIGHT","SPECIMEN_FREEZING_METHOD","SPECIMEN_SECOND_LONGEST_DIMENSION","STAGE_OTHER","TIME_BETWEEN_CLAMPING_AND_FREEZING","TIME_BETWEEN_EXCISION_AND_FREEZING","TISSUE_SOURCE_SITE","TMB_NONSYNONYMOUS","TREATMENT_OUTCOME_FIRST_COURSE","TUMOR_STATUS","VASCULAR_INVASION_INDICATOR","VIAL_NUMBER","WEIGHT"],"molecularProfileIds":["coadread_tcga_gistic","coadread_tcga_linear_CNA","coadread_tcga_methylation_hm450","coadread_tcga_mrna","coadread_tcga_mrna_median_Zscores","coadread_tcga_mrna_median_all_sample_Zscores","coadread_tcga_mutations","coadread_tcga_protein_quantification","coadread_tcga_protein_quantification_zscores","coadread_tcga_rna_seq_v2_mrna","coadread_tcga_rna_seq_v2_mrna_median_Zscores","coadread_tcga_rna_seq_v2_mrna_median_all_sample_Zscores","coadread_tcga_rppa","coadread_tcga_rppa_Zscores"],"heatmapProfileIds":["coadr … (4966 more chars) ▶ get_studyviewfilter_options { "studyId": "coadread_tcga_pan_can_atlas_2018", "geneSpecificQueries": [ { "hugoGeneSymbol": "IMPDH2", "profileType": "rna_seq_v2_mrna_median_Zscores" } ] } ◀ result {"success":true,"message":"Successfully retrieved StudyView filter options","data":{"studyId":"coadread_tcga_pan_can_atlas_2018","geneSpecificCounts":[{"hugoGeneSymbol":"IMPDH2","profileType":"rna_seq_v2_mrna_median_Zscores","bins":[{"end":-0.7686,"count":148},{"start":-0.7686,"end":-0.26385,"count":148},{"start":-0.26385,"end":0.4825,"count":148},{"start":0.4825,"count":148}]}]}} ▶ navigate_to_group_comparison { "studyIds": [ "coadread_tcga_pan_can_atlas_2018" ], "tab": "survival", "groups": [ { "name": "IMPDH2 High (≥ median)", "studyViewFilter": { "genomicDataFilters": [ { "hugoGeneSymbol": "IMPDH2", "profileType": "rna_seq_v2_mrna_median_Zscores", "values": [ { "start": -0.26385 } ] } ] } }, { "name": "IMPDH2 Low (< median)", "studyViewFilter": { "genomicDataFilters": [ { "hugoGeneSymbol": "IMPDH2", "profileType": "rna_seq_v2_mrna_median_Zscores", "values": [ { "end": -0.26385 } ] } ] } } ] } ◀ result {"success":true,"message":"Navigating to https://www.cbioportal.org/comparison/survival?comparisonId=6ab5c518c2115c492d884dfd","url":"https://www.cbioportal.org/comparison/survival?comparisonId=6ab5c518c2115c492d884dfd","data":{"description":"Group comparison (2 custom groups)","studies":["coadread_tcga_pan_can_atlas_2018"],"totalGroups":2,"groups":[{"name":"IMPDH2 High (≥ median)","sampleCount":296},{"name":"IMPDH2 Low (< median)","sampleCount":296}],"studyViewUrl":"https://www.cbioportal.org/study?id=coadread_tcga_pan_can_atlas_2018","groupUrls":[{"groupName":"IMPDH2 High (≥ median)","url":"https://www.cbioportal.org/study?id=coadread_tcga_pan_can_atlas_2018#filterJson=%7B%22genomicDataFilters%22%3A%5B%7B%22hugoGeneSymbol%22%3A%22IMPDH2%22%2C%22profileType%22%3A%22rna_seq_v2_mrna_median_Zscores%22%2C%22values%22%3A%5B%7B%22start%22%3A-0.26385%7D%5D%7D%5D%7D"},{"groupName":"IMPDH2 Low (< median)","url":"https://www.cbioportal.org/study?id=coadread_tcga_pan_can_atlas_2018#filterJson=%7B%22genomicDataFilters%22%3A%5B%7B%22hugoGeneSymbol%22%3A%22IMPDH2%22%2C%22profileType%22%3A%22rna_seq_v2_mrna_median_Zscores%22%2C%22values%22%3A%5B%7B%22end%22%3A-0.26385%7D%5D%7D%5D%7D"}],"pageDescription":"Kaplan-Meier survival analysis comparing IMPDH2 High (≥ median) (296) vs IMPDH2 Low (< median) (296)."}} ═ answer (success) ## Kaplan-Meier Survival Comparison: IMPDH2 Expression in Colorectal Cancer **Study:** Colorectal Adenocarcinoma (TCGA, PanCancer Atlas) — `coadread_tcga_pan_can_atlas_2018` **Grouping:** Median-split on IMPDH2 mRNA expression (RNA-Seq V2, z-scores relative to diploid samples): - **IMPDH2 High** (z-score ≥ -0.264): 296 samples - **IMPDH2 Low** (z-score < -0.264): 296 samples [View Kaplan-Meier Survival Curve](https://www.cbioportal.org/comparison/survival?comparisonId=6ab5c518c2115c492d884dfd) Kaplan-Meier survival analysis comparing IMPDH2 High (≥ median) (296) vs IMPDH2 Low (< median) (296). The linked page includes Overall Survival, Disease-Free Survival, and other configured endpoints with log-rank p-values computed directly by cBioPortal. Toggle between OS/DFS/PFS/DSS curves and adjust the expression cutoff (e.g., quartiles instead of median) using the group definitions. **Group-specific cohort links** (for further filtering): - [IMPDH2 High cohort](https://www.cbioportal.org/study?id=coadread_tcga_pan_can_atlas_2018#filterJson=%7B%22genomicDataFilters%22%3A%5B%7B%22hugoGeneSymbol%22%3A%22IMPDH2%22%2C%22profileType%22%3A%22rna_seq_v2_mrna_median_Zscores%22%2C%22values%22%3A%5B%7B%22start%22%3A-0.26385%7D%5D%7D%5D%7D) - [IMPDH2 Low cohort](https://www.cbioportal.org/study?id=coadread_tcga_pan_can_atlas_2018#filterJson=%7B%22genomicDataFilters%22%3A%5B%7B%22hugoGeneSymbol%22%3A%22IMPDH2%22%2C%22profileType%22%3A%22rna_seq_v2_mrna_median_Zscores%22%2C%22values%22%3A%5B%7B%22end%22%3A-0.26385%7D%5D%7D%5D%7D) Note: I did not compute a hazard ratio or p-value myself — these are generated live by cBioPortal's KM/log-rank engine on the linked page.