Skip to content

4. Reference Creation

Jared Johnson edited this page Feb 27, 2025 · 11 revisions

Overview

EPITOME creates references from a set of input sequences that have passed the initial QC filters. Below is a descript of each step of the reference creation process.

Sequence Clustering

The first step of reference creation is to split quality filtered sequences into closely related clusters (controlled using --dist_threshold). This is accomplished using a multi-step process, which was designed to handle very large data sets. A general overview of this process is described below:

  1. Hierarchal clustering
  • A subset of sequences are randomly selected (controlled using --max_cluster).
  • The subset is split into clusters using the "complete linkage" of pairwise average nucleotide identity (ANI) between sequences (controlled using --dist_threshold).
  1. Assign clusters
  • Representatives of each cluster are selected.
  • Remaining sequences are assigned to one of the clusters by comparing to the representatives using the pairwise ANI.
  • Unassigned sequences are passed to step 1.

This process is repeated until all sequences have been assigned into a cluster.

Note

Average nucleotide identity is estimated using sourmash.

Consensus Generation

Reference sequences are created for each cluster by taking the most common nucleotide identity at each position. This is accomplished using the general process below:

  1. Sequences are aligned within each cluster using mafft.
  2. The frequency of each nucleotide identity is calculated for each position in the alignment and the most common nucleotide is returned. Nucleotide codes are selected at random for ambiguous bases (i.e., RYSWKMBDHVN; e.g., N = A | T | C | G). Nucleotides with the same frequency are selected at random.

Note

We are aware that this approach is not particularly robust to recombination. Please feel free to share any ideas about how we could improve this!

Condensing References

Clone this wiki locally