Q (sonnet-5.5): is there any imaging data? ▶ read_guide { "uri": "cbioportal://external-resources-guide" } ◀ result # External Resources Guide Use this guide when the user asks about data that may be linked from cBioPortal rather than stored directly in molecular or clinical tables. ## Routing Triggers Read this guide before answering or refusing questions that mention: - imaging, radiology, CT, MRI, pathology slides, histology, Minerva, viewer - external portal, external resource, image data, spatial data - HTAN studies or study-specific linked viewers ## Core Rule Do not say cBioPortal has no imaging or external-resource data until you have checked: - `resource_definition` - `resource_study` - `resource_sample` - `resource_patient` cBioPortal may store links to external viewers or portals even when it does not store raw images. ## Which Studies Have Imaging Data For "which studies have imaging / pathology slides / CT" or "how many samples have images", read `cancer_study.resource_sample_counts` — per-study sample counts keyed by resource display name, the same numbers as the portal's "Data type" filter. One query, no joins: ```sql SELECT cancer_study_identifier, name, resource_sample_counts['Slide Microscopy'] AS slide_microscopy_samples FROM cancer_study WHERE resource_sample_counts['Slide Microscopy'] > 0 ORDER BY slide_microscopy_samples DESC; ``` List the resource names that exist with `SELECT DISTINCT arrayJoin(mapKeys(resource_sample_counts)) FROM cancer_study` (e.g. `'Slide Microscopy'`, `'Computed Tomography'`, `'Magnetic Resonance'`, `'H&E Slide'`, `'MxIF Image'`). The map counts sample- and patient-level resources only. For study-level links (`resource_study`) and for the URLs themselves, use the queries below. ## Discovery Query Start with table and column validation, then use this pattern: ```sql SELECT rd.resource_id, rd.display_name, rd.description, rd.resource_type, rs.cancer_study_identifier, rs.url FROM resource_study rs JOIN resource_definition rd ON rs.resource_id = rd.resource_id WHERE lower(rd.display_name) LIKE '%minerva%' OR lower(rd.description) LIKE '%minerva%' OR lower(rd.display_name) LIKE '%image%' OR lower(rd.description) LIKE '%image%' OR lower(rd.display_name) LIKE '%pathology%' OR lower(rd.description) LIKE '%pathology%' OR lower(rd.display_name) LIKE '%histology%' OR lower(rd.description) LIKE '%histology%' ORDER BY rs.cancer_study_identifier, rd.display_name LIMIT 100; ``` If no study-level rows appear, check sample- and patient-level resource links: ```sql SELECT rd.resource_id, rd.display_name, rd.description, rs.cancer_study_identifier, rs.sample_unique_id, rs.url FROM resource_sample rs JOIN resource_definition rd ON rs.resource_id = rd.resource_id WHERE lower(rd.display_name) LIKE '%minerva%' OR lower(rd.description) LIKE '%minerva%' OR lower(rd.display_name) LIKE '%image%' OR lower(rd.description) LIKE '%image%' OR lower(rd.display_name) LIKE '%pathology%' OR lower(rd.description) LIKE '%pathology%' … (981 more chars) ▶ clickhouse_run_select_query { "query": "SELECT k AS resource, count() AS studies, sum(v) AS samples FROM (SELECT cancer_study_identifier, arrayJoin(mapKeys(resource_sample_counts)) AS k, resource_sample_counts[k] AS v FROM cancer_study) WHERE v > 0 GROUP BY k ORDER BY samples DESC" } ◀ result {"rows":[{"resource":"Slide Microscopy","studies":31,"samples":10699},{"resource":"Computed Tomography","studies":15,"samples":831},{"resource":"CyCIF","studies":1,"samples":567},{"resource":"Magnetic Resonance","studies":11,"samples":350},{"resource":"H&E Slide","studies":4,"samples":215},{"resource":"MxIF Image","studies":4,"samples":131},{"resource":"Positron Emission Tomography","studies":8,"samples":61},{"resource":"Computed Radiography","studies":3,"samples":9},{"resource":"Digital Radiography","studies":1,"samples":7},{"resource":"Mammography","studies":1,"samples":5},{"resource":"Nuclear Medicine","studies":2,"samples":4}]} ▶ clickhouse_run_select_query { "query": "SELECT rd.display_name, rd.resource_type, count() AS n, min(rs.cancer_study_identifier) AS example_study FROM resource_study rs JOIN resource_definition rd ON rs.resource_id = rd.resource_id AND rs.cancer_study_identifier = rd.cancer_study_identifier GROUP BY rd.display_name, rd.resource_type" } ◀ result {"error_message":"Query execution failed: HTTPDriver for https://dl96orhu96.us-east-1.aws.clickhouse.cloud:8443 received ClickHouse error code 47\n Code: 47. DB::Exception: Identifier 'rs.cancer_study_identifier' cannot be resolved from table with name rs. In scope SELECT rd.display_name, rd.resource_type, count() AS n, min(rs.cancer_study_identifier) AS example_study FROM resource_study AS rs INNER JOIN resource_definition AS rd ON (rs.resource_id = rd.resource_id) AND (rs.cancer_study_identifier = rd.cancer_study_identifier) GROUP BY rd.display_name, rd.resource_type. (UNKNOWN_IDENTIFIER) (version 26.4.1.2509 (official build))\n"} ▶ clickhouse_run_select_query { "query": "SELECT cancer_study_identifier, name, resource_sample_counts['Slide Microscopy'] AS slide, resource_sample_counts['Computed Tomography'] AS ct, resource_sample_counts['Magnetic Resonance'] AS mr, resource_sample_counts['H&E Slide'] AS he, resource_sample_counts['CyCIF'] AS cycif, resource_sample_counts['MxIF Image'] AS mxif FROM cancer_study WHERE slide+ct+mr+he+cycif+mxif > 0 ORDER BY slide+ct+mr+he+cycif+mxif DESC LIMIT 10" } ◀ result {"rows":[{"cancer_study_identifier":"brca_tcga_pan_can_atlas_2018","name":"Breast Invasive Carcinoma (TCGA, PanCancer Atlas)","slide":1084,"ct":0,"mr":136,"he":0,"cycif":0,"mxif":0},{"cancer_study_identifier":"kirc_tcga_pan_can_atlas_2018","name":"Kidney Renal Clear Cell Carcinoma (TCGA, PanCancer Atlas)","slide":512,"ct":221,"mr":60,"he":0,"cycif":0,"mxif":0},{"cancer_study_identifier":"ov_tcga_pan_can_atlas_2018","name":"Ovarian Serous Cystadenocarcinoma (TCGA, PanCancer Atlas)","slide":575,"ct":140,"mr":1,"he":0,"cycif":0,"mxif":0},{"cancer_study_identifier":"coadread_tcga_pan_can_atlas_2018","name":"Colorectal Adenocarcinoma (TCGA, PanCancer Atlas)","slide":594,"ct":21,"mr":0,"he":0,"cycif":0,"mxif":0},{"cancer_study_identifier":"ucec_tcga_pan_can_atlas_2018","name":"Uterine Corpus Endometrial Carcinoma (TCGA, PanCancer Atlas)","slide":529,"ct":65,"mr":8,"he":0,"cycif":0,"mxif":0},{"cancer_study_identifier":"gbm_tcga_pan_can_atlas_2018","name":"Glioblastoma Multiforme (TCGA, PanCancer Atlas)","slide":592,"ct":0,"mr":0,"he":0,"cycif":0,"mxif":0},{"cancer_study_identifier":"luad_tcga_pan_can_atlas_2018","name":"Lung Adenocarcinoma (TCGA, PanCancer Atlas)","slide":514,"ct":60,"mr":0,"he":0,"cycif":0,"mxif":0},{"cancer_study_identifier":"ovary_geomx_gray_foundation_2024","name":"Ovarian Cancer (Gray Foundation, Cancer Discov 2024)","slide":0,"ct":0,"mr":0,"he":0,"cycif":567,"mxif":0},{"cancer_study_identifier":"blca_tcga_pan_can_atlas_2018","name":"Bladder Urothelial Carcinoma (TCGA, PanCancer Atlas)","slide":411,"ct":107,"mr":20,"he":0,"cycif":0,"mxif":0},{"cancer_study_identifier":"lusc_tcga_pan_can_atlas_2018","name":"Lung Squamous Cell Carcinoma (TCGA, PanCancer Atlas)","slide":487,"ct":33,"mr":0,"he":0,"cycif":0,"mxif":0}]} ═ answer (success) Yes. cBioPortal doesn't store the image files. Some studies have links from samples to external image viewers or archives. Counts below are samples with a linked image: | Imaging type | Studies | Linked samples | |---|---|---| | Slide Microscopy (pathology slides) | 31 | 10,699 | | Computed Tomography (CT) | 15 | 831 | | CyCIF (multiplexed imaging) | 1 | 567 | | Magnetic Resonance (MRI) | 11 | 350 | | H&E Slide | 4 | 215 | | MxIF Image | 4 | 131 | | Positron Emission Tomography (PET) | 8 | 61 | | Computed Radiography | 3 | 9 | | Digital Radiography | 1 | 7 | | Mammography | 1 | 5 | | Nuclear Medicine | 2 | 4 | The same study can appear in more than one row, so don't add the rows together. Studies with the most linked images: - [Breast Invasive Carcinoma (TCGA, PanCancer Atlas)](https://www.cbioportal.org/study/summary?id=brca_tcga_pan_can_atlas_2018): 1,084 slides and 136 MR. - [Colorectal Adenocarcinoma (TCGA, PanCancer Atlas)](https://www.cbioportal.org/study/summary?id=coadread_tcga_pan_can_atlas_2018): 594 slides and 21 CT. - [Glioblastoma Multiforme (TCGA, PanCancer Atlas)](https://www.cbioportal.org/study/summary?id=gbm_tcga_pan_can_atlas_2018): 592 slides. - [Ovarian Serous Cystadenocarcinoma (TCGA, PanCancer Atlas)](https://www.cbioportal.org/study/summary?id=ov_tcga_pan_can_atlas_2018): 575 slides, 140 CT and 1 MR. - [Ovarian Cancer (Gray Foundation, Cancer Discov 2024)](https://www.cbioportal.org/study/summary?id=ovary_geomx_gray_foundation_2024): 567 CyCIF. - [Uterine Corpus Endometrial Carcinoma (TCGA, PanCancer Atlas)](https://www.cbioportal.org/study/summary?id=ucec_tcga_pan_can_atlas_2018): 529 slides, 65 CT and 8 MR. - [Kidney Renal Clear Cell Carcinoma (TCGA, PanCancer Atlas)](https://www.cbioportal.org/study/summary?id=kirc_tcga_pan_can_atlas_2018): 512 slides, 221 CT and 60 MR. - [Lung Adenocarcinoma (TCGA, PanCancer Atlas)](https://www.cbioportal.org/study/summary?id=luad_tcga_pan_can_atlas_2018): 514 slides and 60 CT. - [Lung Squamous Cell Carcinoma (TCGA, PanCancer Atlas)](https://www.cbioportal.org/study/summary?id=lusc_tcga_pan_can_atlas_2018): 487 slides and 33 CT. - [Bladder Urothelial Carcinoma (TCGA, PanCancer Atlas)](https://www.cbioportal.org/study/summary?id=blca_tcga_pan_can_atlas_2018): 411 slides, 107 CT and 20 MR. I can list the studies for a particular imaging type, such as CT or MRI. I can also narrow it to a cancer type if you tell me which one.