TransSSVs: a Transformer-based deep learning model for accurate detection of somatic small variants in paired tumor and normal sequencing data

Jing Meng, Jiangyuan Wang, Jingze Liu, Wenkai Song, Ming Li, Aiping Wu, Taijiao JiangApplied Intelligence 2025

Abstract

Accurate identification of somatic small variants in tumors plays a crucial role in cancer diagnosis. Various somatic mutation callers have been developed; however, existing methods face limitations in modeling mapping information of flanking genomic sites (genomic sites adjacent to a somatic site) that influence the state of the somatic site. Additionally, they are unable to analyze inter-site interactions within the context sequence centered around a somatic site or appropriately weigh the effects of flanking genomic sites on the somatic site. To address these limitations, the Transformer model is utilized to develop TransSSVs for detecting somatic small variants. The core functionality of TransSSVs relies on the multi-head attention mechanism, which generates a reliable representation of interactions between a candidate somatic site and its flanking genomic sites within the context sequence. TransSSVs effectively extract mapping features of various genomic sites in the context sequence to enhance prediction accuracy. Benchmarking experiments demonstrate that TransSSVs exhibit robust performance when compared with state-of-the-art methods on well-characterized real and simulated tumor datasets.

Introduction

Somatic mutations are genetic alterations that occur during a person's lifetime and drive cancer development. Identifying these mutations from high-throughput sequencing data is difficult due to biological and technological noise, such as intra-tumor heterogeneity (different sub-clones in the same tumor), sample contamination, and sequencing artifacts.

Existing computational tools—whether statistical (like Mutect2) or CNN-based (like DeepSSV)—generally focus on individual genomic loci. They struggle to model the interactions between a candidate mutation site and its neighboring (flanking) genomic regions. Because they cannot properly weigh the influence of the surrounding genomic context, these tools often struggle to distinguish true somatic mutations from background noise, especially in regions with low variant allele frequencies (VAFs).

The TransSSVs Framework

To overcome these limitations, TransSSVs frames mutation calling as a sequence-context problem, applying a Transformer encoder architecture to analyze genomic data. The pipeline consists of three primary stages: preparation of candidate somatic sites, generation of the input matrix, and prediction using the deep learning model.

The TransSSVs workflow, from candidate site preparation to variant prediction.

Feature Matrix Construction

For every candidate mutation site, the model extracts a context window consisting of the candidate site and $L$ flanking sites on either side. Each site is represented by a column of 52 features, capturing base counts, mapping qualities, and base qualities derived from both tumor and normal sequencing reads. This multi-dimensional representation ensures that the model has access to the raw evidence supporting or refuting a mutation call.

Transformer Architecture and Training

This matrix is fed into a Transformer model. Instead of processing words in a sentence, the multi-head attention mechanism processes genomic sites. It calculates attention weights to capture the inter-site interactions, allowing the model to dynamically decide how much a neighboring genomic region should influence the prediction of the candidate site.

Detailed architecture of the Transformer encoder block used in TransSSVs.

The core of the prediction engine is the Encoder block, which utilizes a multi-head attention mechanism followed by layer normalization, ReLU activation, and feed-forward layers. To handle the massive class imbalance (non-mutated sites vastly outnumber mutated ones), the model is trained using Focal Loss, which down-weights easily classified examples and forces the model to focus on hard-to-classify sites.

Experimental Evaluation

TransSSVs was rigorously benchmarked across diverse datasets to ensure robustness and generalizability:

  • Training and Cross-Validation: The model was trained on the COLO829 dataset (metastatic melanoma). On test sets, TransSSVs achieved the highest overall F1 scores (~0.926), edging out the CNN-based DeepSSV (0.923) and significantly beating traditional tools like Mutect2 (0.885) and VarScan2 (0.847).
  • Real-world Validation: Three independent, well-characterized tumor datasets from the ICGC (Medulloblastoma, Chronic Lymphocytic Leukemia, and Acute Myeloid Leukemia) were used. TransSSVs achieved the highest Area Under the Precision-Recall Curve (AUPRC) values across all three, outperforming six competing state-of-the-art callers.
  • Simulated Robustness: Three simulated datasets based on the NA12878 genome, engineered with varying mutation loads and sub-clonal structures, confirmed that TransSSVs remains robust against varying levels of tumor heterogeneity.

Insights and Interpretability

Analysis of the model's behavior revealed several key insights:

  • Optimal Context Window: Performance improved as context increased, but peaked at 7 flanking sites on either side. Beyond this "Goldilocks zone," performance plateaued, likely due to the increased complexity of the input matrix relative to the available training data.
  • Attention as a Filter: Unlike "black box" CNNs, the Transformer's attention weights provide interpretability. Analysis showed that the model distributes attention globally across the context window to filter out noise, rather than hyper-fixating solely on the candidate locus.
  • The INDEL Challenge: While SNV detection was highly accurate, detecting Insertions/Deletions (INDELs) remains significantly more challenging for all tools due to complex noise profiles in sequencing data.

Conclusion

TransSSVs demonstrates that the Transformer architecture is highly effective for genomic variant calling, particularly in its ability to weigh the importance of flanking genomic context. While the model is computationally intensive, its superior accuracy in low-VAF regions and its inherent interpretability make it a powerful tool for cancer research. Future work will focus on improving computational efficiency and exploring higher-order epigenetic interactions.

Summary updated

BibTeX
@article{meng2025transssvs,
  author = {Jing Meng and Jiangyuan Wang and Jingze Liu and Wenkai Song and Ming Li and Aiping Wu and Taijiao Jiang},
  title = {{TransSSVs: a Transformer-based deep learning model for accurate detection of somatic small variants in paired tumor and normal sequencing data}},
  journal = {Applied Intelligence},
  year = {2025},
  doi = {10.1007/s10489-025-06607-x},
}
Figure