Q (haiku): What fraction of patients were older than five when diagnosed according to the Pediatric Neuroblastoma study from TARGET? ▶ list_studies { "search": "TARGET neuroblastoma", "limit": "10" } ✗ error Error: No such tool available: mcp__navigator__list_studies ▶ read_guide { "uri": "cbioportal://clinical-data-guide" } ◀ result # Clinical Data Query Guide ## Overview Clinical data in cBioPortal is stored at both patient and sample levels. Understanding the distinction is crucial for accurate analysis. ## Data Organization ### Patient-Level vs Sample-Level Data - **Patient-level**: Demographics, overall survival, disease stage (stored once per patient) - **Sample-level**: Sample type, sequencing platform, purity (can have multiple per patient) ### Key Tables - `clinical_patient`: Patient-level clinical attributes - `clinical_sample`: Sample-level clinical attributes - `clinical_data_derived`: Pre-joined view combining both levels - `clinical_attribute_meta`: Metadata about available clinical attributes ## Recommended Approach: Use clinical_data_derived The `clinical_data_derived` table is pre-joined and optimized for most queries: ```sql -- Get clinical data for specific attributes SELECT sample_unique_id, patient_unique_id, attribute_name, attribute_value FROM clinical_data_derived WHERE cancer_study_identifier = 'your_study_id' AND attribute_name IN ('CANCER_TYPE', 'SAMPLE_TYPE', 'TMB_NONSYNONYMOUS'); ``` ## Clinical Attribute Discovery ### Use clinical_attribute_meta for Discovering Available Attributes **Always start here** to see what clinical attributes are available for a specific study: ```sql -- Discover available clinical attributes for a study SELECT attr_id, description, patient_attribute, cancer_study_id FROM clinical_attribute_meta WHERE cancer_study_id = ( SELECT cancer_study_id FROM cancer_study WHERE cancer_study_identifier = 'your_study_id' ) ORDER BY patient_attribute, attr_id; ``` **Key Fields:** - **attr_id**: matches attr_id in clinical_sample/clinical_patient tables - **description**: human-readable description of the attribute - **patient_attribute**: true = patient attribute, false = sample attribute - **cancer_study_id**: links to cancer_study table (filter by study) ## Attribute Semantics and Matching ### Case-Insensitive Matching for Attribute Values Clinical values are free text across studies and may differ only by case. For example, a controlled-looking value such as germline mutation status may appear as `GERMLINE`, `Germline`, or another case variant. When filtering `clinical_data_derived.attribute_value`, use case-insensitive matching unless you have already profiled the exact values in the target study: ```sql -- Correct: case-insensitive clinical value filter SELECT DISTINCT sample_unique_id, patient_unique_id FROM clinical_data_derived WHERE cancer_study_identifier = 'your_study_id' AND attribute_name = 'MUTATION_STATUS' AND upper(attribute_value) = 'GERMLINE'; ``` Do not write `attribute_value = 'GERMLINE'` without first checking all distinct values for that attribute in the study. ### Query the Requested Attribute, Not a Proxy Do not infer one clinical attribute from a related subtype or marker. Query the actual requested attribute when it … (17073 more chars) ▶ list_studies { "search": "TARGET neuroblastoma", "limit": 10 } ◀ result {"result":[{"cancer_study_identifier":"nbl_target_gdc","name":"Neuroblastoma (TARGET GDC, 2025)","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)","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)","type_of_cancer_id":"nbl","sample_count":223,"has_guide":false,"url":"https://www.cbioportal.org/study/summary?id=nbl_msk_2023"}]} ▶ clickhouse_list_table_columns { "table": "clinical_attribute_meta" } ◀ result {"columns":[{"name":"attr_id","type":"String"},{"name":"display_name","type":"String"},{"name":"description","type":"String"},{"name":"datatype","type":"String"},{"name":"patient_attribute","type":"Int32"},{"name":"priority","type":"String"},{"name":"cancer_study_id","type":"Int64"}]} ▶ clickhouse_run_select_query { "query": " SELECT DISTINCT attr_id, description FROM clinical_attribute_meta WHERE cancer_study_id = ( SELECT cancer_study_id FROM cancer_study WHERE cancer_study_identifier = 'nbl_target_2018_pub' ) AND attr_id ILIKE '%AGE%' ORDER BY attr_id; ", "max_rows": 50 } ◀ result {"rows":[{"attr_id":"AGE","description":"Age at which a condition or disease was first diagnosed."},{"attr_id":"AGE_IN_DAYS","description":"Age at which a condition or disease was first diagnosed."},{"attr_id":"INSS_STAGE","description":"Staging according to the International Neuroblastoma Staging System"},{"attr_id":"PERCENTAGE_NECROSIS","description":"Percent necrosis."},{"attr_id":"PERCENTAGE_TUMOR_PURITY","description":"Percent tumor purity."}]} ▶ clickhouse_run_select_query { "query": " -- Check age distribution in the study to see if AGE is floored SELECT MIN(toFloat64OrNull(attribute_value)) AS min_age, MAX(toFloat64OrNull(attribute_value)) AS max_age, COUNT(*) as total_rows, COUNTIF(toFloat64OrNull(attribute_value) = 18) as at_min_18, COUNTIF(toFloat64OrNull(attribute_value) IS NOT NULL) as non_null_age FROM clinical_data_derived WHERE cancer_study_identifier = 'nbl_target_2018_pub' AND attribute_name = 'AGE'; ", "max_rows": 50 } ◀ result {"error_message":"Query execution failed: HTTPDriver for https://dl96orhu96.us-east-1.aws.clickhouse.cloud:8443 received ClickHouse error code 46\n Code: 46. DB::Exception: Function with name `COUNTIF` does not exist. In scope SELECT MIN(toFloat64OrNull(attribute_value)) AS min_age, MAX(toFloat64OrNull(attribute_value)) AS max_age, COUNT(*) AS total_rows, COUNTIF(toFloat64OrNull(attribute_value) = 18) AS at_min_18, COUNTIF(toFloat64OrNull(attribute_value) IS NOT NULL) AS non_null_age FROM clinical_data_derived WHERE (cancer_study_identifier = 'nbl_target_2018_pub') AND (attribute_name = 'AGE'). Maybe you meant: ['count']. (UNKNOWN_FUNCTION) (version 26.4.1.2359 (official build))\n"} ▶ clickhouse_run_select_query { "query": " -- Check age distribution in the study SELECT MIN(toFloat64OrNull(attribute_value)) AS min_age, MAX(toFloat64OrNull(attribute_value)) AS max_age, COUNT(*) as total_rows, countIf(toFloat64OrNull(attribute_value) = 18) as at_min_18, countIf(toFloat64OrNull(attribute_value) IS NOT NULL) as non_null_age FROM clinical_data_derived WHERE cancer_study_identifier = 'nbl_target_2018_pub' AND attribute_name = 'AGE'; ", "max_rows": 50 } ◀ result {"rows":[{"min_age":0,"max_age":21,"total_rows":1076,"at_min_18":1,"non_null_age":1076}]} ▶ clickhouse_run_select_query { "query": " -- Count patients older than 5 at diagnosis WITH patient_ages AS ( SELECT DISTINCT patient_unique_id, anyIf(toFloat64OrNull(attribute_value), attribute_name = 'AGE') as age_at_diagnosis FROM clinical_data_derived WHERE cancer_study_identifier = 'nbl_target_2018_pub' AND attribute_name = 'AGE' GROUP BY patient_unique_id ) SELECT COUNT(*) as total_patients, countIf(age_at_diagnosis > 5) as older_than_5, round(100.0 * countIf(age_at_diagnosis > 5) / COUNT(*), 2) as pct_older_than_5 FROM patient_ages WHERE age_at_diagnosis IS NOT NULL; ", "max_rows": 50 } ◀ result {"rows":[{"total_patients":1076,"older_than_5":125,"pct_older_than_5":11.62}]} ▶ resolve_and_route { "studyIds": [ "nbl_target_2018_pub" ] } ◀ result {"success":true,"message":"Found 1 study. Use the metadata to call the appropriate navigation tool(s).","data":{"totalCount":1,"studiesWithMetadata":[{"studyId":"nbl_target_2018_pub","name":"Pediatric Neuroblastoma (TARGET, 2018)","sampleCount":1089,"studyViewUrl":"https://www.cbioportal.org/study?id=nbl_target_2018_pub","metadata":{"clinicalAttributeIds":["AGE","AGE_IN_DAYS","ANALYSIS_COHORT","CANCER_TYPE","CANCER_TYPE_DETAILED","CNS_SITE_OF_RELAPSE","DIAGNOSIS","EFSCENS","EFS_TIME","ETHNICITY","FIRST_EVENT","FRACTION_GENOME_ALTERED","GRADE","ICDO","ICDO_SNOMED_DESCRIPTION","INSS_STAGE","LAST_FOLLOWUP_YEAR","MKI","MUTATION_COUNT","MYCN","ONCOTREE_CODE","OS_DAYS","OS_MONTHS","OS_STATUS","PERCENTAGE_NECROSIS","PERCENTAGE_TUMOR_PURITY","PERCENT_TUMOR_CELLS_RELAPSE","PERCENT_TUMOR_VS_STROMA","PLOIDY","PROTOCOL","RACE","RELAPSE_PERCENT_NECROSIS","RELAPSE_PERCENT_STROMA","RISK_GROUP","SAMPLE_COUNT","SCENS","SEX","SNOMED","SOMATIC_STATUS","STIME","TMB_NONSYNONYMOUS","TUMOR_PLOIDY","TUMOR_SAMPLE_HISTOLOGY","TUMOR_TISSUE_SITE","YEAR_OF_DIAGNOSIS"],"molecularProfileIds":["nbl_target_2018_pub_gistic","nbl_target_2018_pub_mrna","nbl_target_2018_pub_mrna_median_Zscores","nbl_target_2018_pub_mrna_median_all_sample_Zscores","nbl_target_2018_pub_mutations","nbl_target_2018_pub_rna_seq_mrna","nbl_target_2018_pub_rna_seq_mrna_median_Zscores","nbl_target_2018_pub_rna_seq_mrna_median_all_sample_Zscores"],"heatmapProfileIds":["nbl_target_2018_pub_mrna_median_Zscores","nbl_target_2018_pub_mrna_median_all_sample_Zscores","nbl_target_2018_pub_rna_seq_mrna_median_Zscores","nbl_target_2018_pub_rna_seq_mrna_median_all_sample_Zscores"],"availableComparisonTabs":["overlap","clinical","survival","alterations","mutations","mrna"]}}]}} ═ answer (success) ## Answer In the **Pediatric Neuroblastoma (TARGET, 2018)** study, **125 out of 1,076 patients (11.62%)** were older than 5 years old at diagnosis. This means that the vast majority (~88%) of patients were diagnosed at age 5 or younger, which is consistent with neuroblastoma typically manifesting in very young children. [View the study](https://www.cbioportal.org/study?id=nbl_target_2018_pub)