> For the complete documentation index, see [llms.txt](https://docs.owkin.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.owkin.com/explore-and-analyse-data/data-analysis/genomic-alterations/mutation-frequency.md).

# Mutation frequency

Summarize mutation counts by genomic position across patients, or mean variant allele fractions by position within an individual patient.

Summarize mutation counts by genomic position across patients, or mean variant allele fractions by position within an individual patient.

## Patient count per position

### Description

#### Analysis summary

Counts distinct patients carrying a mutation at each amino acid position of a single gene, separately by mutation type. Identifies recurrent mutations within the queried cohort.

#### Computation

Extracts amino acid positions from protein-change notations and discards records without a parseable position. Each position and mutation type yields a distinct-patient count and a patient list; the representative protein change is the one carried by the most patients, with alphabetical tie-breaking. A minimum-count filter removes rare combinations. The descriptive table is sorted by count and includes position, representative change, mutation type, patient count, percentages of the full cohort and of patients mutated in the gene, and a recurrence-based hotspot flag. The default hotspot threshold is the larger of three patients and the rounded count corresponding to 5% of mutated patients. When oncogenic flags include at least one positive record, the table also reports the percentage of patients mutated at each position who have an oncogenic mutation there, across mutation types. No hypothesis tests or significance comparisons are computed.

#### When to use

Use for 'which positions in this gene recur across patients?' and cohort-level mutation frequency questions. Prefer the single-patient VAF mode to examine allele fractions in one patient, or oncoprint\_analysis for alterations across a panel of genes and samples.

#### Caveats

Restrict input to one gene and compatible protein coordinates: gene identities and isoforms are not reconciled. Include unmutated patients as records with null protein changes to obtain full-cohort percentages. The mutated-patient denominator counts all patients with a non-null protein change, including unparseable notations. A patient can contribute to several mutation types at one position, so their counts must not be summed as distinct patients. Hotspot flags apply to each position/type combination and are recurrence heuristics, not evidence of statistical enrichment or pathogenicity. Absent oncogenic percentages do not establish that no variants are oncogenic.

### Example questions

<details>

<summary><code>example questions</code></summary>

* Lollipop plot of per-position mutation frequency across a patient cohort for a single gene

</details>

### Input columns

<details>

<summary><code>input columns</code></summary>

| column                  | type        | required | description                                                                                                                                                 |
| ----------------------- | ----------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- |
| patient\_id             | categorical | required | Patient identifier for distinct counting. Join sample\_metadata\_table on sample\_id to obtain.                                                             |
| hgvsp\_short            | categorical | required | Protein change notation (e.g. p.R248W) — amino acid position is extracted from this. Null for an unmutated patient.                                         |
| variant\_classification | categorical | required | Mutation type (e.g. Missense\_Mutation, Nonsense\_Mutation), counted separately at each position.                                                           |
| oncogenic               | boolean     | optional | Boolean VCF flag: True = variant flagged as oncogenic, null = not flagged. When present, pct\_oncogenic is added to descriptive\_stats. Include by default. |

</details>

### Visualizations

* `lollipop` How to read: The horizontal axis gives amino acid position along the protein; each lollipop head's height is the number of distinct patients with that position and mutation type. Colours and the legend distinguish mutation types, not oncogenicity. Heads sharing a position may be offset slightly to avoid overlap; their actual position is given in hover text, along with the representative protein change. Tall stems identify recurrent hits, not statistically significant enrichment. In ECharts, hotspot heads can be labelled with the representative change and count, and hover text also provides patient shares and available oncogenic percentages. Optional protein-feature annotations locate hits within domains or regions. A logarithmic vertical scale compresses large count differences.

### Example analysis 1

#### Name — TP53 Mutation Landscape (TCGA Cohort)

#### Analysis parameters

<details>

<summary><code>analysis_name, analysis_params, viz_params</code></summary>

```json
{
  "analysis_name": "mutation_frequency_analysis",
  "analysis_params": {
    "analysis_mode": "patient_count",
    "min_count": 2
  },
  "viz_params": {
    "plot_name": "lollipop",
    "title": "TP53 Mutation Landscape (TCGA Cohort)",
    "protein_length": 393,
    "uniprot_release": "2026_02",
    "domains": [
      {
        "name": "DNA-binding domain",
        "start": 102,
        "end": 292,
        "feature_type": "DNA binding"
      },
      {
        "name": "Interaction with CCAR2",
        "start": 1,
        "end": 320,
        "feature_type": "Region"
      },
      {
        "name": "Interaction with HRMT1L2",
        "start": 1,
        "end": 83,
        "feature_type": "Region"
      },
      {
        "name": "Transcription activation (acidic)",
        "start": 1,
        "end": 44,
        "feature_type": "Region"
      },
      {
        "name": "Disordered",
        "start": 50,
        "end": 96,
        "feature_type": "Region"
      },
      {
        "name": "Interaction with WWOX",
        "start": 66,
        "end": 110,
        "feature_type": "Region"
      },
      {
        "name": "Interaction with HIPK1",
        "start": 100,
        "end": 370,
        "feature_type": "Region"
      },
      {
        "name": "Required for interaction with ZNF385A",
        "start": 100,
        "end": 300,
        "feature_type": "Region"
      },
      {
        "name": "Required for interaction with FBXO42",
        "start": 113,
        "end": 236,
        "feature_type": "Region"
      },
      {
        "name": "Interaction with AXIN1",
        "start": 116,
        "end": 292,
        "feature_type": "Region"
      },
      {
        "name": "Interaction with the 53BP2 SH3 domain",
        "start": 241,
        "end": 248,
        "feature_type": "Region"
      },
      {
        "name": "Interaction with E4F1",
        "start": 256,
        "end": 294,
        "feature_type": "Region"
      },
      {
        "name": "Interaction with DNA",
        "start": 273,
        "end": 280,
        "feature_type": "Region"
      },
      {
        "name": "Disordered",
        "start": 282,
        "end": 325,
        "feature_type": "Region"
      },
      {
        "name": "Interaction with CARM1",
        "start": 300,
        "end": 393,
        "feature_type": "Region"
      },
      {
        "name": "Interaction with HIPK2",
        "start": 319,
        "end": 360,
        "feature_type": "Region"
      },
      {
        "name": "Oligomerization",
        "start": 325,
        "end": 356,
        "feature_type": "Region"
      },
      {
        "name": "Disordered",
        "start": 351,
        "end": 393,
        "feature_type": "Region"
      },
      {
        "name": "Interaction with USP7",
        "start": 359,
        "end": 363,
        "feature_type": "Region"
      },
      {
        "name": "Basic (repression of DNA-binding)",
        "start": 368,
        "end": 387,
        "feature_type": "Region"
      },
      {
        "name": "Interaction with MORN3",
        "start": 374,
        "end": 393,
        "feature_type": "Region"
      },
      {
        "name": "TADI",
        "start": 17,
        "end": 25,
        "feature_type": "Motif"
      },
      {
        "name": "TADII",
        "start": 48,
        "end": 56,
        "feature_type": "Motif"
      },
      {
        "name": "Bipartite nuclear localization signal",
        "start": 305,
        "end": 321,
        "feature_type": "Motif"
      },
      {
        "name": "Nuclear export signal",
        "start": 339,
        "end": 350,
        "feature_type": "Motif"
      },
      {
        "name": "[KR]-[STA]-K motif",
        "start": 370,
        "end": 372,
        "feature_type": "Motif"
      },
      {
        "name": "Pro residues",
        "start": 69,
        "end": 90,
        "feature_type": "Compositional bias"
      },
      {
        "name": "Basic and acidic residues",
        "start": 282,
        "end": 299,
        "feature_type": "Compositional bias"
      },
      {
        "name": "Basic residues",
        "start": 365,
        "end": 384,
        "feature_type": "Compositional bias"
      }
    ]
  }
}
```

</details>

#### Visualization — `lollipop`

![TP53 Mutation Landscape (TCGA Cohort)](https://1034377358-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTmCjUj6W0sltjW7q2vBp%2Fuploads%2Fgit-blob-271956b5a8280c3cd6edee5ea169fef847dfbf28%2Fmutation_frequency_analysis__patient_count__lollipop.png?alt=media)

#### Output table

<details>

<summary><code>descriptive_stats</code> (first 10 of 326 rows)</summary>

| aa\_position | representative\_hgvsp | variant\_classification | n\_patients | pct\_cohort | pct\_mutated | is\_hotspot |
| ------------ | --------------------- | ----------------------- | ----------- | ----------- | ------------ | ----------- |
| 273          | p.R273C               | Missense\_Mutation      | 258         | 2.7         | 7.0          | True        |
| 248          | p.R248Q               | Missense\_Mutation      | 207         | 2.1         | 5.6          | True        |
| 175          | p.R175H               | Missense\_Mutation      | 162         | 1.7         | 4.4          | False       |
| 282          | p.R282W               | Missense\_Mutation      | 86          | 0.9         | 2.3          | False       |
| 245          | p.G245S               | Missense\_Mutation      | 84          | 0.9         | 2.3          | False       |
| 213          | p.R213\*              | Nonsense\_Mutation      | 74          | 0.8         | 2.0          | False       |
| 220          | p.Y220C               | Missense\_Mutation      | 72          | 0.7         | 2.0          | False       |
| 179          | p.H179R               | Missense\_Mutation      | 67          | 0.7         | 1.8          | False       |
| 193          | p.H193R               | Missense\_Mutation      | 61          | 0.6         | 1.7          | False       |
| 196          | p.R196\*              | Nonsense\_Mutation      | 51          | 0.5         | 1.4          | False       |

</details>

## Mean VAF per position (single patient)

### Description

#### Analysis summary

Summarises the variant allele fraction of mutations at each amino acid position of a single gene in one patient. Provides a position-level mutation profile for that patient.

#### Computation

Extracts amino acid positions from protein-change notations, discards records without a parseable position, and averages variant allele fractions over records sharing a position and mutation type. The result retains the patient list and an alphabetically selected representative protein change. The descriptive table contains position, representative change, mutation type, mean allele fraction and a sequential rank in descending allele fraction order. If supplied, the oncogenic flag is taken from the representative record. No hotspot classification or hypothesis tests are computed.

#### When to use

Use to inspect allele fractions and the mutation profile of one patient in a single gene. Prefer the patient-count mode for recurrence across a cohort, or trajectory\_analysis when the question concerns changes in measurements over repeated timepoints.

#### Caveats

Only one patient is supported, and input must concern one gene with compatible protein coordinates. Multiple samples or distinct changes at the same position and mutation type are averaged together rather than resolved separately. The representative change and its oncogenic flag need not describe every contributing record. Allele fraction alone does not establish clonality: purity, copy number and assay properties also affect it. Patient-count filters and hotspot thresholds do not apply.

### Example questions

<details>

<summary><code>example questions</code></summary>

* Lollipop plot of per-position VAF for a single patient and a single gene

</details>

### Input columns

<details>

<summary><code>input columns</code></summary>

| column                  | type        | required | description                                                                                                                                                 |
| ----------------------- | ----------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- |
| patient\_id             | categorical | required | Patient identifier for distinct counting. Join sample\_metadata\_table on sample\_id to obtain.                                                             |
| hgvsp\_short            | categorical | required | Protein change notation (e.g. p.R248W) — amino acid position is extracted from this. Null for an unmutated patient.                                         |
| variant\_classification | categorical | required | Mutation type (e.g. Missense\_Mutation, Nonsense\_Mutation), counted separately at each position.                                                           |
| vaf                     | numeric     | required | Variant Allele Fraction (0–1). Required for single-patient queries (analysis\_mode='vaf').                                                                  |
| oncogenic               | boolean     | optional | Boolean VCF flag: True = variant flagged as oncogenic, null = not flagged. When present, pct\_oncogenic is added to descriptive\_stats. Include by default. |

</details>

### Visualizations

* `lollipop` How to read: The horizontal axis gives amino acid position along the protein; each lollipop head's height is the mean variant allele fraction for that position and mutation type, on a 0–1 measurement scale. Colours and the legend distinguish mutation types. Hover text identifies the actual position and representative protein change; ECharts also reports the available oncogenic flag and can label mutations in short profiles. Optional protein-feature annotations locate mutations within domains or regions. Higher heads mean larger observed allele fractions, not necessarily greater clonality or pathogenicity. A logarithmic vertical scale hides zero allele fractions.

### Example analysis 1

#### Name — TP53 Mutations (Single Patient VAF)

#### Analysis parameters

<details>

<summary><code>analysis_name, analysis_params, viz_params</code></summary>

```json
{
  "analysis_name": "mutation_frequency_analysis",
  "analysis_params": {
    "analysis_mode": "vaf"
  },
  "viz_params": {
    "plot_name": "lollipop",
    "title": "TP53 Mutations (Single Patient VAF)",
    "protein_length": 393,
    "uniprot_release": "2026_02",
    "domains": [
      {
        "name": "DNA-binding domain",
        "start": 102,
        "end": 292,
        "feature_type": "DNA binding"
      },
      {
        "name": "Interaction with CCAR2",
        "start": 1,
        "end": 320,
        "feature_type": "Region"
      },
      {
        "name": "Interaction with HRMT1L2",
        "start": 1,
        "end": 83,
        "feature_type": "Region"
      },
      {
        "name": "Transcription activation (acidic)",
        "start": 1,
        "end": 44,
        "feature_type": "Region"
      },
      {
        "name": "Disordered",
        "start": 50,
        "end": 96,
        "feature_type": "Region"
      },
      {
        "name": "Interaction with WWOX",
        "start": 66,
        "end": 110,
        "feature_type": "Region"
      },
      {
        "name": "Interaction with HIPK1",
        "start": 100,
        "end": 370,
        "feature_type": "Region"
      },
      {
        "name": "Required for interaction with ZNF385A",
        "start": 100,
        "end": 300,
        "feature_type": "Region"
      },
      {
        "name": "Required for interaction with FBXO42",
        "start": 113,
        "end": 236,
        "feature_type": "Region"
      },
      {
        "name": "Interaction with AXIN1",
        "start": 116,
        "end": 292,
        "feature_type": "Region"
      },
      {
        "name": "Interaction with the 53BP2 SH3 domain",
        "start": 241,
        "end": 248,
        "feature_type": "Region"
      },
      {
        "name": "Interaction with E4F1",
        "start": 256,
        "end": 294,
        "feature_type": "Region"
      },
      {
        "name": "Interaction with DNA",
        "start": 273,
        "end": 280,
        "feature_type": "Region"
      },
      {
        "name": "Disordered",
        "start": 282,
        "end": 325,
        "feature_type": "Region"
      },
      {
        "name": "Interaction with CARM1",
        "start": 300,
        "end": 393,
        "feature_type": "Region"
      },
      {
        "name": "Interaction with HIPK2",
        "start": 319,
        "end": 360,
        "feature_type": "Region"
      },
      {
        "name": "Oligomerization",
        "start": 325,
        "end": 356,
        "feature_type": "Region"
      },
      {
        "name": "Disordered",
        "start": 351,
        "end": 393,
        "feature_type": "Region"
      },
      {
        "name": "Interaction with USP7",
        "start": 359,
        "end": 363,
        "feature_type": "Region"
      },
      {
        "name": "Basic (repression of DNA-binding)",
        "start": 368,
        "end": 387,
        "feature_type": "Region"
      },
      {
        "name": "Interaction with MORN3",
        "start": 374,
        "end": 393,
        "feature_type": "Region"
      },
      {
        "name": "TADI",
        "start": 17,
        "end": 25,
        "feature_type": "Motif"
      },
      {
        "name": "TADII",
        "start": 48,
        "end": 56,
        "feature_type": "Motif"
      },
      {
        "name": "Bipartite nuclear localization signal",
        "start": 305,
        "end": 321,
        "feature_type": "Motif"
      },
      {
        "name": "Nuclear export signal",
        "start": 339,
        "end": 350,
        "feature_type": "Motif"
      },
      {
        "name": "[KR]-[STA]-K motif",
        "start": 370,
        "end": 372,
        "feature_type": "Motif"
      },
      {
        "name": "Pro residues",
        "start": 69,
        "end": 90,
        "feature_type": "Compositional bias"
      },
      {
        "name": "Basic and acidic residues",
        "start": 282,
        "end": 299,
        "feature_type": "Compositional bias"
      },
      {
        "name": "Basic residues",
        "start": 365,
        "end": 384,
        "feature_type": "Compositional bias"
      }
    ]
  }
}
```

</details>

#### Visualization — `lollipop`

![TP53 Mutations (Single Patient VAF)](https://1034377358-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTmCjUj6W0sltjW7q2vBp%2Fuploads%2Fgit-blob-479f31d76dacd40c11195fa51ec68ec18996dd7c%2Fmutation_frequency_analysis__vaf__lollipop.png?alt=media)

#### Output table

<details>

<summary><code>descriptive_stats</code> (1 rows)</summary>

| aa\_position | representative\_hgvsp | variant\_classification | mean\_vaf | oncogenic | vaf\_rank |
| ------------ | --------------------- | ----------------------- | --------- | --------- | --------- |
| 216          | p.V216M               | Missense\_Mutation      | 0.6129    |           | 1         |

</details>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.owkin.com/explore-and-analyse-data/data-analysis/genomic-alterations/mutation-frequency.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
