Q (haiku): What are the top 5 most common primary diagnosis sites in the MSK-CHORD Study? ▶ read_guide { "uri": "cbioportal://clinical-data-guide" } ▶ list_studies { "search": "MSK-CHORD" } ◀ 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) ◀ result {"result":[{"cancer_study_identifier":"msk_chord_2024","name":"MSK-CHORD (MSK, Nature 2024)","type_of_cancer_id":"mixed","sample_count":25040,"has_guide":true,"url":"https://www.cbioportal.org/study/summary?id=msk_chord_2024"}]} ▶ 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 = 'msk_chord_2024' ) AND ( LOWER(attr_id) LIKE '%diagnosis%' OR LOWER(attr_id) LIKE '%site%' OR LOWER(attr_id) LIKE '%primary%' OR LOWER(description) LIKE '%diagnosis%' OR LOWER(description) LIKE '%site%' ) ORDER BY attr_id ", "max_rows": 50 } ◀ result {"rows":[{"attr_id":"ADRENAL_GLANDS","description":"DESCRIPTION: History of Adrenal Gland as a tumor site as indicated in radiology report impression ---MISSING DATA: No CT/PET/MRI radiology report available for patient. impression section MISSING from report. ---SOURCE:(CDM) Generated (NLP)"},{"attr_id":"BONE","description":"DESCRIPTION: History of Bone as a tumor site as indicated in radiology report impression ---MISSING DATA: No CT/PET/MRI radiology report available for patient. impression section MISSING from report. ---SOURCE:(CDM) Generated (NLP)"},{"attr_id":"CNS_BRAIN","description":"DESCRIPTION: History of CNS/Brain as a tumor site as indicated in radiology report impression ---MISSING DATA: No CT/PET/MRI radiology report available for patient. impression section MISSING from report. ---SOURCE:(CDM) Generated (NLP)"},{"attr_id":"DIAGNOSIS_DESCRIPTION","description":"Diagnosis Description"},{"attr_id":"LIVER","description":"DESCRIPTION: History of Liver as a tumor site as indicated in radiology report impression ---MISSING DATA: No CT/PET/MRI radiology report available for patient. impression section MISSING from report. ---SOURCE:(CDM) Generated (NLP)"},{"attr_id":"LUNG","description":"DESCRIPTION: History of Lung as a tumor site as indicated in radiology report impression ---MISSING DATA: No CT/PET/MRI radiology report available for patient. impression section MISSING from report. ---SOURCE:(CDM) Generated (NLP)"},{"attr_id":"LYMPH_NODES","description":"DESCRIPTION: History of LN as a tumor site as indicated in radiology report impression ---MISSING DATA: No CT/PET/MRI radiology report available for patient. impression section MISSING from report. ---SOURCE:(CDM) Generated (NLP)"},{"attr_id":"METASTATIC_SITE","description":"Location of profiled metastatic site"},{"attr_id":"OTHER","description":"DESCRIPTION: History of another site as a tumor site as indicated in radiology report impression ---MISSING DATA: No CT/PET/MRI radiology report available for patient. impression section MISSING from report. ---SOURCE:(CDM) Generated (NLP)"},{"attr_id":"PLEURA","description":"DESCRIPTION: History of Pleura as a tumor site as indicated in radiology report impression ---MISSING DATA: No CT/PET/MRI radiology report available for patient. impression section MISSING from report. ---SOURCE:(CDM) Generated (NLP)"},{"attr_id":"PRIMARY_SITE","description":"The organ sub-division term assigned to the primary tumor location of the sample. Source: MPath"},{"attr_id":"REPRODUCTIVE_ORGANS","description":"DESCRIPTION: History of Reproductive Organs as a tumor site as indicated in radiology report impression ---MISSING DATA: No CT/PET/MRI radiology report available for patient. impression section MISSING from report. ---SOURCE:(CDM) Generated (NLP)"}]} ▶ clickhouse_run_select_query { "query": " SELECT attribute_value AS primary_site, COUNT(DISTINCT patient_unique_id) AS patient_count, COUNT(DISTINCT sample_unique_id) AS sample_count, ROUND(100.0 * COUNT(DISTINCT patient_unique_id) / (SELECT COUNT(DISTINCT patient_unique_id) FROM clinical_data_derived WHERE cancer_study_identifier = 'msk_chord_2024' AND attribute_name = 'PRIMARY_SITE' AND attribute_value != ''), 2) AS pct_of_patients FROM clinical_data_derived WHERE cancer_study_identifier = 'msk_chord_2024' AND attribute_name = 'PRIMARY_SITE' AND attribute_value != '' GROUP BY attribute_value ORDER BY patient_count DESC LIMIT 5 ", "max_rows": 10 } ◀ result {"rows":[{"primary_site":"Lung","patient_count":7773,"sample_count":7773,"pct_of_patients":31.15},{"primary_site":"Breast","patient_count":5358,"sample_count":5358,"pct_of_patients":21.47},{"primary_site":"Prostate","patient_count":3208,"sample_count":3208,"pct_of_patients":12.86},{"primary_site":"Pancreas","patient_count":3104,"sample_count":3104,"pct_of_patients":12.44},{"primary_site":"Colon","patient_count":2516,"sample_count":2516,"pct_of_patients":10.08}]} ═ answer (success) ## Top 5 Most Common Primary Diagnosis Sites in MSK-CHORD Based on the MSK-CHORD study (25,040 samples), here are the top 5 most common primary diagnosis sites: | Rank | Primary Site | Patients | % of Cohort | |------|--------------|----------|------------| | 1 | **Lung** | 7,773 | 31.15% | | 2 | **Breast** | 5,358 | 21.47% | | 3 | **Prostate** | 3,208 | 12.86% | | 4 | **Pancreas** | 3,104 | 12.44% | | 5 | **Colon** | 2,516 | 10.08% | **Key observations:** - Lung cancer dominates the cohort, accounting for nearly one-third of all patients. - The top 5 sites together represent ~88% of the MSK-CHORD patient population. - These sites reflect common malignancies in MSK's clinical practice (a tertiary cancer center). [View MSK-CHORD in cBioPortal](https://www.cbioportal.org/study/summary?id=msk_chord_2024)