Pipeline
Last updated 27 June 2026
Overview
Emu method distinguishes itself from other methods by not requiring consensus sequences but rather uses the information from the entire community (all the reads) to statistically correct abundance. This smooths-out sequencing noise. By re-estimating probabilities, Emu reduces false positives significantly compared to raw proper alignments.
::: concept Consensus Sequences Multiple reads of the same molecule. :::
Emu’s algorithm is a two-stage process:
- Classic proper alignments are generated between reads and the reference database
- EM-based error-correction step is performed to iteratively refine species-level relative abundances based on total read-mapping counts
Notation
- the set of reads - we denote a single specific read as
- the set of references (the reference database) - we denote a single specific sequence in the database as
- the set of all taxonomy identifications in - prior sample composition the vector of probabilities (entries of the vector map one-to-one to species) - the vector
initially starts with uniformly distributed elements: - the set of all alignment types (e.g. mismatch, deletion) - the alignment type event is denoted
- the probability that (by nanopore sequencing) we get a read given we are sequencing a reference , in other words the probability the a read aligns to reference sequence - the probability that (by nanopore sequencing) we get a read given the sequence comes from - the probability is the true taxon for read
Emu Pipeline
Mapping
The EMU pipeline starts by taking the input reads
Along with the alignments, we also receive the CIGAR string for each alignment. This supplies us with the information on all differences between the read and references they were aligned against also called the nucleotide alignment type.
Initial probabilities
EMU takes the numerical values for each alignment type and determines the initial likelihoods for them. This is simply:
where
Similarly, EMU calculates the likelihood for each pairwise sequence alignment:
where
The normalization of
::: note Probability & Likelihood Probability is about data given a model. We talk about the probability of an outcome. Likelihood is about the model given data. We talk about the likelihood of a parameter. :::
If for specific pair no alignment is made, we set
Since we are interested in the most-likely taxonomy of
where
We also set initially
1. Expectation step (E-step)
Now, using Bayes’ Theorem we can flip the conditional relation in probability
where we used the fact that
::: idea This step down-weights alignments to species that are currently estimated to be rare in the sample.
With error-prone Oxford Nanopore reads, a single read often looks like several different species. To fix this, the algorithm introduces and uses
The “flip” calculates
By flipping the probability, Emu penalizes the rare species. It assumes that an any random read is statistically much more likely to come from the “soup” of species we already know exists in the sample, rather than a species that is barely present. :::
2. Maximization step (M-step)
Redistribute the sample composition
::: idea In many regression problems (like standard linear regression), we can invert a matrix and solve for the optimal weights analytically in a single step. This is not done in practice however as inverting matrix is a harder problem.
The goal of Emu is to find the abundance profile
To solve this analytically, we would normally take the derivative of
The problem, however, arises when we take the derivative of log of sums and we end up with:
This is a set of non-linear equations that cannot be isolated algebraically. Since we cannot jump to the peak of the mountain (analytical solution) because the map is too complex (coupled non-linear equations), we use the Expectation-Maximization (EM) algorithm to climb the hill one step at a time.
- Step 1 (Expectation): Pretend we know the abundance
. Use it to softly assign reads to species. - Step 2 (Maximization): Pretend these assignments are hard facts. Just count the reads to update
. :::
3. Convergence step
To check for convergence we calculate the total log-likelihood
If the increase in
Noise trimming
The probabilistic nature of the algorithm causes the vector
then the threshold is
read from for small samples reads from for samples of $ >1000$
Final pass
Emu performs one final round of abundance redistribution with the trimmed vector to produce the final community profile. In the software the resulting