Edit alignments

The Alignment view (Image alignment) is the primary, graphical view of an alignment. Zooming in and out in this view allows different levels of detail to be considered, from individual residues and gaps when zoomed in, to the general form of large regions when zoomed out. The alignment can also be edited in various ways.

This section focuses on functionality specific to the Alignment view, in particular, functionality not already described in the section about working with individual sequences.

Topics covered:

Marking sequences and working with marked sequences

Sequences in an alignment can be marked (figure 25.11), and those marked sequences can then be removed from the alignment or manually moved, as a set, in a single action. The order of the sequences in the alignment can also be sorted based on marked status.

Marking sequences is intended for interactive use. The marked status of a sequence is not saved when the alignment is closed.

Marking sequences To mark a sequence, click once on its label or check the selection checkbox to the right of the sequence label. The labels of marked sequences are highlighted.

Checkboxes for marking sequences are not displayed by default. To show these, check the Show selection boxes option in the Sequence layout Side Panel palette.

Clicking once on an additional sequence name, or in an additional checkbox, marks an additional sequence.

To simultaneously mark multiple sequences:

Mark All and Invert All Marks can be useful when most sequences should be marked.

Clearing marks Clearing marked status can be done in a number of ways:

Image alignment_marking_seqs
Figure 25.11: Selection boxes are being displayed, and sequences ATP8a1 and O94296 have been marked. The selection box next for sequence P57792 has been right-clicked, opening a menu with options for marking, unmarking or inverting the marked status for all sequences in the alignment.

Changing the sequence order

To change the order of sequences in the alignment:

Notes relating to changing the sequence order:

Image alignment_rtclick_on_label_or_seq
Figure 25.12: The context menu opened by right-clicking on residues in a sequence or by right-clicking on a label.

Selecting residues in alignments

Regions in individual sequences can be selected like in other data types that contain sequence information. Resiudes that have been selected are highlighted in purple. Positions selected in at least one sequence will be enclosed in a red box for all sequences (figure 25.13).

Image alignment_multi_selection
Figure 25.13: Two regions in three sequences have been selected, indicated by purple highlighting. Red boxes surround regions in all sequences where a selection has been made in any sequence at that position.

The selected residues in an alignment can be copied and pasted into external text editing programs, or similar, if desired. For alignment data, pasting to a monospace font such as Courier is recommended.

Selecting a region in non-adjacent sequences

To select a region in some sequences, where not all those sequences are adjacent to one another, start by selecting the region of interest in one sequence. Then hold down the Ctrl key (Image command_key_web on Mac) while clicking anywhere on within the same position range in each of the other sequences where the selection should be made.

Making multiple selections in different regions in an alignment

To select multiple regions in an alignment, keep the Ctrl key depressed, (Image command_key_web on Mac) while dragging the mouse cursor horizontally across the residues of the relevant coordinate range, and vertically, if desired, to also select that region in adjacent sequences.

Notes:

Selecting long regions in an alignment

When selecting long regions in an alignment, zooming out can help for some cases. However, for accurate end-point selection, keeping the view zoomed in and using the Shift key is recommended. Specifically: select the initial residue or residues in the desired region, scroll to where the final residue is visible, press the Shift key and then click the mouse. All residues in between the initially selected residues and this position will be selected.

If the residue clicked on while the Shift key is depressed is in a different sequence to the residue(s) initially selected, then all residues, in all sequences between the initial and final selected residue are selected.

Selecting all residues for a single, long sequence can also be achieved using a linked Table view.

Editing, including working with gaps

Repositioning gaps in the alignment

To update the positions of gaps in the alignment:

This can be done for selections on a single sequence or in a singe region selected in multiple sequences, including when selections are across non-adjacent sequences.

Image move_gaps_in_alignment
Figure 25.14: Residues adjacent to gaps have been selected in three sequences in an alignment (left) and then dragged leftwards, thereby repositioning the gaps adjacent to those residues (right).

Inserting gaps into the alignment

To add gaps to an alignment:

Edit residues in a sequence

Individual sequences can be edited to update or add residues. To do this:

The alignment itself is not affected by the addition or removal of residues this way. If residues are added, gaps will be inserted in the corresponding positions of the other sequences in the alignment. If residues are removed, gaps will be inserted into the edited sequence.

Delete residues and gaps in one or more sequences

Residues or gaps can be deleted from one or more sequences simultaneously. To do this:

Note: Deleting residues for some, but not all, sequences in an alignment using Delete Selection will change the alignment. Remaining residues in sequences are moved to the left after a deletion, potentially resulting in sequences no longer being aligned.

Subsections of an alignment can be realigned, as described in Realignment.

To remove bases or gaps without changing the alignment, edit individual sequence regions, as described above. Using that method, gaps are added to compensate for such changes.

Deleting sequences from an alignment

To delete a single sequence from the list, right-click the sequence label or any of its sequence residues and choose the option Delete Sequence from the menu.

To delete multiple sequences, mark those to be removed, right-click any sequence label or sequence residue, and choose the option Delete Marked Sequences from the menu.

Sequences can also be deleted using the Table view (Image table_16_n_p).

Renaming a sequence in an alignment

To rename a sequence in the alignment.

If the sequence label has been changed so that something other than the name is being used, then the new name will not be visible in the Alignment view, but the update will still be visible in other views, for example, the Table view (Image table_16_n_p).

Copying annotations to other sequences

Annotations on one sequence can be transferred to other sequences in the alignment. Annotations can be transferred to just specified sequences or to all other sequences.

To copy an annotation to specified sequences:

To copy an annotation to all other sequences:

Note: Copied/transferred annotations contain the same qualifier text as the original. As an example, if the annotation contains 'translation' as qualifier text, this translation will be copied to the new sequence and will thus reflect the translation of the original sequence, not the new sequence.

To adjust which annotations are shown, and how they are displayed in the Alignment view, use options in the Side Panel palettes Annotation types and Annotation layout.

Image alignment_rtclick_on_annotation
Figure 25.15: Actions relating to annotations are offered in the menu opened by right-clicking on an annotation in the graphical view of the alignment.

Adding sequences to an alignment

To add sequences to an existing alignment, rerun the Create Alignment tool and use the existing alignment as input together with the desired new sequence(s) and/or alignment(s).



Subsections