Q (sonnet): Can you analyze thyroid hormone gene expression by diagnosis in the Pediatric Brain Tumor Atlas (PBTA, Provisional) cohort? ▶ list_guides {} ▶ resolve_and_route { "studyKeywords": [ "PBTA", "Pediatric Brain Tumor", "Provisional" ] } ◀ result {"result":[{"uri":"cbioportal://mutation-frequency-guide","description":"Comprehensive guide for calculating gene mutation frequencies with gene-specific profiling denominators"},{"uri":"cbioportal://clinical-data-guide","description":"Guide for querying clinical data including patient vs sample level considerations"},{"uri":"cbioportal://sample-filtering-guide","description":"Guide for filtering samples and studies in cBioPortal queries"},{"uri":"cbioportal://common-pitfalls","description":"Guide to avoid common mistakes when querying cBioPortal data. If you already know which numbered pitfall applies, fetch just that section via read_guide(\"cbioportal://common-pitfalls#\") (e.g. #16) instead of the full guide"},{"uri":"cbioportal://treatment-guide","description":"Guide for querying treatment/clinical event data including drug agents, timelines, and linking to genomic data"},{"uri":"cbioportal://faq-guide","description":"General cBioPortal FAQ: history, how to cite, data types, reference genome, abbreviations, GISTIC thresholds, API access"},{"uri":"cbioportal://statistical-tests-guide","description":"Statistical test selection guide — decision matrix for choosing Fisher's exact, Wilcoxon, chi-squared, t-test, ANOVA, etc. based on data type and group count"},{"uri":"cbioportal://gene-expression-guide","description":"Gene expression / copy-number / methylation analysis. Covers genetic_alteration_derived, profile_type discovery, and the gene_pair_coexpression view for Spearman correlation between two genes"},{"uri":"cbioportal://external-resources-guide","description":"Guide for finding external linked resources such as imaging, pathology, Minerva, HTAN, or other resource_* table links before declaring data unavailable"},{"uri":"cbioportal://gene-resolution-guide","description":"Guide for resolving ambiguous gene symbols, aliases, gene families, and shorthand such as CD3 before querying expression or alteration data"},{"uri":"cbioportal://study-resolution-guide","description":"Guide for resolving requested studies, avoiding silent substitute cohorts, and redirecting to known external cBioPortal instances when data is not in this deployment"},{"uri":"cbioportal://germline-guide","description":"Guide for querying germline variant data — storage columns, study discovery, query patterns, and somatic vs germline considerations"},{"uri":"cbioportal://study-guide/{study_id}","description":"Dynamic study-specific guide - use get_study_guide(study_id) tool to generate"}]} ◀ result {"success":false,"error":"No matching studies found","details":{"searchTerms":["PBTA","Pediatric Brain Tumor","Provisional"]}} ▶ read_guide { "uri": "cbioportal://gene-expression-guide" } ◀ result # Gene Expression Analysis Guide This guide covers continuous-value genomic data: gene **expression**, **copy number** values, **methylation**, and related profile types. Mutation/CNA/SV *frequency* analysis lives in `cbioportal://mutation-frequency-guide`. ## Where this data lives Continuous per-sample-per-gene values are stored in `genetic_alteration_derived`: | Column | Description | |---|---| | `sample_unique_id` | `_` | | `cancer_study_identifier` | study scope | | `hugo_gene_symbol` | gene | | `profile_type` | which assay/normalization (see below) | | `alteration_value` | the actual value — stored as Nullable(String); cast with `toFloat64OrNull` | `alteration_value` is a string because the same column hosts many different value scales. The `''` and `'NA'` sentinels mean "missing"; always filter them out and use `toFloat64OrNull(alteration_value) IS NOT NULL` for downstream math. ## Discovering profile types for a study Different studies expose different profile types depending on what assays were run and how the data was normalized. Always check what a specific study supports before picking one: ```sql SELECT DISTINCT profile_type FROM genetic_alteration_derived WHERE cancer_study_identifier = 'brca_metabric' ORDER BY profile_type; ``` Common values across the public portal: | Family | Profile types | |---|---| | mRNA expression | `mrna`, `mrna_median_Zscores`, `mrna_seq_v2_rsem`, `mrna_seq_v2_rsem_Zscores`, `mrna_seq_cpm`, `mrna_seq_fpkm`, `mrna_U133`, `mrna_outliers` | | Copy number (continuous) | `cna`, `linear_CNA`, `log2CNA`, `cna_consensus`, `cna_rae`, `gistic` | | Methylation | `methylation_hm27`, `methylation_hm450`, `methylation_epic`, `methylation_promoters_rrbs` | | miRNA | `mirna`, `mirna_median_Zscores` | | Protein | `protein_quantification`, `protein_level`, `RPPA` | **Z-score vs raw choice.** When the user asks "is X correlated with Y", either works for Spearman (rank-based) — Pearson would care. Default to the non-Z-score variant if both exist, and call out which one in the response. ## Canonical recipe — Spearman correlation between two genes ```sql SELECT * FROM gene_pair_coexpression( study = 'brca_metabric', gene_a = 'TP53', gene_b = 'MYC', profile_type = 'mrna' ); ``` Returns one row: `(gene_a, gene_b, profile_type, spearman_correlation, num_samples)`. - `spearman_correlation` in [−1, 1]; `NULL` when fewer than 3 valid paired samples. - Mirrors cbioportal-backend's `ClickhouseCoExpressionMapper.getCoExpressions`, simplified to a pair lookup (the backend computes one ref gene vs ALL other genes for the coexpression page; here the agent asks about a specific pair). ### Verified examples | Study | gene_a | gene_b | profile_type | spearman | n | |---|---|---|---|---|---| | `brca_metabric` | TP53 | MYC | `mrna` | 0.118 | 1980 | | `brca_metabric` | ESR1 | PGR | `mrna` | 0.487 | 1980 | ESR1↔PGR is the textbook breast-cancer estrogen-receptor coregula … (2785 more chars) ▶ read_guide { "uri": "cbioportal://study-resolution-guide" } ◀ result # Study Resolution Guide Use this guide when the user names a study, cohort, portal, or data source that may not exist in the connected cBioPortal deployment. ## Routing Triggers Read this guide when the user mentions: - PBTA, Pediatric Brain Tumor Atlas, pediatric cBioPortal, Kids First - GENIE, AACR GENIE, MSK private cohorts, institutional cohorts - "download study", "which study", "find cohort", "data from [portal]" - a named cohort that `list_studies(search=...)` does not find ## Core Rules 1. Resolve the requested study before substituting another study. 2. If the requested study is not in this deployment, say so explicitly. 3. Do not silently analyze a substitute cohort. 4. If the user agrees to a substitute, keep a one-line scope caveat when reporting numbers. ## Known External cBioPortal Instances These are not necessarily queryable from this MCP server, but they are useful redirects: | User wording | Likely external instance | Scope | |---|---|---| | PBTA, Pediatric Brain Tumor Atlas, pediatric brain tumors | https://pedcbioportal.kidsfirstdrc.org/ | Pediatric cancer studies, including pediatric brain tumor cohorts | | GENIE | https://genie.cbioportal.org/ | AACR GENIE data access, depending on release and permissions | | MSK private / institutional cohorts | private institutional cBioPortal deployments | Not queryable from public cBioPortal unless exported to the public database | ## Study Resolution Workflow 1. Call `list_studies(search=...)` with the user's exact study/cohort phrase and close variants. 2. If a cancer type is mentioned, call `search_oncotree(search_term)` before disease-level study discovery. 3. If no matching study is found, check known external instances above before declaring the study absent. 4. If proposing a substitute, describe why it is a substitute and how its scope differs. ## Substitute-Cohort Answer Pattern > I cannot query PBTA from this cBioPortal deployment. PBTA is typically accessed through pediatric cBioPortal at https://pedcbioportal.kidsfirstdrc.org/. I can analyze `[substitute_study_id]` here, but its results should not be interpreted as PBTA results. When reporting numbers from a substitute: > Scope note: these counts are from `[substitute_study_id]` in this deployment, not from the requested PBTA cohort. ## Do Not - Do not answer a PBTA question with `brain_cptac_2020` numbers without a scope warning. - Do not let later turns drop the substitute-cohort warning. - Do not claim a study does not exist globally; say it is not available in the connected deployment. ▶ list_studies { "search": "Pediatric Brain Tumor" } ▶ resolve_and_route { "studyKeywords": [ "pediatric", "brain", "tumor" ] } ◀ result {"result":[{"cancer_study_identifier":"brain_cptac_2020","name":"Pediatric Brain Cancer (CPTAC/CHOP, Cell 2020)","type_of_cancer_id":"brain","sample_count":218,"has_guide":false,"url":"https://www.cbioportal.org/study/summary?id=brain_cptac_2020"}]} ◀ result {"success":true,"message":"Found 1 study. Use the metadata to call the appropriate navigation tool(s).","data":{"totalCount":1,"studiesWithMetadata":[{"studyId":"brain_cptac_2020","name":"Pediatric Brain Cancer (CPTAC/CHOP, Cell 2020)","sampleCount":218,"studyViewUrl":"https://www.cbioportal.org/study?id=brain_cptac_2020","metadata":{"clinicalAttributeIds":["AGE","AGE_AT_CHEMOTHERAPY_START","AGE_AT_CHEMOTHERAPY_STOP","AGE_AT_INITIAL_DIAGNOSIS","AGE_AT_LAST_KNOWN_CLINICAL_STATUS","AGE_AT_RADIATION_START","AGE_AT_RADIATION_STOP","AGE_AT_SPECIMEN_DIAGNOSIS","AGE_CLASS","BRAF_RELA_STATUS","BRAF_STATUS","BRAF_STATUS2","CANCER_PREDISPOSITIONS","CANCER_TYPE","CANCER_TYPE_DETAILED","CHEMOTHERAPY","CHEMOTHERAPY_AGENTS","CHEMOTHERAPY_TYPE","CLINICAL_STATUS_AT_COLLECTION_EVENT","COMPLETED_RADIATION_DOSE","COMPLETED_TOTAL_RADIATION_DOSE","CTNNB1_STATUS","DFS_MONTHS","DFS_STATUS","EPENDYMOMA_RELA_STATUS","ETHNICITY","EXTENT_OF_TUMOR_RESECTION","EXTERNAL_PATIENT_ID","FORMULATION","H3F3A_CTNNB1_STATUS","HGG_H3F3A_STATUS","INITIAL_CNS_TUMOR_DIAGNOSIS_RELATED_TO_OS","INITIAL_DIAGNOSIS_TYPE","LGG_BRAF_STATUS","MEDICAL_CONDITIONS","MULTIPLE_CANCER_PREDISPOSITIONS","MULTIPLE_MEDICAL_CONDITIONS","MULTIPLE_TUMOR_LOCATIONS","MUTATION_COUNT","ONCOTREE_CODE","OS_MONTHS","OS_STATUS","PROTOCOL_AND_TREATMENT_ARM","RACE","RADIATION","RADIATION_SITE","RADIATION_TYPE","SAMPLE_ANNOTATION","SAMPLE_COUNT","SAMPLE_ORIGIN","SEX","SURGERY","TIMING_OTHER_NOTES","TREATMENT","TREATMENT_CHANGED","TREATMENT_STATUS","TUMOR_LOCATION_CONDENSED","TUMOR_TISSUE_SITE","TUMOR_TYPE","UPDATED_GRADE"],"molecularProfileIds":["brain_cptac_2020_cna","brain_cptac_2020_log2CNA","brain_cptac_2020_mutations","brain_cptac_2020_protein_quantification","brain_cptac_2020_protein_quantification_zscores","brain_cptac_2020_rna_seq_v2_mrna","brain_cptac_2020_rna_seq_v2_mrna_median_Zscores"],"genericAssayProfiles":["brain_cptac_2020_phosphoprotein"],"heatmapProfileIds":["brain_cptac_2020_protein_quantification_zscores","brain_cptac_2020_rna_seq_v2_mrna_median_Zscores"],"availableComparisonTabs":["overlap","clinical","survival","alterations","mutations","mrna","protein","generic_assay_phoshoprotein_expression"]}}]}} ═ answer (success) I confirmed the study resolution before proceeding: **PBTA (Pediatric Brain Tumor Atlas)** is not available in this cBioPortal deployment. > I cannot query PBTA from this cBioPortal deployment. PBTA is typically accessed through pediatric cBioPortal at **https://pedcbioportal.kidsfirstdrc.org/**. The closest available substitute here is `brain_cptac_2020` — "Pediatric Brain Cancer (CPTAC/CHOP, Cell 2020)," 218 samples — but its results should not be interpreted as PBTA results (different consortium, different cohort composition and sample size). If you'd like, I can proceed with thyroid hormone gene expression by diagnosis using this substitute cohort. To do that well I need to clarify: 1. **Which genes count as "thyroid hormone genes"?** Common candidates: `THRA`, `THRB` (thyroid hormone receptors), `DIO1`, `DIO2`, `DIO3` (deiodinases), `SLC16A2`/`MCT8`, `TSHR`, `TG`, `TPO`. Please confirm the gene list you want. 2. **"By diagnosis"** — this study's diagnosis-related clinical attribute is `CANCER_TYPE_DETAILED` (and `ONCOTREE_CODE`/`TUMOR_TYPE`). I'd group mRNA expression (`rna_seq_v2_mrna` or Z-scores) by that attribute. Would you like me to: - (a) run this analysis on `brain_cptac_2020` as a substitute, with the scope caveat noted, and/or - (b) stop here since PBTA itself isn't queryable, and instead just give you the pedcbioportal link to run it there yourself? Please confirm the gene list and which option you'd like — I don't want to fabricate a "PBTA" result from a different cohort without your explicit go-ahead.