Q (sonnet): calculate median expression of ceacam5, itgb6, muc2, tpgb and muc1 mRNA in pancreatic cancer ▶ 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) ▶ list_studies { "search": "pancreatic" } ▶ search_oncotree { "search_term": "pancreatic" } ◀ result {"result":[{"cancer_study_identifier":"msk_met_2021","name":"MSK MetTropism (MSK, Cell 2021)","type_of_cancer_id":"mixed","sample_count":25775,"has_guide":false,"url":"https://www.cbioportal.org/study/summary?id=msk_met_2021"},{"cancer_study_identifier":"pdac_msk_2024","name":"Pancreatic Adenocarcinoma (MSK, Nat Med 2024)","type_of_cancer_id":"pancreas","sample_count":2336,"has_guide":false,"url":"https://www.cbioportal.org/study/summary?id=pdac_msk_2024"},{"cancer_study_identifier":"paad_qcmg_uq_2016","name":"Pancreatic Adenocarcinoma (QCMG, Nature 2016)","type_of_cancer_id":"paad","sample_count":456,"has_guide":false,"url":"https://www.cbioportal.org/study/summary?id=paad_qcmg_uq_2016"},{"cancer_study_identifier":"pancreas_ctdna_msk_2025","name":"Pancreatic Cancer cfDNA (MSK, J Natl Cancer Inst 2025)","type_of_cancer_id":"paad","sample_count":412,"has_guide":false,"url":"https://www.cbioportal.org/study/summary?id=pancreas_ctdna_msk_2025"},{"cancer_study_identifier":"pancreas_msk_2024","name":"Pancreatic Cancer (MSK, Cancer Cell 2024)","type_of_cancer_id":"pancreas","sample_count":395,"has_guide":false,"url":"https://www.cbioportal.org/study/summary?id=pancreas_msk_2024"},{"cancer_study_identifier":"paad_tcga_gdc","name":"Pancreatic Adenocarcinoma (TCGA GDC, 2025)","type_of_cancer_id":"paad","sample_count":186,"has_guide":false,"url":"https://www.cbioportal.org/study/summary?id=paad_tcga_gdc"},{"cancer_study_identifier":"paad_tcga","name":"Pancreatic Adenocarcinoma (TCGA, Firehose Legacy)","type_of_cancer_id":"paad","sample_count":186,"has_guide":false,"url":"https://www.cbioportal.org/study/summary?id=paad_tcga"},{"cancer_study_identifier":"paad_tcga_pan_can_atlas_2018","name":"Pancreatic Adenocarcinoma (TCGA, PanCancer Atlas)","type_of_cancer_id":"paad","sample_count":184,"has_guide":false,"url":"https://www.cbioportal.org/study/summary?id=paad_tcga_pan_can_atlas_2018"},{"cancer_study_identifier":"pancreas_cptac_gdc","name":"Pancreatic Cancer (CPTAC GDC, 2025)","type_of_cancer_id":"pancreas","sample_count":183,"has_guide":false,"url":"https://www.cbioportal.org/study/summary?id=pancreas_cptac_gdc"},{"cancer_study_identifier":"paad_cptac_2021","name":"Pancreatic Ductal Adenocarcinoma (CPTAC, Cell 2021)","type_of_cancer_id":"paad","sample_count":140,"has_guide":false,"url":"https://www.cbioportal.org/study/summary?id=paad_cptac_2021"},{"cancer_study_identifier":"paad_utsw_2015","name":"Pancreatic Cancer (UTSW, Nat Commun 2015)","type_of_cancer_id":"paad","sample_count":109,"has_guide":false,"url":"https://www.cbioportal.org/study/summary?id=paad_utsw_2015"},{"cancer_study_identifier":"paad_icgc","name":"Pancreatic Adenocarcinoma (ICGC, Nature 2012)","type_of_cancer_id":"paad","sample_count":99,"has_guide":false,"url":"https://www.cbioportal.org/study/summary?id=paad_icgc"},{"cancer_study_identifier":"panet_arcnet_2017","name":"Pancreatic Neuroendocrine Tumors (Multi-Institute, Nature 2017)","type_of_cancer_id":"panet","sample_count":98,"has_gui … (1828 more chars) ◀ result {"result":[{"code":"PAAD","name":"Pancreatic Adenocarcinoma","score":60,"mainType":"Pancreatic Cancer","tissue":"Pancreas","hierarchy":"PANCREAS > PAAD"},{"code":"PANEC","name":"Pancreatic Neuroendocrine Carcinoma","score":60,"mainType":"Pancreatic Cancer","tissue":"Pancreas","hierarchy":"PANCREAS > PANEC"},{"code":"PANET","name":"Pancreatic Neuroendocrine Tumor","score":60,"mainType":"Pancreatic Cancer","tissue":"Pancreas","hierarchy":"PANCREAS > PANET"},{"code":"IOPN","name":"Intraductal Oncocytic Papillary Neoplasm","score":45,"mainType":"Pancreatic Cancer","tissue":"Pancreas","hierarchy":"PANCREAS > PACT > IOPN"},{"code":"IPMN","name":"Intraductal Papillary Mucinous Neoplasm","score":45,"mainType":"Pancreatic Cancer","tissue":"Pancreas","hierarchy":"PANCREAS > PACT > IPMN"},{"code":"ITPN","name":"Intraductal Tubulopapillary Neoplasm","score":45,"mainType":"Pancreatic Cancer","tissue":"Pancreas","hierarchy":"PANCREAS > PACT > ITPN"},{"code":"MCN","name":"Mucinous Cystic Neoplasm","score":45,"mainType":"Pancreatic Cancer","tissue":"Pancreas","hierarchy":"PANCREAS > PACT > MCN"},{"code":"OSGCT","name":"Osteoclastic Giant Cell Tumor","score":45,"mainType":"Pancreatic Cancer","tissue":"Pancreas","hierarchy":"PANCREAS > UCP > OSGCT"},{"code":"PAAC","name":"Acinar Cell Carcinoma of the Pancreas","score":45,"mainType":"Pancreatic Cancer","tissue":"Pancreas","hierarchy":"PANCREAS > PAAC"},{"code":"PAASC","name":"Adenosquamous Carcinoma of the Pancreas","score":45,"mainType":"Pancreatic Cancer","tissue":"Pancreas","hierarchy":"PANCREAS > PAASC"},{"code":"PACT","name":"Cystic Tumor of the Pancreas","score":45,"mainType":"Pancreatic Cancer","tissue":"Pancreas","hierarchy":"PANCREAS > PACT"},{"code":"PANCREAS","name":"Pancreas","score":45,"mainType":"Pancreatic Cancer","tissue":"Pancreas","hierarchy":"PANCREAS"},{"code":"PB","name":"Pancreatoblastoma","score":45,"mainType":"Pancreatic Cancer","tissue":"Pancreas","hierarchy":"PANCREAS > PB"},{"code":"PSC","name":"Serous Cystadenoma of the Pancreas","score":45,"mainType":"Pancreatic Cancer","tissue":"Pancreas","hierarchy":"PANCREAS > PACT > PSC"},{"code":"SPN","name":"Solid Pseudopapillary Neoplasm of the Pancreas","score":45,"mainType":"Pancreatic Cancer","tissue":"Pancreas","hierarchy":"PANCREAS > SPN"},{"code":"UCP","name":"Undifferentiated Carcinoma of the Pancreas","score":45,"mainType":"Pancreatic Cancer","tissue":"Pancreas","hierarchy":"PANCREAS > UCP"}]} ▶ clickhouse_run_select_query { "query": "SELECT DISTINCT profile_type FROM genetic_alteration_derived WHERE cancer_study_identifier = 'paad_tcga_pan_can_atlas_2018' ORDER BY profile_type" } ◀ result {"rows":[{"profile_type":"gistic"},{"profile_type":"log2CNA"},{"profile_type":"rna_seq_v2_mrna"},{"profile_type":"rna_seq_v2_mrna_median_Zscores"},{"profile_type":"rna_seq_v2_mrna_median_all_sample_Zscores"},{"profile_type":"rppa"},{"profile_type":"rppa_Zscores"}]} ▶ clickhouse_run_select_query { "query": " SELECT hugo_gene_symbol, count() AS n_samples, median(toFloat64OrNull(alteration_value)) AS median_rsem, min(toFloat64OrNull(alteration_value)) AS min_val, max(toFloat64OrNull(alteration_value)) AS max_val FROM genetic_alteration_derived WHERE cancer_study_identifier = 'paad_tcga_pan_can_atlas_2018' AND profile_type = 'rna_seq_v2_mrna' AND hugo_gene_symbol IN ('CEACAM5','ITGB6','MUC2','MUC1') AND alteration_value NOT IN ('', 'NA') AND toFloat64OrNull(alteration_value) IS NOT NULL GROUP BY hugo_gene_symbol ORDER BY hugo_gene_symbol " } ◀ result {"rows":[{"hugo_gene_symbol":"CEACAM5","n_samples":177,"median_rsem":10049.7,"min_val":0,"max_val":218618},{"hugo_gene_symbol":"ITGB6","n_samples":177,"median_rsem":3740.15,"min_val":0,"max_val":26923.3},{"hugo_gene_symbol":"MUC1","n_samples":177,"median_rsem":14799,"min_val":30.8552,"max_val":72349.5},{"hugo_gene_symbol":"MUC2","n_samples":177,"median_rsem":6.5339,"min_val":0,"max_val":507191}]} ═ answer (success) ## Median mRNA Expression — TCGA Pancreatic Adenocarcinoma (PanCancer Atlas) **Cohort:** [Pancreatic Adenocarcinoma (TCGA, PanCancer Atlas)](https://www.cbioportal.org/study/summary?id=paad_tcga_pan_can_atlas_2018) — 177 tumor samples with RNA-Seq (RSEM) data. | Gene | Median RSEM | Range (min–max) | Samples profiled | |---|---|---|---| | **CEACAM5** | 10,049.7 | 0 – 218,618 | 177 | | **ITGB6** | 3,740.2 | 0 – 26,923.3 | 177 | | **MUC1** | 14,799.0 | 30.9 – 72,349.5 | 177 | | **MUC2** | 6.5 | 0 – 507,191 | 177 | Values are raw RNA-Seq V2 RSEM (not Z-scores). MUC1 and CEACAM5 show high baseline expression typical of PDAC epithelial/glandular differentiation markers, while MUC2 (a goblet-cell/intestinal mucin) is expressed at very low levels in most samples but with a small number of high outliers (max 507,191), which is why the median stays low despite that outlier. **Note on "TPGB":** this is not a recognized HUGO gene symbol, so I omitted it from the calculation. Could you confirm what you meant — for example, **ITGB6** (already included), **TGFB1/2/3**, or something else? I can add the correct gene once confirmed. You can explore these distributions (box plots, per-sample values) directly here: [View CEACAM5/ITGB6/MUC1/MUC2 expression — Plots tab](https://www.cbioportal.org/results/plots?cancer_study_list=paad_tcga_pan_can_atlas_2018&gene_list=CEACAM5%20ITGB6%20MUC1%20MUC2&tab_index=tab_visualize) Note: this is only one of several pancreatic cancer cohorts in cBioPortal (e.g., MSK PDAC 2024, CPTAC, ICGC). Let me know if you'd like the calculation repeated in a different cohort, or across all of them.