Repository navigation
Alignment
Alignment lines up each of your sequences against a reference, so that the same position in every sequence sits in the same column. Turn it on in the Sequence Settings when your sequences are not already aligned, for example when they are raw reads of different lengths. If you aligned them elsewhere, leave Align set to None.
MicrobeTrace can align sequences, but that has never been its main job. For the best results, align your sequences with a dedicated tool first. There is a list of sequence alignment software on Wikipedia to start from.
Alignment is the one step where a bad setting can change every result that follows. A poor alignment makes unrelated bases look like mismatches, or makes shifted sequences look different from their neighbors. Those false differences change the distances, which change the links, clusters and trees. So look at the alignment before you trust anything built on it.
Open the Sequence Settings button on the Files view. On the Alignment tab, the Align setting has two choices:
- None (the default): the sequences are used as they are.
- Smith-Waterman: each sequence is aligned to the reference before distances are computed.
The other alignment settings appear only when Smith-Waterman is chosen.
The Reference Source setting says what the sequences are aligned to. It has three choices:
- Consensus (the default). MicrobeTrace builds a reference from your sequences. It first picks a provisional reference, the sequence most similar to the others by k-mer comparison. If you have fewer than 12 sequences, that sequence is the reference. Otherwise it aligns all of them to it, and at each position keeps the most common base. Where gaps are the most common, the position is dropped.
- First Sequence: the first sequence in your loaded files.
- Load From FASTA: a Reference file input appears. Choose a FASTA file, then pick one of its sequences from the list next to it.
Earlier versions used HXB2 as a default reference for HIV. They no longer do (see What's New). If you analyze another organism, a reference from your own data or a reference you load is the right choice.
These are the scores and limits the aligner uses. The defaults are:
| Setting | Default | What it does |
|---|---|---|
| Match Reward | 1 | Score added for each matching base. |
| Mismatch Cost | 1 | Score taken off for each mismatched base. |
| Gap Opening Cost | 5 | Score taken off for starting a gap. |
| Gap Extension Cost | 2 | Score taken off for each further position in a gap. |
| Band Width | 100 | How many bases a gap may shift a sequence, beyond the difference in length from the reference. 0 is fastest. A blank band means no limit, which is slowest. |
The aligner runs in global mode, so each whole sequence is lined up against the whole reference. A wider band places more gaps correctly but takes longer.
Once aligned, each sequence is set to the length of the reference. Leading gaps account for where it starts, and trailing gaps fill out a short sequence. Any part of a sequence that runs past the end of the reference is cut off. MicrobeTrace then tells you how many sequences were cut or padded.
With Align set to None, sequences of different lengths are not lined up. MicrobeTrace warns you that positions will not correspond and that distances may be wrong.
The Sequence Settings dialog has a preview at the bottom of the Alignment tab. Click it to refresh the preview. Each row is a sequence and each column is a position, drawn as colored cells.
Look for:
- columns of consistent color, which are positions that line up;
- sequences that look shifted one way or the other relative to their neighbors;
- long runs of gaps where you expected bases.
If something looks wrong, change the Band Width or the scores and preview again. The Audit tab in the same dialog also checks for empty and all-gap sequences, and for RNA, before you load them.