# Maximum Somatic VAF

The maximum somatic variant allele frequency (MSAF) is the highest VAF of a confirmed somatic mutation. The MSAF is often used as a surrogate for tumor fraction, especially when the ctDNA tumor fraction is high.

{% hint style="danger" %}
Use caution when using MSAF as a surrogate for ctDNA tumor fraction. The MSAF implementation in the DRAGEN TSO 500 ctDNA analysis software incorporates fragment size based analysis and filtering of germline and clonal hematopoiesis variants. However, taking into account additional factors, e.g., aneuploidy, and broader testing is needed to provide a more accurate representation of tumor fraction.
{% endhint %}

## MSAF algorithm

The MSAF is determined using the following steps:

1. Somatic variants determined by the TMB algorithm are used as an input (variants having Status *Somatic* in the `{SampleID}_tmb.trace.tsv` file). Variants that are not in coding regions, MNVs and variants with depth below 500 are filtered out.
2. The remaining variants are ranked by the VAF in descending order
3. The VAF for the highest ranked confident somatic variants is output as MSAF. "Confident somatic variants" are determined analyzing the fragment size of the reads supporting the variants. Circulating tumor DNA (ctDNA) molecules are expected to be shorter, when compared to the normal cell-free DNA (cfDNA) molecules. If the fragment sizes of the reads supporting a variant are significantly shorter than non-supporting reads (p-value < 1x10-5), the variant is considered to be a confident somatic variant.
4. If no such variant exists, the VAF for the highest ranked COSMIC hotspot variant (with COSMIC count > 50) is output as MSAF.
5. If no such variant exists, the VAF for the 4<sup>th</sup> highest ranked variant is output as MSAF.

<figure><img src="https://3845108255-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7XRWgkRPkhoHXVslBqXD%2Fuploads%2Fgit-blob-eb7faf8b56e89aef6f60e0a32d1bffffa7a87fcb%2Fimage%20(12).png?alt=media" alt=""><figcaption><p>MSAF algorithm in DRAGEN TSO 500 ctDNA Analysis Software</p></figcaption></figure>

## MSAF output files

The MSAF algorithm outputs results in several files:

1. Metrics Output File, `{SampleID}_MetricsOutput.tsv` as Max\_Somatic\_AF
2. TMB Max Somatic VAF file, `{Sample_ID}.tmb.msaf.csv` as MaxSomaticAF, using the same file format as the [TMB Trace File](https://help.tso500software.illumina.com/dragen-tso-500-ctdna-guides/dragen-tso-500-ctdna-v2.6/tmb#id-3.-tmb-trace-file).
