Q (sonnet): How many samples are there that have any of these mutations in SEPHS1: p.Arg371Trp, p.Arg371Gln, p.Arg371Gly? ▶ list_guides {} ▶ search_oncotree { "search_term": "SEPHS1" } ◀ 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 {"result":[]} ▶ read_guide { "uri": "cbioportal://mutation-frequency-guide" } ▶ clickhouse_list_table_columns { "table": "genomic_event_derived" } ◀ result # Mutation Frequency Analysis Guide ## IMPORTANT: Reporting Mutation Frequencies - **ALWAYS report frequencies as percentages**, not raw counts: `frequency = (altered_samples / total_profiled_samples) × 100` - For quick frequency lookups, **prefer the TCGA Pan-Cancer Atlas study first**, then offer to expand to other studies - When reporting across multiple studies, show **ranges** (e.g., "TP53 is mutated in 30–60% of samples") rather than a single average - **NEVER** sum mutation events across studies to compute an aggregate frequency — this can exceed 100% due to double-counting - Warn users that samples may overlap across cohorts (e.g., MSK studies may share patients) - **Choose and state the counting unit**: use patient-level frequencies for prevalence/rate questions unless the user explicitly asks for samples; use sample-level frequencies when the user asks about samples. - **For "across cancer types" questions**, jump to the [Cross-Cancer-Type Mutation Frequency](#cross-cancer-type-mutation-frequency) section below — there is one correct recipe and several common wrong ones. ## Counting Unit: Samples vs Patients Before answering any mutation count or frequency question, decide whether the unit is samples or patients and state that choice in the answer. | User wording | Counting unit | |--------------|---------------| | "prevalence", "rate", "fraction of patients", "patients with", "how common is" | Patient-level: `COUNT(DISTINCT patient_unique_id)` | | "samples", "specimens", "biopsies", sample-level cohort composition | Sample-level: `COUNT(DISTINCT sample_unique_id)` | | Ambiguous | Ask, or default to patient-level for prevalence/rate language and say so | ### Cross-study sample-count caveat When an answer touches more than one study and reports a sample count, prepend a one-line caveat: > Sample IDs are unique within cBioPortal study prefixes, not guaranteed biological-sample identifiers across studies; overlapping cohorts can count the same patient/sample more than once. Prefer one of these safer approaches: - Use a shipped `cancer_study_query_preferences` cohort such as `pan_cancer_tcga` or `all_studies_non_redundant`. - Restrict to one named study. - Aggregate by `patient_unique_id` when the biological question is patient prevalence. ## STOP rule: a frequency above 100% means your query is wrong If your query returns a frequency over 100%, **do not try to debug or explain the data inconsistency to the user**. The cause is always one of these query bugs: - Summing mutation events instead of `COUNT(DISTINCT sample_unique_id)` for the numerator - Using a study-wide sample count as the denominator instead of the gene-specific profiled count - Cross-study aggregation where the same biological sample appears under multiple `sample_unique_id` values (e.g., MSK-IMPACT and MSK-CHORD share patients) - **Joining the profiled CTE through `gene_panel` / `gene_panel_list` without a WES branch.** `gene_panel_id = 'WES'` is *not* a row in … (35166 more chars) ◀ 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": "SELECT mutation_variant, cancer_study_identifier, COUNT(DISTINCT sample_unique_id) AS n_samples FROM genomic_event_derived WHERE variant_type = 'mutation' AND mutation_status != 'UNCALLED' AND hugo_gene_symbol = 'SEPHS1' AND mutation_variant IN ('p.Arg371Trp', 'p.Arg371Gln', 'p.Arg371Gly', 'p.R371W', 'p.R371Q', 'p.R371G', 'R371W', 'R371Q', 'R371G') GROUP BY mutation_variant, cancer_study_identifier ORDER BY mutation_variant" } ◀ result {"rows":[{"mutation_variant":"R371Q","cancer_study_identifier":"coadread_tcga_pub","n_samples":2},{"mutation_variant":"R371Q","cancer_study_identifier":"coad_cptac_gdc","n_samples":1},{"mutation_variant":"R371Q","cancer_study_identifier":"ohnca_cptac_gdc","n_samples":1},{"mutation_variant":"R371Q","cancer_study_identifier":"coadread_tcga","n_samples":2},{"mutation_variant":"R371Q","cancer_study_identifier":"pancan_pcawg_2020","n_samples":1},{"mutation_variant":"R371Q","cancer_study_identifier":"coadread_tcga_pan_can_atlas_2018","n_samples":1},{"mutation_variant":"R371Q","cancer_study_identifier":"coad_tcga_gdc","n_samples":1},{"mutation_variant":"R371W","cancer_study_identifier":"mel_iatlas_liu_2019","n_samples":1},{"mutation_variant":"R371W","cancer_study_identifier":"mel_dfci_2019","n_samples":1}]} ▶ clickhouse_run_select_query { "query": "SELECT COUNT(DISTINCT sample_unique_id) AS total_distinct_samples FROM genomic_event_derived WHERE variant_type = 'mutation' AND mutation_status != 'UNCALLED' AND hugo_gene_symbol = 'SEPHS1' AND mutation_variant IN ('R371W', 'R371Q', 'R371G')" } ◀ result {"rows":[{"total_distinct_samples":11}]} ▶ clickhouse_run_select_query { "query": "SELECT DISTINCT mutation_variant FROM genomic_event_derived WHERE variant_type = 'mutation' AND hugo_gene_symbol = 'SEPHS1' AND mutation_variant LIKE 'R371%'" } ◀ result {"rows":[{"mutation_variant":"R371Q"},{"mutation_variant":"R371W"}]} ▶ resolve_and_route { "studyIds": [ "coadread_tcga_pub", "coadread_tcga", "coad_cptac_gdc", "ohnca_cptac_gdc", "pancan_pcawg_2020", "coadread_tcga_pan_can_atlas_2018", "coad_tcga_gdc", "mel_iatlas_liu_2019", "mel_dfci_2019" ] } ◀ result {"success":true,"message":"Found 9 matching studies. Pick the best match (prefer TCGA → prefer PanCancer Atlas), use its metadata to call the appropriate navigation tool(s) and generate URLs immediately. Present other studies as alternatives.","data":{"totalCount":9,"studiesWithMetadata":[{"studyId":"coadread_tcga_pub","name":"Colorectal Adenocarcinoma (TCGA, Nature 2012)","sampleCount":276,"studyViewUrl":"https://www.cbioportal.org/study?id=coadread_tcga_pub","metadata":{"clinicalAttributeIds":["CANCER_TYPE","CANCER_TYPE_DETAILED","COPY_NUMBER","EXPRESSION_SUBTYPE","FRACTION_GENOME_ALTERED","HISTOLOGICAL_SUBTYPE","HYPERMUTATED","ICLUSTER","METHYLATION_STATUS","METHYLATION_SUBTYPE","MLH1_SILENCING","MRNA_DATA","MSI_STATUS","MUTATION_COUNT","ONCOTREE_CODE","OS_MONTHS","OS_STATUS","PRIMARY_SITE","PRIMARY_TUMOR_PATHOLOGIC_SPREAD","SAMPLE_COUNT","SAMPLE_TYPE","SEQUENCED","SEX","SOMATIC_STATUS","TMB_NONSYNONYMOUS","TUMOR_STAGE_2009"],"molecularProfileIds":["coadread_tcga_pub_gistic","coadread_tcga_pub_linear_CNA","coadread_tcga_pub_methylation_hm27","coadread_tcga_pub_mirna","coadread_tcga_pub_mirna_median_Zscores","coadread_tcga_pub_mrna","coadread_tcga_pub_mrna_median_Zscores","coadread_tcga_pub_mrna_median_all_sample_Zscores","coadread_tcga_pub_mrna_merged_median_Zscores","coadread_tcga_pub_mutations","coadread_tcga_pub_rna_seq_mrna","coadread_tcga_pub_rna_seq_mrna_median_Zscores","coadread_tcga_pub_rna_seq_mrna_median_all_sample_Zscores"],"heatmapProfileIds":["coadread_tcga_pub_methylation_hm27","coadread_tcga_pub_mirna_median_Zscores","coadread_tcga_pub_mrna_median_Zscores","coadread_tcga_pub_mrna_median_all_sample_Zscores","coadread_tcga_pub_mrna_merged_median_Zscores","coadread_tcga_pub_rna_seq_mrna_median_Zscores","coadread_tcga_pub_rna_seq_mrna_median_all_sample_Zscores"],"availableComparisonTabs":["overlap","clinical","survival","alterations","mutations","mrna","dna_methylation"]}},{"studyId":"coadread_tcga","name":"Colorectal Adenocarcinoma (TCGA, Firehose Legacy)","sampleCount":640,"studyViewUrl":"https://www.cbioportal.org/study?id=coadread_tcga","metadata":{"clinicalAttributeIds":["AGE","AJCC_METASTASIS_PATHOLOGIC_PM","AJCC_NODES_PATHOLOGIC_PN","AJCC_PATHOLOGIC_TUMOR_STAGE","AJCC_STAGING_EDITION","AJCC_TUMOR_PATHOLOGIC_PT","BRAF_GENE_ANALYSIS_INDICATOR","BRAF_GENE_ANALYSIS_RESULT","CANCER_TYPE","CANCER_TYPE_DETAILED","CLINICAL_STAGE","CLIN_M_STAGE","CLIN_N_STAGE","CLIN_T_STAGE","DAYS_TO_COLLECTION","DAYS_TO_INITIAL_PATHOLOGIC_DIAGNOSIS","DAYS_TO_PATIENT_PROGRESSION_FREE","DAYS_TO_SPECIMEN_COLLECTION","DAYS_TO_TUMOR_PROGRESSION","DFS_MONTHS","DFS_STATUS","DISEASE_CODE","ETHNICITY","EXTRANODAL_INVOLVEMENT","FORM_COMPLETION_DATE","FRACTION_GENOME_ALTERED","HEIGHT","HISTOLOGICAL_DIAGNOSIS","HISTORY_NEOADJUVANT_TRTYN","HISTORY_OTHER_MALIGNANCY","ICD_10","ICD_O_3_HISTOLOGY","ICD_O_3_SITE","INFORMED_CONSENT_VERIFIED","INITIAL_PATHOLOGIC_DIAGNOSIS_METHOD","INITIAL_PATHOLOGIC_DX_YEAR","IS_FFPE","KRAS_GENE_ANALYSIS_INDICATOR","KRAS_MUTATION","LONG … (12736 more chars) ▶ navigate_to_results_view { "studyIds": [ "coadread_tcga_pub", "coadread_tcga", "coad_cptac_gdc", "ohnca_cptac_gdc", "pancan_pcawg_2020", "coadread_tcga_pan_can_atlas_2018", "coad_tcga_gdc", "mel_iatlas_liu_2019", "mel_dfci_2019" ], "genes": [ "SEPHS1: R371W R371Q" ], "tab": "mutations" } ◀ result {"success":true,"message":"Navigating to https://www.cbioportal.org/results/mutations?cancer_study_list=coadread_tcga_pub%2Ccoadread_tcga%2Ccoad_cptac_gdc%2Cohnca_cptac_gdc%2Cpancan_pcawg_2020%2Ccoadread_tcga_pan_can_atlas_2018%2Ccoad_tcga_gdc%2Cmel_iatlas_liu_2019%2Cmel_dfci_2019&gene_list=SEPHS1%3A+R371W+R371Q&case_set_id=all","url":"https://www.cbioportal.org/results/mutations?cancer_study_list=coadread_tcga_pub%2Ccoadread_tcga%2Ccoad_cptac_gdc%2Cohnca_cptac_gdc%2Cpancan_pcawg_2020%2Ccoadread_tcga_pan_can_atlas_2018%2Ccoad_tcga_gdc%2Cmel_iatlas_liu_2019%2Cmel_dfci_2019&gene_list=SEPHS1%3A+R371W+R371Q&case_set_id=all","data":{"studyIds":["coadread_tcga_pub","coadread_tcga","coad_cptac_gdc","ohnca_cptac_gdc","pancan_pcawg_2020","coadread_tcga_pan_can_atlas_2018","coad_tcga_gdc","mel_iatlas_liu_2019","mel_dfci_2019"],"studies":[{"studyId":"coadread_tcga_pub","name":"Colorectal Adenocarcinoma (TCGA, Nature 2012)","sampleCount":276},{"studyId":"coadread_tcga","name":"Colorectal Adenocarcinoma (TCGA, Firehose Legacy)","sampleCount":640},{"studyId":"coad_cptac_gdc","name":"Colon Adenocarcinoma (CPTAC GDC, 2025)","sampleCount":109},{"studyId":"ohnca_cptac_gdc","name":"Head and Neck Carcinoma, Other (CPTAC GDC, 2025)","sampleCount":172},{"studyId":"pancan_pcawg_2020","name":"Pan-cancer analysis of whole genomes (ICGC/TCGA, Nature 2020)","sampleCount":2922},{"studyId":"coadread_tcga_pan_can_atlas_2018","name":"Colorectal Adenocarcinoma (TCGA, PanCancer Atlas)","sampleCount":594},{"studyId":"coad_tcga_gdc","name":"Colon Adenocarcinoma (TCGA GDC, 2025)","sampleCount":463},{"studyId":"mel_iatlas_liu_2019","name":"Metastatic Melanoma (DFCI, Nat Med. 2019) - iAtlas Harmonized","sampleCount":122},{"studyId":"mel_dfci_2019","name":"Metastatic Melanoma (DFCI, Nature Medicine 2019)","sampleCount":144}],"genes":["SEPHS1"],"caseSetId":"all","pageDescription":"Detailed mutation table with lollipop plot showing mutation positions, types, and frequencies for queried genes."}} ═ answer (success) ## Answer Querying `genomic_event_derived` for SEPHS1 mutations across all studies in this cBioPortal deployment: - **p.Arg371Trp (R371W)** and **p.Arg371Gln (R371Q)** are present. - **p.Arg371Gly (R371G) does not exist** in any study in this database. **Total: 11 distinct samples** carry a SEPHS1 R371W or R371Q mutation, spread across 9 studies: | Variant | Study | Samples | |---|---|---| | R371Q | coadread_tcga_pub | 2 | | R371Q | coadread_tcga | 2 | | R371Q | coad_cptac_gdc | 1 | | R371Q | ohnca_cptac_gdc | 1 | | R371Q | pancan_pcawg_2020 | 1 | | R371Q | coadread_tcga_pan_can_atlas_2018 | 1 | | R371Q | coad_tcga_gdc | 1 | | R371W | mel_iatlas_liu_2019 | 1 | | R371W | mel_dfci_2019 | 1 | **Caveat:** `coadread_tcga_pub`, `coadread_tcga`, and `coadread_tcga_pan_can_atlas_2018` are overlapping TCGA colorectal cohorts (and `mel_iatlas_liu_2019`/`mel_dfci_2019` are related melanoma cohorts too), so some of these 11 samples likely represent the same underlying patients counted more than once across releases. The true non-redundant biological sample/patient count is probably lower than 11. [View SEPHS1 R371W/R371Q mutations across all matching studies](https://www.cbioportal.org/results/mutations?cancer_study_list=coadread_tcga_pub%2Ccoadread_tcga%2Ccoad_cptac_gdc%2Cohnca_cptac_gdc%2Cpancan_pcawg_2020%2Ccoadread_tcga_pan_can_atlas_2018%2Ccoad_tcga_gdc%2Cmel_iatlas_liu_2019%2Cmel_dfci_2019&gene_list=SEPHS1%3A+R371W+R371Q&case_set_id=all)