PhD research · UFMS · interactive demo
Mapping a DNA sequence onto a de Bruijn graph
Given a sequence s and a de Bruijn graph G, find the walk in G whose spelled sequence is as close as possible to s. This page runs the exact algorithm from the thesis, ported line by line from the C++ in variante1/bmt, on a small example, step by step.
1 Input
- de Bruijn graph
- Multilayer graph
- Dijkstra
- Traceback
- Result
2 de Bruijn graph G
3 Terminal
4 Multilayer graph and Dijkstra
How the multilayer graph works
Each k-mer of G becomes a chain of k nodes, one per base: this is the sequence graph. The multilayer graph stacks one copy of it per base of s, plus a dummy column for skipping bases. Every edge has cost 0 or 1:
- down-diagonal to a neighbour in the next layer: read the next base of
sagainst a base of the graph (0 if equal, 1 otherwise); - straight down: drop a base of
s(cost 1); - sideways inside a layer: spend a base of the graph without reading
s(cost 1).
The cheapest source-to-sink path, found with Dijkstra, is an optimal mapping. The method follows Rautiainen and Marschall, Aligning sequences to general graphs in O(V + mE) time.
5 Alignment
cost