Q (sonnet): what's the best way to put clinical data into cbioportal? ═ answer (success) The best approach depends on whether you're contributing to the public cBioPortal or loading data into your own local/institutional instance. Here's a general overview — this is general cBioPortal usage guidance, not something I retrieved from the database: ## 1. Format your clinical data as tab-delimited files cBioPortal expects clinical data in one or two files: - **`data_clinical_patient.txt`** — patient-level attributes (e.g., SEX, AGE, OS_STATUS, OS_MONTHS) - **`data_clinical_sample.txt`** — sample-level attributes (e.g., SAMPLE_ID, CANCER_TYPE, TUMOR_PURITY) Each file needs: - A `#`-prefixed metadata header block (4 lines: attribute display name, description, datatype, priority) - A header row with column names (must include `PATIENT_ID` for patient file, `PATIENT_ID` + `SAMPLE_ID` for sample file) - One row per patient/sample ## 2. Add a metadata file A `meta_clinical_patient.txt` / `meta_clinical_sample.txt` file describing the study, cancer type, and pointing to the data file (`data_filename`, `genetic_alteration_type: CLINICAL`, etc.) ## 3. Load it in - **Local/Docker instance:** use the `MetaImport.py` / `cbioportalImporter.py` scripts bundled with cBioPortal, or the Docker-based import workflow described in the [cBioPortal documentation](https://docs.cbioportal.org/file-formats/#clinical-data). - **Updating an existing study's clinical data only:** cBioPortal supports incremental clinical data import without reloading genomic data. - **Public cBioPortal.org:** you cannot upload directly — you'd submit a study for review via the [cBioPortal GitHub datahub](https://github.com/cBioPortal/datahub) or contact the cBioPortal team. ## 4. Validate before loading Run the built-in `validateData.py` script to catch formatting errors (missing required columns, malformed headers, mismatched sample/patient IDs) before import. 📖 Full file format specification: https://docs.cbioportal.org/file-formats/#clinical-data 📖 Data loading pipeline: https://docs.cbioportal.org/using-a-local-cbioportal/#loading-data-into-cbioportal If you're trying to add or update clinical data for a study that's already loaded in a portal you manage, let me know and I can point you to the more targeted incremental-import instructions. If instead you want to explore existing clinical data for a specific study already on cBioPortal, I can help you query or visualize that directly.