Realignment
Realigning a section of an alignment
If you have created an alignment, it is possible to realign a part of it, leaving the rest of the alignment unchanged:
Select a part of the alignment to realign | Right-click the selection | Choose the option "Realign selection"
This will open a window allowing you to set the parameters for the realignment (see figure 22.10).
Figure 22.10: Realigning a section of an alignment.
Learn more about the options available to you in the sections Gap Costs and Fast or accurate alignment algorithm.
It is possible for an alignment to become shorter or longer as a result of the realignment of a region. This is because gaps may have to be inserted in, or deleted from, the sequences not selected for realignment. This will only occur for entire columns of gaps in these sequences, ensuring that their relative alignment is unchanged.
Realigning a selection is a very powerful tool for editing alignments in several situations:
- Removing changes. If you change the alignment in a specific region manually but decide to undo all the edits you just made, you can easily select the region that was edited and realign it.
- Adjusting the number of gaps. If you have a region in an alignment which has too many gaps, you can select the region and realign it with a higher gap cost.
- Combine with fixpoints. When you have an alignment where two residues are not aligned although they should have been, you can set an alignment fixpoint on each of the two residues, select the region and realign it using the fixpoints. Now, the two residues are aligned with each other and everything in the selected region around them is adjusted to accommodate this change.
Realigning a subset of aligned sequences
To realign only a subset of the sequences of an alignment, you have to select the sequences you want to realign by click-and-drag on their entire length, and open the selection in a new view. This means that the sequences you want to select need to be situated on top of each other in a single stack.
A small stack is easily obtainable by dragging the sequences by their names to the top of the alignment. But when a large quantity of sequences needs to be moved to sit together, we recommend using the selection boxes that are available when checking the option "Show selection boxes" from the Alignment settings section in the right-hand side panel (figure 22.11). Select all the sequences you want to realign independently of the rest of the alignment, and right-click on the name of one of the sequences to choose the option "Sort Sequences by Marked Status". This will bring all checkbox-selected items to the top of the alignment.
Figure 22.11: Realigning a subset of the sequences that are part of an alignment. Note that we can see here the menu available when right clicking on the names of the sequences.
You can then easily click-and-drag your selection of sequences (this is made easier if you select the "No wrap" setting in the right-hand side panel). By right-clicking on the selected sequences (not on their names, but on the sequences themselves as seen in figure 22.12), you can choose the option "Open selection in a new view", with the ability to run any relevant tool on that sub-alignment.
Figure 22.12: Open the selected sequences in a new window to realign them.