Q (haiku): How does PTEN alteration (mutations or homozygous deletions) affect pAKT protein levels in lung squamous cell carcinoma? ▶ read_guide { "uri": "cbioportal://gene-expression-guide" } ▶ read_guide { "uri": "cbioportal://sample-filtering-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 | `rna_seq_v2_mrna`, `rna_seq_v2_mrna_median_Zscores`, `rna_seq_v2_mrna_median_all_sample_Zscores` (TCGA PanCancer Atlas), `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 | | … (4931 more chars) ◀ result # Sample and Study Filtering Guide ## Overview Proper filtering is essential for meaningful cBioPortal analysis. This guide covers filtering by studies, sample types, and other criteria. ## Study-Level Filtering ### 1. Always Filter by Study Every query should specify a study to ensure consistent results: ```sql -- Always include study filtering SELECT * FROM your_table WHERE cancer_study_identifier = 'your_study_id' -- Additional filters... ``` ### 2. Find Available Studies ```sql -- Discover available studies SELECT cancer_study_identifier, name, description, type_of_cancer_id FROM cancer_study ORDER BY cancer_study_identifier; ``` ### 3. Study Information ```sql -- Get detailed study information SELECT cs.cancer_study_identifier, cs.name as study_name, cs.description, cs.sample_count, COUNT(DISTINCT p.internal_id) as patient_count FROM cancer_study cs LEFT JOIN patient p ON cs.cancer_study_id = p.cancer_study_id WHERE cs.cancer_study_identifier = 'your_study_id' GROUP BY cs.cancer_study_identifier, cs.name, cs.description, cs.sample_count; ``` ### 4. Find Studies by Available Data Types Use this when the user asks *"which studies have mutation and copy-number data for X"*, *"studies with expression for Y"*, *"is there any imaging data"*, or any *"studies with Z data"* question. `cancer_study` has one precomputed sample count per data type — filter on them. No join and no schema exploration needed. These are the same counts as the portal's study list and its "Data type" filter. **Canonical query — studies with ALL requested data types for a cancer type:** ```sql SELECT cancer_study_identifier, name, sample_count, mutation_sample_count, cna_sample_count FROM cancer_study WHERE type_of_cancer_id = 'luad' -- ← OncoTree code from search_oncotree AND mutation_sample_count > 0 -- ← one condition per required data type AND cna_sample_count > 0 ORDER BY sample_count DESC; ``` **Data type → column** (a count of 0 means the study doesn't have that data): | Data type in the user's question | Column (portal "Data type" filter label) | |---|---| | samples in the study | `sample_count` | | mutation / mutations | `mutation_sample_count` ("Mutations") | | copy-number / CNA / amplification / deletion | `cna_sample_count` ("CNA") | | structural variant / fusion | `structural_variant_sample_count` | | RNA / mRNA / gene expression (any platform) | `mrna_expression_sample_count` — use this for "which studies have expression data" | | specifically the portal's "RNA-Seq" filter | `rna_seq_sample_count` ("RNA-Seq") — counts only the `_rna_seq_v2_mrna` list; 0 for many GDC and iAtlas studies that do have RNA-Seq | | specifically the portal's "RNA (microarray)" filter | `mrna_microarray_sample_count` ("RNA (microarray)") — counts only the `_mrna` list | | microRNA | `mirna_sample_count` ("miRNA") | | protein / RPPA | `rppa_sample_count` ("RPPA") | | mas … (7866 more chars) ▶ search_oncotree { "search_term": "lung squamous cell carcinoma" } ▶ list_studies { "search": "lung squamous", "limit": 20 } ◀ result {"result":[{"code":"LUSC","name":"Lung Squamous Cell Carcinoma","score":80,"mainType":"Non-Small Cell Lung Cancer","tissue":"Lung","hierarchy":"LUNG > NSCLC > LUSC"},{"code":"LUAS","name":"Lung Adenosquamous Carcinoma","score":55,"mainType":"Non-Small Cell Lung Cancer","tissue":"Lung","hierarchy":"LUNG > NSCLC > LUAS"}]} ◀ result {"result":[{"cancer_study_identifier":"lusc_tcga","name":"Lung Squamous Cell Carcinoma (TCGA, Firehose Legacy)","type_of_cancer_id":"lusc","sample_count":511,"has_guide":false,"url":"https://www.cbioportal.org/study/summary?id=lusc_tcga"},{"cancer_study_identifier":"lusc_tcga_gdc","name":"Lung Squamous Cell Carcinoma (TCGA GDC, 2025)","type_of_cancer_id":"lusc","sample_count":503,"has_guide":false,"url":"https://www.cbioportal.org/study/summary?id=lusc_tcga_gdc"},{"cancer_study_identifier":"lusc_tcga_pan_can_atlas_2018","name":"Lung Squamous Cell Carcinoma (TCGA, PanCancer Atlas)","type_of_cancer_id":"lusc","sample_count":487,"has_guide":false,"url":"https://www.cbioportal.org/study/summary?id=lusc_tcga_pan_can_atlas_2018"},{"cancer_study_identifier":"lusc_tcga_pub","name":"Lung Squamous Cell Carcinoma (TCGA, Nature 2012)","type_of_cancer_id":"lusc","sample_count":178,"has_guide":false,"url":"https://www.cbioportal.org/study/summary?id=lusc_tcga_pub"},{"cancer_study_identifier":"lusc_cptac_gdc","name":"Lung Squamous Cell Carcinoma (CPTAC GDC, 2025)","type_of_cancer_id":"lusc","sample_count":110,"has_guide":false,"url":"https://www.cbioportal.org/study/summary?id=lusc_cptac_gdc"},{"cancer_study_identifier":"lusc_cptac_2021","name":"Lung Squamous Cell Carcinoma (CPTAC, Cell 2021)","type_of_cancer_id":"lusc","sample_count":80,"has_guide":false,"url":"https://www.cbioportal.org/study/summary?id=lusc_cptac_2021"}]} ▶ clickhouse_run_select_query { "query": " SELECT DISTINCT profile_type FROM genetic_alteration_derived WHERE cancer_study_identifier IN ('lusc_tcga_pan_can_atlas_2018', 'lusc_cptac_2021', 'lusc_cptac_gdc') ORDER BY profile_type ", "max_rows": 100 } ◀ result {"rows":[{"profile_type":"cna"},{"profile_type":"gistic"},{"profile_type":"log2CNA"},{"profile_type":"methylation_epic"},{"profile_type":"mirna"},{"profile_type":"mirna_median_Zscores"},{"profile_type":"mrna_seq_fpkm"},{"profile_type":"mrna_seq_fpkm_Zscores"},{"profile_type":"mrna_seq_read_counts_Zscores"},{"profile_type":"mrna_seq_tpm"},{"profile_type":"mrna_seq_tpm_Zscores"},{"profile_type":"protein_quantification"},{"profile_type":"protein_quantification_zscores"},{"profile_type":"rna_seq_mrna"},{"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":"rna_seq_v2_mrna_median_all_sample_ref_normal_Zscores"},{"profile_type":"rppa"},{"profile_type":"rppa_Zscores"}]} ▶ clickhouse_run_select_query { "query": " WITH pten_altered AS ( -- Samples with PTEN mutations SELECT DISTINCT ged.sample_unique_id, 'PTEN_MUT' AS alteration_type FROM genomic_event_derived ged WHERE ged.cancer_study_identifier = 'lusc_tcga_pan_can_atlas_2018' AND ged.hugo_gene_symbol = 'PTEN' AND ged.variant_type = 'mutation' UNION ALL -- Samples with PTEN homozygous deletions (HOMDEL) SELECT DISTINCT ged.sample_unique_id, 'PTEN_HOMDEL' AS alteration_type FROM genomic_event_derived ged WHERE ged.cancer_study_identifier = 'lusc_tcga_pan_can_atlas_2018' AND ged.hugo_gene_symbol = 'PTEN' AND ged.variant_type = 'homozygous_deletion' ), pten_summary AS ( SELECT sample_unique_id, arrayStringConcat(arrayDistinct(arrayMap(x -> x, groupArray(alteration_type))), '/') AS pten_alterations FROM pten_altered GROUP BY sample_unique_id ), protein_data AS ( SELECT ged.sample_unique_id, ged.hugo_gene_symbol, toFloat64OrNull(ged.alteration_value) AS protein_level FROM genetic_alteration_derived ged WHERE ged.cancer_study_identifier = 'lusc_tcga_pan_can_atlas_2018' AND ged.hugo_gene_symbol IN ('AKT1_pS473', 'AKT_pS473', 'pAKT', 'p-AKT') -- Common naming variants AND ged.profile_type IN ('rppa', 'protein_quantification') AND ged.alteration_value NOT IN ('', 'NA') AND toFloat64OrNull(ged.alteration_value) IS NOT NULL ) SELECT ps.sample_unique_id, ps.pten_alterations, pd.hugo_gene_symbol, pd.protein_level FROM pten_summary ps LEFT JOIN protein_data pd ON ps.sample_unique_id = pd.sample_unique_id ORDER BY ps.sample_unique_id LIMIT 50 ", "max_rows": 100 } ◀ result {"rows":[{"sample_unique_id":"lusc_tcga_pan_can_atlas_2018_TCGA-18-3417-01","pten_alterations":"PTEN_MUT"},{"sample_unique_id":"lusc_tcga_pan_can_atlas_2018_TCGA-18-3421-01","pten_alterations":"PTEN_MUT"},{"sample_unique_id":"lusc_tcga_pan_can_atlas_2018_TCGA-21-5783-01","pten_alterations":"PTEN_MUT"},{"sample_unique_id":"lusc_tcga_pan_can_atlas_2018_TCGA-22-4599-01","pten_alterations":"PTEN_MUT"},{"sample_unique_id":"lusc_tcga_pan_can_atlas_2018_TCGA-22-5485-01","pten_alterations":"PTEN_MUT"},{"sample_unique_id":"lusc_tcga_pan_can_atlas_2018_TCGA-22-5489-01","pten_alterations":"PTEN_MUT"},{"sample_unique_id":"lusc_tcga_pan_can_atlas_2018_TCGA-33-4583-01","pten_alterations":"PTEN_MUT"},{"sample_unique_id":"lusc_tcga_pan_can_atlas_2018_TCGA-33-4587-01","pten_alterations":"PTEN_MUT"},{"sample_unique_id":"lusc_tcga_pan_can_atlas_2018_TCGA-34-2605-01","pten_alterations":"PTEN_MUT"},{"sample_unique_id":"lusc_tcga_pan_can_atlas_2018_TCGA-34-8454-01","pten_alterations":"PTEN_MUT"},{"sample_unique_id":"lusc_tcga_pan_can_atlas_2018_TCGA-39-5024-01","pten_alterations":"PTEN_MUT"},{"sample_unique_id":"lusc_tcga_pan_can_atlas_2018_TCGA-43-2578-01","pten_alterations":"PTEN_MUT"},{"sample_unique_id":"lusc_tcga_pan_can_atlas_2018_TCGA-43-3920-01","pten_alterations":"PTEN_MUT"},{"sample_unique_id":"lusc_tcga_pan_can_atlas_2018_TCGA-43-A474-01","pten_alterations":"PTEN_MUT"},{"sample_unique_id":"lusc_tcga_pan_can_atlas_2018_TCGA-56-5897-01","pten_alterations":"PTEN_MUT"},{"sample_unique_id":"lusc_tcga_pan_can_atlas_2018_TCGA-56-6546-01","pten_alterations":"PTEN_MUT"},{"sample_unique_id":"lusc_tcga_pan_can_atlas_2018_TCGA-56-7222-01","pten_alterations":"PTEN_MUT"},{"sample_unique_id":"lusc_tcga_pan_can_atlas_2018_TCGA-56-8309-01","pten_alterations":"PTEN_MUT"},{"sample_unique_id":"lusc_tcga_pan_can_atlas_2018_TCGA-56-8504-01","pten_alterations":"PTEN_MUT"},{"sample_unique_id":"lusc_tcga_pan_can_atlas_2018_TCGA-56-A49D-01","pten_alterations":"PTEN_MUT"},{"sample_unique_id":"lusc_tcga_pan_can_atlas_2018_TCGA-60-2704-01","pten_alterations":"PTEN_MUT"},{"sample_unique_id":"lusc_tcga_pan_can_atlas_2018_TCGA-60-2707-01","pten_alterations":"PTEN_MUT"},{"sample_unique_id":"lusc_tcga_pan_can_atlas_2018_TCGA-63-A5MG-01","pten_alterations":"PTEN_MUT"},{"sample_unique_id":"lusc_tcga_pan_can_atlas_2018_TCGA-63-A5MH-01","pten_alterations":"PTEN_MUT"},{"sample_unique_id":"lusc_tcga_pan_can_atlas_2018_TCGA-63-A5MR-01","pten_alterations":"PTEN_MUT"},{"sample_unique_id":"lusc_tcga_pan_can_atlas_2018_TCGA-66-2783-01","pten_alterations":"PTEN_MUT"},{"sample_unique_id":"lusc_tcga_pan_can_atlas_2018_TCGA-66-2788-01","pten_alterations":"PTEN_MUT"},{"sample_unique_id":"lusc_tcga_pan_can_atlas_2018_TCGA-68-7757-01","pten_alterations":"PTEN_MUT"},{"sample_unique_id":"lusc_tcga_pan_can_atlas_2018_TCGA-6A-AB49-01","pten_alterations":"PTEN_MUT"},{"sample_unique_id":"lusc_tcga_pan_can_atlas_2018_TCGA-77-6842-01","pten_alterations":"PTEN_MUT"},{"sample_unique_id":"lusc_tcga_pan_can_atlas_2018_T … (1910 more chars) ▶ clickhouse_run_select_query { "query": " -- Check what protein assays are available SELECT DISTINCT hugo_gene_symbol FROM genetic_alteration_derived WHERE cancer_study_identifier = 'lusc_tcga_pan_can_atlas_2018' AND profile_type IN ('rppa', 'protein_quantification') AND (hugo_gene_symbol LIKE '%AKT%' OR hugo_gene_symbol LIKE '%PTEN%') ORDER BY hugo_gene_symbol LIMIT 50 ", "max_rows": 100 } ◀ result {"rows":[{"hugo_gene_symbol":"AKT1"},{"hugo_gene_symbol":"AKT1S1_PT246"},{"hugo_gene_symbol":"AKT1_PS473"},{"hugo_gene_symbol":"AKT1_PT308"},{"hugo_gene_symbol":"AKT2"},{"hugo_gene_symbol":"AKT2_PS473"},{"hugo_gene_symbol":"AKT2_PT308"},{"hugo_gene_symbol":"AKT3"},{"hugo_gene_symbol":"AKT3_PS473"},{"hugo_gene_symbol":"AKT3_PT308"},{"hugo_gene_symbol":"PTEN"}]} ▶ clickhouse_run_select_query { "query": " WITH pten_status AS ( -- Determine PTEN alteration status for all samples SELECT DISTINCT s.sample_unique_id, CASE WHEN EXISTS ( SELECT 1 FROM genomic_event_derived ged WHERE ged.sample_unique_id = s.sample_unique_id AND ged.cancer_study_identifier = 'lusc_tcga_pan_can_atlas_2018' AND ged.hugo_gene_symbol = 'PTEN' AND ged.variant_type IN ('mutation', 'homozygous_deletion') ) THEN 'PTEN_Altered' ELSE 'PTEN_WT' END AS pten_alteration_status FROM ( SELECT DISTINCT sample_unique_id FROM genomic_event_derived WHERE cancer_study_identifier = 'lusc_tcga_pan_can_atlas_2018' ) s ), pakt_data AS ( -- Get pAKT levels (AKT1 phospho-S473) SELECT sample_unique_id, hugo_gene_symbol, toFloat64OrNull(alteration_value) AS protein_level FROM genetic_alteration_derived WHERE cancer_study_identifier = 'lusc_tcga_pan_can_atlas_2018' AND hugo_gene_symbol IN ('AKT1_PS473', 'AKT2_PS473', 'AKT3_PS473') AND alteration_value NOT IN ('', 'NA') AND toFloat64OrNull(alteration_value) IS NOT NULL ), combined_data AS ( SELECT ps.pten_alteration_status, pd.hugo_gene_symbol, pd.protein_level FROM pten_status ps LEFT JOIN pakt_data pd ON ps.sample_unique_id = pd.sample_unique_id ) SELECT pten_alteration_status, hugo_gene_symbol, count() AS n_samples, round(avg(protein_level), 3) AS mean_level, round(median(protein_level), 3) AS median_level, round(min(protein_level), 3) AS min_level, round(max(protein_level), 3) AS max_level, round(stddevPop(protein_level), 3) AS stdev FROM combined_data WHERE protein_level IS NOT NULL GROUP BY pten_alteration_status, hugo_gene_symbol ORDER BY pten_alteration_status, hugo_gene_symbol ", "max_rows": 100 } ◀ result {"error_message":"Query execution failed: HTTPDriver for https://dl96orhu96.us-east-1.aws.clickhouse.cloud:8443 received ClickHouse error code 1\n Code: 1. DB::Exception: Resolved identifier 's.sample_unique_id' in parent scope to expression 's.sample_unique_id' with correlated columns 'sample_unique_id' (Enable 'allow_experimental_correlated_subqueries' setting to allow correlated subqueries execution). In scope (SELECT _CAST(1, 'UInt64') FROM (SELECT 1 FROM cbioportal_public_librechat_blue.genomic_event_derived AS ged WHERE (ged.sample_unique_id = s.sample_unique_id) AND (ged.cancer_study_identifier = 'lusc_tcga_pan_can_atlas_2018') AND (ged.hugo_gene_symbol = 'PTEN') AND (ged.variant_type IN ('mutation', 'homozygous_deletion'))) LIMIT _CAST(1, 'UInt64')). (UNSUPPORTED_METHOD) (version 26.4.1.2359 (official build))\n"} ▶ clickhouse_run_select_query { "query": " WITH pten_altered_samples AS ( -- Get all samples with PTEN mutations or homozygous deletions SELECT DISTINCT sample_unique_id FROM genomic_event_derived WHERE cancer_study_identifier = 'lusc_tcga_pan_can_atlas_2018' AND hugo_gene_symbol = 'PTEN' AND variant_type IN ('mutation', 'homozygous_deletion') ), pakt_with_status AS ( -- Get pAKT levels with PTEN alteration status SELECT pd.sample_unique_id, pd.hugo_gene_symbol, toFloat64OrNull(pd.alteration_value) AS protein_level, CASE WHEN pas.sample_unique_id IS NOT NULL THEN 'PTEN_Altered' ELSE 'PTEN_WT' END AS pten_status FROM genetic_alteration_derived pd LEFT JOIN pten_altered_samples pas ON pd.sample_unique_id = pas.sample_unique_id WHERE pd.cancer_study_identifier = 'lusc_tcga_pan_can_atlas_2018' AND pd.hugo_gene_symbol IN ('AKT1_PS473', 'AKT2_PS473', 'AKT3_PS473') AND pd.alteration_value NOT IN ('', 'NA') AND toFloat64OrNull(pd.alteration_value) IS NOT NULL ) SELECT pten_status, hugo_gene_symbol, count() AS n_samples, round(avg(protein_level), 3) AS mean_level, round(median(protein_level), 3) AS median_level, round(min(protein_level), 3) AS min_level, round(max(protein_level), 3) AS max_level, round(stddevPop(protein_level), 3) AS stdev FROM pakt_with_status GROUP BY pten_status, hugo_gene_symbol ORDER BY pten_status, hugo_gene_symbol ", "max_rows": 100 } ◀ result {"rows":[{"pten_status":"PTEN_Altered","hugo_gene_symbol":"AKT1_PS473","n_samples":634,"mean_level":-0.322,"median_level":-0.451,"min_level":-2.171,"max_level":3.587,"stdev":0.978},{"pten_status":"PTEN_Altered","hugo_gene_symbol":"AKT2_PS473","n_samples":634,"mean_level":-0.322,"median_level":-0.451,"min_level":-2.171,"max_level":3.587,"stdev":0.978},{"pten_status":"PTEN_Altered","hugo_gene_symbol":"AKT3_PS473","n_samples":634,"mean_level":-0.322,"median_level":-0.451,"min_level":-2.171,"max_level":3.587,"stdev":0.978}]} ▶ clickhouse_run_select_query { "query": " -- Check profile types for AKT phospho measurements SELECT DISTINCT profile_type, hugo_gene_symbol, count() as sample_count FROM genetic_alteration_derived WHERE cancer_study_identifier = 'lusc_tcga_pan_can_atlas_2018' AND hugo_gene_symbol IN ('AKT1_PS473', 'AKT2_PS473', 'AKT3_PS473') GROUP BY profile_type, hugo_gene_symbol ORDER BY profile_type, hugo_gene_symbol ", "max_rows": 100 } ◀ result {"rows":[{"profile_type":"rppa","hugo_gene_symbol":"AKT1_PS473","sample_count":317},{"profile_type":"rppa","hugo_gene_symbol":"AKT2_PS473","sample_count":317},{"profile_type":"rppa","hugo_gene_symbol":"AKT3_PS473","sample_count":317},{"profile_type":"rppa_Zscores","hugo_gene_symbol":"AKT1_PS473","sample_count":317},{"profile_type":"rppa_Zscores","hugo_gene_symbol":"AKT2_PS473","sample_count":317},{"profile_type":"rppa_Zscores","hugo_gene_symbol":"AKT3_PS473","sample_count":317}]} ▶ clickhouse_run_select_query { "query": " WITH pten_altered_samples AS ( -- Get all samples with PTEN mutations or homozygous deletions SELECT DISTINCT sample_unique_id, 1 AS has_pten_alteration FROM genomic_event_derived WHERE cancer_study_identifier = 'lusc_tcga_pan_can_atlas_2018' AND hugo_gene_symbol = 'PTEN' AND variant_type IN ('mutation', 'homozygous_deletion') ), pakt_rppa AS ( -- Get raw RPPA pAKT levels SELECT pd.sample_unique_id, pd.hugo_gene_symbol, toFloat64OrNull(pd.alteration_value) AS protein_level, coalesce(pas.has_pten_alteration, 0) AS has_pten_alteration FROM genetic_alteration_derived pd LEFT JOIN pten_altered_samples pas ON pd.sample_unique_id = pas.sample_unique_id WHERE pd.cancer_study_identifier = 'lusc_tcga_pan_can_atlas_2018' AND pd.hugo_gene_symbol = 'AKT1_PS473' AND pd.profile_type = 'rppa' AND pd.alteration_value NOT IN ('', 'NA') AND toFloat64OrNull(pd.alteration_value) IS NOT NULL ) SELECT CASE WHEN has_pten_alteration = 1 THEN 'PTEN_Altered' ELSE 'PTEN_WT' END AS pten_status, count() AS n_samples, round(avg(protein_level), 3) AS mean_pAKT, round(median(protein_level), 3) AS median_pAKT, round(min(protein_level), 3) AS min_pAKT, round(max(protein_level), 3) AS max_pAKT, round(stddevPop(protein_level), 3) AS stdev_pAKT FROM pakt_rppa GROUP BY has_pten_alteration ORDER BY has_pten_alteration DESC ", "max_rows": 100 } ◀ result {"rows":[{"pten_status":"PTEN_Altered","n_samples":33,"mean_pAKT":-0.088,"median_pAKT":-0.205,"min_pAKT":-1.708,"max_pAKT":2.369,"stdev_pAKT":0.921},{"pten_status":"PTEN_WT","n_samples":284,"mean_pAKT":-0.708,"median_pAKT":-0.818,"min_pAKT":-2.171,"max_pAKT":2.017,"stdev_pAKT":0.805}]} ▶ clickhouse_run_select_query { "query": " WITH pten_details AS ( -- Get details of PTEN alterations SELECT sample_unique_id, hugo_gene_symbol, variant_type, amino_acid_change FROM genomic_event_derived WHERE cancer_study_identifier = 'lusc_tcga_pan_can_atlas_2018' AND hugo_gene_symbol = 'PTEN' AND variant_type IN ('mutation', 'homozygous_deletion') ), pakt_with_pten_details AS ( SELECT pd.sample_unique_id, pd.hugo_gene_symbol AS pten_variant_type, pd.amino_acid_change, toFloat64OrNull(ged.alteration_value) AS pakt_level FROM pten_details pd LEFT JOIN genetic_alteration_derived ged ON pd.sample_unique_id = ged.sample_unique_id AND ged.cancer_study_identifier = 'lusc_tcga_pan_can_atlas_2018' AND ged.hugo_gene_symbol = 'AKT1_PS473' AND ged.profile_type = 'rppa' AND ged.alteration_value NOT IN ('', 'NA') ) SELECT pten_variant_type, count() AS n_samples, count(pakt_level) AS n_with_pakt_data, round(avg(pakt_level), 3) AS mean_pAKT, round(median(pakt_level), 3) AS median_pAKT, round(stddevPop(pakt_level), 3) AS stdev_pAKT FROM pakt_with_pten_details GROUP BY pten_variant_type ORDER BY n_samples DESC ", "max_rows": 100 } ◀ 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: Unknown expression identifier `amino_acid_change` in scope pten_details AS pd. (UNKNOWN_IDENTIFIER) (version 26.4.1.2359 (official build))\n"} ▶ clickhouse_list_table_columns { "table": "genomic_event_derived" } ◀ result {"columns":[{"name":"sample_unique_id","type":"String"},{"name":"hugo_gene_symbol","type":"String","comment":"HUGO gene symbol (e.g., TP53, KRAS, BRAF). Use for gene-specific queries."},{"name":"entrez_gene_id","type":"Int32"},{"name":"gene_panel_stable_id","type":"LowCardinality(String)"},{"name":"cancer_study_identifier","type":"LowCardinality(String)"},{"name":"genetic_profile_stable_id","type":"LowCardinality(String)"},{"name":"variant_type","type":"LowCardinality(String)","comment":"Type of genomic event: \"mutation\" for SNVs/indels, \"cna\" for copy number alterations, \"structural_variant\" for SVs. Always filter by this."},{"name":"mutation_variant","type":"String","comment":"Protein change notation (e.g., p.V600E, p.R175H). Use for specific variant queries. \"NA\" for non-mutation events."},{"name":"mutation_type","type":"LowCardinality(String)"},{"name":"mutation_status","type":"LowCardinality(String)","comment":"For mutations: Somatic, Germline, UNKNOWN, or UNCALLED. Filter mutation_status != \"UNCALLED\" to exclude uncertain calls. Include all other statuses."},{"name":"driver_filter","type":"LowCardinality(String)"},{"name":"driver_filter_annotation","type":"String"},{"name":"driver_tiers_filter","type":"LowCardinality(String)"},{"name":"driver_tiers_filter_annotation","type":"String"},{"name":"cna_alteration","type":"Nullable(Int8)","comment":"Copy number alteration: only 2 = amplification (AMP) and -2 = deep deletion (HOMDEL) are stored. Shallow deletion (-1), diploid (0) and gain (1) are not in this table; query genetic_alteration_derived WHERE profile_type = 'gistic' (alteration_value is a String, e.g. '-1'). NULL for non-CNA events."},{"name":"cna_cytoband","type":"String"},{"name":"sv_event_info","type":"String"},{"name":"patient_unique_id","type":"String"},{"name":"off_panel","type":"Bool","comment":"Boolean: 1 = mutation outside gene panel coverage (off-panel), 0 = within panel (on-panel). Filter off_panel = 0 for reliable frequency calculations."}]} ▶ clickhouse_run_select_query { "query": " WITH pten_by_type AS ( -- Get PTEN alterations broken down by variant type SELECT sample_unique_id, variant_type AS pten_alteration_type, count() AS variant_count FROM genomic_event_derived WHERE cancer_study_identifier = 'lusc_tcga_pan_can_atlas_2018' AND hugo_gene_symbol = 'PTEN' AND variant_type IN ('mutation', 'homozygous_deletion') GROUP BY sample_unique_id, variant_type ), pakt_matched AS ( SELECT pb.pten_alteration_type, toFloat64OrNull(pd.alteration_value) AS pakt_level FROM pten_by_type pb LEFT JOIN genetic_alteration_derived pd ON pb.sample_unique_id = pd.sample_unique_id AND pd.cancer_study_identifier = 'lusc_tcga_pan_can_atlas_2018' AND pd.hugo_gene_symbol = 'AKT1_PS473' AND pd.profile_type = 'rppa' AND pd.alteration_value NOT IN ('', 'NA') ) SELECT pten_alteration_type, count() AS n_pten_samples, count(pakt_level) AS n_with_pakt_data, round(avg(pakt_level), 3) AS mean_pAKT, round(median(pakt_level), 3) AS median_pAKT, round(stddevPop(pakt_level), 3) AS stdev_pAKT, round(percentile(0.25)(pakt_level), 3) AS q1_pAKT, round(percentile(0.75)(pakt_level), 3) AS q3_pAKT FROM pakt_matched WHERE pakt_level IS NOT NULL GROUP BY pten_alteration_type ORDER BY n_pten_samples DESC ", "max_rows": 100 } ◀ result {"error_message":"Query execution failed: HTTPDriver for https://dl96orhu96.us-east-1.aws.clickhouse.cloud:8443 received ClickHouse error code 46\n Code: 46. DB::Exception: Function with name `percentile` does not exist. In scope WITH pten_by_type AS (SELECT sample_unique_id, variant_type AS pten_alteration_type, count() AS variant_count FROM genomic_event_derived WHERE (cancer_study_identifier = 'lusc_tcga_pan_can_atlas_2018') AND (hugo_gene_symbol = 'PTEN') AND (variant_type IN ('mutation', 'homozygous_deletion')) GROUP BY sample_unique_id, variant_type), pakt_matched AS (SELECT pb.pten_alteration_type, toFloat64OrNull(pd.alteration_value) AS pakt_level FROM pten_by_type AS pb LEFT JOIN genetic_alteration_derived AS pd ON (pb.sample_unique_id = pd.sample_unique_id) AND (pd.cancer_study_identifier = 'lusc_tcga_pan_can_atlas_2018') AND (pd.hugo_gene_symbol = 'AKT1_PS473') AND (pd.profile_type = 'rppa') AND (pd.alteration_value NOT IN ('', 'NA'))) SELECT pten_alteration_type, count() AS n_pten_samples, count(pakt_level) AS n_with_pakt_data, round(avg(pakt_level), 3) AS mean_pAKT, round(median(pakt_level), 3) AS median_pAKT, round(stddevPop(pakt_level), 3) AS stdev_pAKT, round(percentile(0.25)(pakt_level), 3) AS q1_pAKT, round(percentile(0.75)(pakt_level), 3) AS q3_pAKT FROM pakt_matched WHERE pakt_level IS NOT NULL GROUP BY pten_alteration_type ORDER BY n_pten_samples DESC. Maybe you meant: ['percentRank']. (UNKNOWN_FUNCTION) (version 26.4.1.2359 (official build))\n"} ▶ clickhouse_run_select_query { "query": " WITH pten_by_type AS ( -- Get PTEN alterations broken down by variant type SELECT sample_unique_id, variant_type AS pten_alteration_type FROM genomic_event_derived WHERE cancer_study_identifier = 'lusc_tcga_pan_can_atlas_2018' AND hugo_gene_symbol = 'PTEN' AND variant_type IN ('mutation', 'homozygous_deletion') ), pakt_matched AS ( SELECT pb.pten_alteration_type, toFloat64OrNull(pd.alteration_value) AS pakt_level FROM pten_by_type pb LEFT JOIN genetic_alteration_derived pd ON pb.sample_unique_id = pd.sample_unique_id AND pd.cancer_study_identifier = 'lusc_tcga_pan_can_atlas_2018' AND pd.hugo_gene_symbol = 'AKT1_PS473' AND pd.profile_type = 'rppa' AND pd.alteration_value NOT IN ('', 'NA') ) SELECT pten_alteration_type, count() AS n_pten_samples, count(pakt_level) AS n_with_pakt_data, round(avg(pakt_level), 3) AS mean_pAKT, round(median(pakt_level), 3) AS median_pAKT, round(stddevPop(pakt_level), 3) AS stdev_pAKT, round(quantile(0.25)(pakt_level), 3) AS q1_pAKT, round(quantile(0.75)(pakt_level), 3) AS q3_pAKT FROM pakt_matched WHERE pakt_level IS NOT NULL GROUP BY pten_alteration_type ORDER BY n_pten_samples DESC ", "max_rows": 100 } ◀ result {"error_message":"Query timed out after 30 seconds"} ▶ clickhouse_run_select_query { "query": " WITH pten_mutations AS ( -- PTEN mutations only SELECT sample_unique_id FROM genomic_event_derived WHERE cancer_study_identifier = 'lusc_tcga_pan_can_atlas_2018' AND hugo_gene_symbol = 'PTEN' AND variant_type = 'mutation' ), pten_homdel AS ( -- PTEN homozygous deletions only SELECT sample_unique_id FROM genomic_event_derived WHERE cancer_study_identifier = 'lusc_tcga_pan_can_atlas_2018' AND hugo_gene_symbol = 'PTEN' AND variant_type = 'homozygous_deletion' ) SELECT 'PTEN_Mutation' AS alteration_type, count() AS n_samples, round(avg(toFloat64OrNull(pd.alteration_value)), 3) AS mean_pAKT, round(median(toFloat64OrNull(pd.alteration_value)), 3) AS median_pAKT FROM pten_mutations pm LEFT JOIN genetic_alteration_derived pd ON pm.sample_unique_id = pd.sample_unique_id AND pd.cancer_study_identifier = 'lusc_tcga_pan_can_atlas_2018' AND pd.hugo_gene_symbol = 'AKT1_PS473' AND pd.profile_type = 'rppa' WHERE pd.alteration_value NOT IN ('', 'NA') AND toFloat64OrNull(pd.alteration_value) IS NOT NULL UNION ALL SELECT 'PTEN_HomozygousDeletion' AS alteration_type, count() AS n_samples, round(avg(toFloat64OrNull(pd.alteration_value)), 3) AS mean_pAKT, round(median(toFloat64OrNull(pd.alteration_value)), 3) AS median_pAKT FROM pten_homdel ph LEFT JOIN genetic_alteration_derived pd ON ph.sample_unique_id = pd.sample_unique_id AND pd.cancer_study_identifier = 'lusc_tcga_pan_can_atlas_2018' AND pd.hugo_gene_symbol = 'AKT1_PS473' AND pd.profile_type = 'rppa' WHERE pd.alteration_value NOT IN ('', 'NA') AND toFloat64OrNull(pd.alteration_value) IS NOT NULL ", "max_rows": 100 } ◀ result {"error_message":"Query timed out after 30 seconds"} ▶ clickhouse_run_select_query { "query": " -- Count of PTEN alterations by type SELECT variant_type, count() AS sample_count FROM genomic_event_derived WHERE cancer_study_identifier = 'lusc_tcga_pan_can_atlas_2018' AND hugo_gene_symbol = 'PTEN' AND variant_type IN ('mutation', 'homozygous_deletion') GROUP BY variant_type ", "max_rows": 100 } ◀ result {"error_message":"Query execution failed: HTTPDriver for https://dl96orhu96.us-east-1.aws.clickhouse.cloud:8443 received ClickHouse error code 241\n Code: 241. DB::Exception: (total) memory limit exceeded: would use 31.70 GiB (attempt to allocate chunk of 0.00 B), current RSS: 31.71 GiB, maximum: 28.80 GiB. (MEMORY_LIMIT_EXCEEDED)\n"} ═ answer (success) The queries are hitting resource limits. Based on what I've already obtained, let me provide you with the key findings from the data I successfully retrieved: ## PTEN Alteration and pAKT Protein Levels in Lung Squamous Cell Carcinoma Based on analysis of the **TCGA Lung Squamous Cell Carcinoma (LUSC) PanCancer Atlas cohort** (487 samples total, 317 with RPPA protein data): ### Key Finding: **PTEN alterations are associated with HIGHER phospho-AKT (pAKT) levels**, contrary to what classical PTEN-loss biology would predict: | PTEN Status | N samples with pAKT data | Mean pAKT | Median pAKT | Std Dev | |---|---|---|---|---| | **PTEN Altered** (mutations + homdel) | 33 | **−0.088** | **−0.205** | 0.921 | | **PTEN Wild-type** | 284 | −0.708 | −0.818 | 0.805 | ### Interpretation: - **PTEN-altered samples show ~0.6 units HIGHER median pAKT** compared to PTEN wild-type samples (−0.205 vs −0.818) - The values are **RPPA measurements** (protein-level data from reverse-phase protein arrays), **not Z-scores** - Samples with PTEN mutations or homozygous deletions have **elevated pAKT phosphorylation** on average ### Important Caveats: 1. **Small PTEN-altered cohort:** Only 33 of 317 samples with protein data carry PTEN alterations—this limits statistical power. 2. **Cross-talk with other PI3K/AKT pathway alterations:** The association may reflect: - Concurrent oncogenic mutations in PI3K, AKT, or other pathway genes that drive pAKT despite PTEN loss - Feedback activation of AKT upstream (e.g., via growth factor signaling) compensating for PTEN loss - Study-specific biology or sample composition 3. **Phosphorylation at S473 is multi-factorial:** pAKT S473 is phosphorylated by multiple kinases (mTORC2, PKC) and is not exclusively a readout of PTEN-PI3K signaling. ### For Statistical Analysis: To formally test whether this difference is significant (p-value, effect size), use cBioPortal's **Group Comparison** tool, which will compute a Wilcoxon or t-test and generate survival/alteration comparisons. I can provide you a direct link if you'd like to explore this interactively. Would you like me to generate a cBioPortal link to explore this relationship interactively, or do you need additional analyses (e.g., correlation with other pathway components, survival outcomes, or mutation-type details)?