Q (haiku): In the Pediatric Neuroblastoma study from TARGET what is the survival difference and the corresponding statistical significance between patients who were older than four when diagnosed and the younger ones? ▶ read_guide { "uri": "cbioportal://statistical-tests-guide" } ◀ 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) ▶ list_studies { "search": "TARGET neuroblastoma", "verbose": true } ◀ result {"result":[{"cancer_study_identifier":"nbl_target_gdc","name":"Neuroblastoma (TARGET GDC, 2025)","description":"TARGET Neuroblastoma. Source data from NCI GDC and generated in Aug 2025 using Cancer Data Aggregator.","type_of_cancer_id":"nbl","sample_count":533,"has_guide":false,"url":"https://www.cbioportal.org/study/summary?id=nbl_target_gdc"},{"cancer_study_identifier":"nbl_target_2018_pub","name":"Pediatric Neuroblastoma (TARGET, 2018)","description":"Whole genome or whole exome sequencing on 1089 NBL samples. Comprehensive profiling of 1089 NBL samples.
TARGET data is intended exclusively for biomedical research using pediatric data (i.e., the research objectives cannot be accomplished using data from adults) that focus on the development of more effective treatments, diagnostic tests, or prognostic markers for childhood cancers. Moreover, TARGET data can be used for research relevant to the biology, causes, treatment and late complications of treatment of pediatric cancers, but is not intended for the sole purposes of methods and/or tool development (please see Using TARGET Data section of the OCG website). If you are interested in using TARGET data for publication or other research purposes, you must follow the TARGET Publication Guidelines.
","type_of_cancer_id":"nbl","sample_count":1089,"has_guide":false,"url":"https://www.cbioportal.org/study/summary?id=nbl_target_2018_pub"},{"cancer_study_identifier":"nbl_msk_2023","name":"Pediatric Neuroblastoma (MSK, Nat Genet 2023)","description":"Targeted sequencing of 223 pediatric neuroblastoma tumor/normal pairs via MSK-IMPACT.","type_of_cancer_id":"nbl","sample_count":223,"has_guide":false,"url":"https://www.cbioportal.org/study/summary?id=nbl_msk_2023"}]} ▶ get_study_guide { "study_id": "nbl_target_2018_pub" } ▶ clickhouse_list_table_columns { "table": "clinical_data_derived" } ◀ result # Study Guide: Pediatric Neuroblastoma (TARGET, 2018) **Study ID:** `nbl_target_2018_pub` **Cancer Type:** nbl **Description:** Whole genome or whole exome sequencing on 1089 NBL samples. Comprehensive profiling of 1089 NBL samples.TARGET data is intended exclusively for biomedical research using pediatric data (i.e., the research objectives cannot be accomplished using data from adults) that focus on the development of more effective treatments, diagnostic tests, or prognostic markers for childhood cancers. Moreover, TARGET data can be used for research relevant to the biology, causes, treatment and late complications of treatment of pediatric cancers, but is not intended for the sole purposes of methods and/or tool development (please see Using TARGET Data section of the OCG website). If you are interested in using TARGET data for publication or other research purposes, you must follow the TARGET Publication Guidelines.
## Cohort Statistics - **Patients:** 1,076 - **Samples:** 1,090 ## Available Data Types - **COPY_NUMBER_ALTERATION**: Putative copy-number alterations from GISTIC - **MUTATION_EXTENDED**: Somatic mutations - **MRNA_EXPRESSION**: mRNA expression (microarray) - **MRNA_EXPRESSION**: mRNA expression z-scores relative to diploid samples (microarray) - **MRNA_EXPRESSION**: mRNA expression z-scores relative to all samples (log microarray) - **MRNA_EXPRESSION**: mRNA expression (RNA Seq RPKM) - **MRNA_EXPRESSION**: mRNA expression z-scores relative to diploid samples (RNA Seq RPKM) ## Gene Panels - **WES** (Whole Exome): 1,089 samples — all genes profiled ## Available Clinical Attributes | Attribute | Samples with Data | |-----------|------------------| | MYCN | 1,089 | | PLOIDY | 1,089 | | TMB_NONSYNONYMOUS | 1,089 | | CANCER_TYPE | 1,089 | | FRACTION_GENOME_ALTERED | 1,089 | | ONCOTREE_CODE | 1,089 | | SOMATIC_STATUS | 1,089 | | CNS_SITE_OF_RELAPSE | 1,089 | | MUTATION_COUNT | 1,089 | | ANALYSIS_COHORT | 1,089 | | TUMOR_PLOIDY | 1,089 | | CANCER_TYPE_DETAILED | 1,089 | | TUMOR_TISSUE_SITE | 1,089 | | MKI | 1,089 | | GRADE | 1,089 | | ICDO_SNOMED_DESCRIPTION | 1 | | DIAGNOSIS | 1 | | OS_MONTHS | 1 | | PERCENT_TUMOR_CELLS_RELAPSE | 1 | | ICDO | 1 | ## Top Mutated Genes | Gene | Altered Samples | |------|----------------| | NBPF10 | 7 | | DNAH2 | 5 | | PTPN11 | 5 | | TET2 | 4 | | COL6A3 | 4 | | NF1 | 4 | | NBPF1 | 4 | | MYCN | 3 | | COL5A3 | 3 | | AXL | 3 | ## Query Tips for nbl_target_2018_pub ```sql -- Get all samples in this study SELECT DISTINCT sample_unique_id, patient_unique_id FROM clinical_data_derived WHERE cancer_study_identifier = 'nbl_target_2018_pub'; -- 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 = 'nbl_target_2018_pub' AND hug … (317 more chars) ◀ result {"columns":[{"name":"internal_id","type":"Int32"},{"name":"sample_unique_id","type":"String","comment":"Globally unique sample ID: cancer_study_identifier + \"_\" + sample.stable_id. Empty for patient-level attributes. Use this for sample filtering and joins."},{"name":"patient_unique_id","type":"String","comment":"Globally unique patient ID: cancer_study_identifier + \"_\" + patient.stable_id. Present for both sample and patient-level attributes."},{"name":"attribute_name","type":"LowCardinality(String)","comment":"Clinical attribute name (e.g., SAMPLE_TYPE, CANCER_TYPE, AGE, OS_MONTHS). Use with attribute_value for filtering. AGE may be floored or capped for de-identification (e.g. all children recorded as 18, or everyone 89+ recorded as 89 or 90): before age statistics check for a pile-up at the min/max, and if present compute age from DAYS_TO_BIRTH (-days / 365.25)."},{"name":"attribute_value","type":"String","comment":"Value of the clinical attribute (String). For SAMPLE_TYPE: Primary, Metastasis, Local Recurrence, Unknown. Missing values are empty strings, so use toFloat64OrNull(attribute_value) for numeric comparisons — CAST fails on them."},{"name":"cancer_study_identifier","type":"LowCardinality(String)"},{"name":"type","type":"LowCardinality(String)","comment":"Data level: \"sample\" for sample-level attributes (e.g., SAMPLE_TYPE), \"patient\" for patient-level attributes (e.g., AGE, OS_MONTHS)."}]} ▶ clickhouse_run_select_query { "query": " SELECT DISTINCT attribute_name FROM clinical_data_derived WHERE cancer_study_identifier = 'nbl_target_2018_pub' ORDER BY attribute_name ", "max_rows": 100 } ◀ result {"rows":[{"attribute_name":"AGE"},{"attribute_name":"AGE_IN_DAYS"},{"attribute_name":"ANALYSIS_COHORT"},{"attribute_name":"CANCER_TYPE"},{"attribute_name":"CANCER_TYPE_DETAILED"},{"attribute_name":"CNS_SITE_OF_RELAPSE"},{"attribute_name":"DIAGNOSIS"},{"attribute_name":"EFSCENS"},{"attribute_name":"EFS_TIME"},{"attribute_name":"ETHNICITY"},{"attribute_name":"FIRST_EVENT"},{"attribute_name":"FRACTION_GENOME_ALTERED"},{"attribute_name":"GRADE"},{"attribute_name":"ICDO"},{"attribute_name":"ICDO_SNOMED_DESCRIPTION"},{"attribute_name":"INSS_STAGE"},{"attribute_name":"LAST_FOLLOWUP_YEAR"},{"attribute_name":"MKI"},{"attribute_name":"MUTATION_COUNT"},{"attribute_name":"MYCN"},{"attribute_name":"ONCOTREE_CODE"},{"attribute_name":"OS_DAYS"},{"attribute_name":"OS_MONTHS"},{"attribute_name":"OS_STATUS"},{"attribute_name":"PERCENTAGE_NECROSIS"},{"attribute_name":"PERCENTAGE_TUMOR_PURITY"},{"attribute_name":"PERCENT_TUMOR_CELLS_RELAPSE"},{"attribute_name":"PERCENT_TUMOR_VS_STROMA"},{"attribute_name":"PLOIDY"},{"attribute_name":"PROTOCOL"},{"attribute_name":"RACE"},{"attribute_name":"RELAPSE_PERCENT_NECROSIS"},{"attribute_name":"RELAPSE_PERCENT_STROMA"},{"attribute_name":"RISK_GROUP"},{"attribute_name":"SAMPLE_COUNT"},{"attribute_name":"SCENS"},{"attribute_name":"SEX"},{"attribute_name":"SNOMED"},{"attribute_name":"SOMATIC_STATUS"},{"attribute_name":"STIME"},{"attribute_name":"TMB_NONSYNONYMOUS"},{"attribute_name":"TUMOR_PLOIDY"},{"attribute_name":"TUMOR_SAMPLE_HISTOLOGY"},{"attribute_name":"TUMOR_TISSUE_SITE"},{"attribute_name":"YEAR_OF_DIAGNOSIS"}]} ▶ clickhouse_run_select_query { "query": " -- Extract age and survival data, split by age 4 threshold SELECT patient_unique_id, MAX(CASE WHEN attribute_name = 'AGE' THEN toFloat64OrNull(attribute_value) END) AS age, MAX(CASE WHEN attribute_name = 'OS_MONTHS' THEN toFloat64OrNull(attribute_value) END) AS os_months, MAX(CASE WHEN attribute_name = 'OS_STATUS' THEN attribute_value END) AS os_status FROM clinical_data_derived WHERE cancer_study_identifier = 'nbl_target_2018_pub' AND attribute_name IN ('AGE', 'OS_MONTHS', 'OS_STATUS') GROUP BY patient_unique_id HAVING age IS NOT NULL AND os_months IS NOT NULL AND os_status IS NOT NULL ORDER BY age ", "max_rows": 200 } ◀ result {"rows":[{"patient_unique_id":"nbl_target_2018_pub_TARGET-30-PATPXF","age":0,"os_months":62,"os_status":"0:LIVING"},{"patient_unique_id":"nbl_target_2018_pub_TARGET-30-PATAFI","age":1,"os_months":67,"os_status":"0:LIVING"},{"patient_unique_id":"nbl_target_2018_pub_TARGET-30-PARWBC","age":1,"os_months":55,"os_status":"0:LIVING"},{"patient_unique_id":"nbl_target_2018_pub_TARGET-30-PASBZV","age":1,"os_months":1,"os_status":"1:DECEASED"},{"patient_unique_id":"nbl_target_2018_pub_TARGET-30-PATPNR","age":1,"os_months":59,"os_status":"0:LIVING"},{"patient_unique_id":"nbl_target_2018_pub_TARGET-30-PASMUB","age":1,"os_months":68,"os_status":"0:LIVING"},{"patient_unique_id":"nbl_target_2018_pub_TARGET-30-PAKHAE","age":1,"os_months":162,"os_status":"0:LIVING"},{"patient_unique_id":"nbl_target_2018_pub_TARGET-30-PASTMW","age":1,"os_months":64,"os_status":"0:LIVING"},{"patient_unique_id":"nbl_target_2018_pub_TARGET-30-PASUCU","age":1,"os_months":65,"os_status":"0:LIVING"},{"patient_unique_id":"nbl_target_2018_pub_TARGET-30-PAUGRP","age":1,"os_months":47,"os_status":"0:LIVING"},{"patient_unique_id":"nbl_target_2018_pub_TARGET-30-PAMZSH","age":1,"os_months":110,"os_status":"0:LIVING"},{"patient_unique_id":"nbl_target_2018_pub_TARGET-30-PARHAM","age":1,"os_months":82,"os_status":"1:DECEASED"},{"patient_unique_id":"nbl_target_2018_pub_TARGET-30-PAULVH","age":1,"os_months":48,"os_status":"0:LIVING"},{"patient_unique_id":"nbl_target_2018_pub_TARGET-30-PASPSE","age":1,"os_months":78,"os_status":"0:LIVING"},{"patient_unique_id":"nbl_target_2018_pub_TARGET-30-PATCDJ","age":1,"os_months":11,"os_status":"1:DECEASED"},{"patient_unique_id":"nbl_target_2018_pub_TARGET-30-PASVYV","age":1,"os_months":62,"os_status":"0:LIVING"},{"patient_unique_id":"nbl_target_2018_pub_TARGET-30-PALFSE","age":1,"os_months":95,"os_status":"0:LIVING"},{"patient_unique_id":"nbl_target_2018_pub_TARGET-30-PASFWL","age":1,"os_months":81,"os_status":"0:LIVING"},{"patient_unique_id":"nbl_target_2018_pub_TARGET-30-PASEWX","age":1,"os_months":72,"os_status":"0:LIVING"},{"patient_unique_id":"nbl_target_2018_pub_TARGET-30-PASPBY","age":1,"os_months":74,"os_status":"0:LIVING"},{"patient_unique_id":"nbl_target_2018_pub_TARGET-30-PAMAJT","age":1,"os_months":91,"os_status":"0:LIVING"},{"patient_unique_id":"nbl_target_2018_pub_TARGET-30-PAURCG","age":1,"os_months":20,"os_status":"1:DECEASED"},{"patient_unique_id":"nbl_target_2018_pub_TARGET-30-PAVDYS","age":1,"os_months":35,"os_status":"0:LIVING"},{"patient_unique_id":"nbl_target_2018_pub_TARGET-30-PASZTV","age":1,"os_months":64,"os_status":"0:LIVING"},{"patient_unique_id":"nbl_target_2018_pub_TARGET-30-PAUZRC","age":1,"os_months":33,"os_status":"0:LIVING"},{"patient_unique_id":"nbl_target_2018_pub_TARGET-30-PARJVP","age":1,"os_months":68,"os_status":"0:LIVING"},{"patient_unique_id":"nbl_target_2018_pub_TARGET-30-PAPICY","age":1,"os_months":7,"os_status":"0:LIVING"},{"patient_unique_id":"nbl_target_2018_pub_TARGET-30-PASCFA","age":1,"os_months":81,"os_status" … (18755 more chars) ▶ clickhouse_run_select_query { "query": " -- Compare survival by age at diagnosis: younger than 4 vs 4 or older SELECT CASE WHEN age < 4 THEN '<4 years' ELSE '≥4 years' END AS age_group, COUNT(DISTINCT patient_unique_id) AS n_patients, COUNT(DISTINCT CASE WHEN os_status = '1:DECEASED' THEN patient_unique_id END) AS n_events, COUNT(DISTINCT CASE WHEN os_status = '0:LIVING' THEN patient_unique_id END) AS n_censored, round(COUNT(DISTINCT CASE WHEN os_status = '1:DECEASED' THEN patient_unique_id END) * 100.0 / COUNT(DISTINCT patient_unique_id), 1) AS event_percent, quantile(0.5)(os_months) AS median_followup_months, min(os_months) AS min_followup_months, max(os_months) AS max_followup_months FROM ( SELECT patient_unique_id, MAX(CASE WHEN attribute_name = 'AGE' THEN toFloat64OrNull(attribute_value) END) AS age, MAX(CASE WHEN attribute_name = 'OS_MONTHS' THEN toFloat64OrNull(attribute_value) END) AS os_months, MAX(CASE WHEN attribute_name = 'OS_STATUS' THEN attribute_value END) AS os_status FROM clinical_data_derived WHERE cancer_study_identifier = 'nbl_target_2018_pub' AND attribute_name IN ('AGE', 'OS_MONTHS', 'OS_STATUS') GROUP BY patient_unique_id HAVING age IS NOT NULL AND os_months IS NOT NULL AND os_status IS NOT NULL ) GROUP BY age_group ORDER BY age_group DESC ", "max_rows": 50 } ◀ result {"rows":[{"age_group":"≥4 years","n_patients":417,"n_events":195,"n_censored":222,"event_percent":46.8,"median_followup_months":50,"min_followup_months":1,"max_followup_months":183},{"age_group":"<4 years","n_patients":655,"n_events":202,"n_censored":453,"event_percent":30.8,"median_followup_months":59,"min_followup_months":1,"max_followup_months":183}]} ═ answer (success) Perfect! Now I have the data. Let me create a summary and explain the statistical approach: ## Survival Analysis: Younger vs. Older Neuroblastoma Patients (TARGET 2018) **Study:** Pediatric Neuroblastoma (TARGET, 2018) — `nbl_target_2018_pub` **Patients:** 1,072 patients with complete age and overall survival (OS) data ### Summary by Age Group | Age at Diagnosis | N Patients | Deaths (Events) | Censored (Alive) | Event Rate | Median Follow-up | |---|---|---|---|---|---| | **<4 years** | 655 | 202 | 453 | 30.8% | 59 months | | **≥4 years** | 417 | 195 | 222 | 46.8% | 50 months | ### Key Findings **Survival Difference:** - Patients diagnosed **age <4** experienced 202 deaths (30.8% event rate) - Patients diagnosed **age ≥4** experienced 195 deaths (46.8% event rate) - **Absolute difference in event rate: 16 percentage points** (older patients had higher mortality) ### Statistical Significance **I cannot compute the p-value directly** — ClickHouse lacks built-in statistical test functions. However, the appropriate test for this comparison is the **log-rank test** applied to Kaplan-Meier survival curves, since survival data are censored (some patients are still alive). **To obtain the p-value and hazard ratio, use one of these approaches:** 1. **cBioPortal Group Comparison (recommended):** Open the [Pediatric Neuroblastoma (TARGET, 2018) study](https://www.cbioportal.org/study/summary?id=nbl_target_2018_pub) and navigate to the **Group Comparison → Survival tab** with groups split by age at diagnosis (<4 vs. ≥4). 2. **R (lifelines):** ```r library(survival) fit <- survfit(Surv(os_months, os_status_binary) ~ age_group, data = your_data) logrank_test <- survdiff(Surv(os_months, os_status_binary) ~ age_group, data = your_data) # logrank_test$pvalue gives the p-value ``` 3. **Python (lifelines):** ```python from lifelines.statistics import logrank_test results = logrank_test(T1=younger$os_months, E1=younger$os_status_binary, T2=older$os_months, E2=older$os_status_binary) print(f"p-value: {results.p_value}") ``` ### Clinical Interpretation Patients **diagnosed at age ≥4 years had a notably higher event rate (46.8% vs. 30.8%)**, suggesting worse overall survival compared to younger patients. This is consistent with known prognostic factors in pediatric neuroblastoma, where age >18 months (or >2-4 years depending on the risk stratification system) is associated with worse outcomes. However, **a formal Kaplan-Meier + log-rank test is required to determine if this difference is statistically significant** — the raw percentages alone cannot establish significance.