circular map icon  PlasmidTools Software

Manual > Sequence alignment

Sequence alignment

Alignment procedure

The sequence alignment editor Alignment icon is specially designed to align sequencing data to a reference sequence (but naturally, can be used for other purposes as well).

Start by adding a reference sequence (project file), set the range to be used in the alignment, then add the sequence reads. The sequence reads must be files stored on disk, the file format may be PlasmidTools project files, plain sequence, FastA, GenBank, EMBL, IG or GCG. The sequence format of opened files is detected automatically based on the file's contents independently of file extension. This facilitates opening of non-standard file types like *.seq, which may have different internal formats. The filtering options in the Open dialog merely affects which files are shown in the list. The analysis/detection of sequence format is independent of file type/extension.

Sequence reads may also be added by pasting sequences copied elsewhere, one at a time, using the 'Add from clipboard' button. The copied sequence must be plain text.

Added sequences are checked against both strands of the reference sequence and aligned in correct position and orientation. The (+) or (-) in front of the sequence name in the leftmost column shows if the match was found in forward or reverse direction. Sequences extending beyond the start and end of the reference are trimmed away. This only affects the displayed alignment. The sequences are stored in their full length, so any realign (Right-click – Realign, or Right-click - Realign all) will use the full-length sequences.

The alignment may then be edited as wished, for example inserting gaps (-). The color coding of matched/mismatched bases is updated automatically when changes are made. A right-click menu offers additional tools to edit and organize the alignment. The alignment can be saved to file, and reopened later to continue the work, and exported to a rich-text formatted file (RTF) that can be opened in rich-text editors like Microsoft Word.

Aligning algorithm & window size

The aligning algorithm works by locating the first continuous match being equal to or longer than the set "Window" size (the default is 20 bases) and inserts the sequence read in this context, no internal gaps are made. Thus, any mismatches in the beginning and end, being the regions with uncertain readout, are just ignored in the aligning process. It's up to the user to modify these or not. Any internal insertion or deletion is easily noticed due to the shift in colors.

The "Window" parameter defines the length of the sub-sequence used to locate a match. The aligning process works progressively through the sequence to be aligned, takes fragments of Window size and scans the reference for a match. For each cycle the Window is shifted along the sequence by a certain distance, the exact number depends on the length of the sequence. For sequences longer than 320 the increment is 10, for sequences shorter than 21 the increment is 1. Intermediate lengths have intermediate increments.

For common sequencing tasks a Window size of 20 should be fine, since a perfect match of this length is expected to be found, and it will most probably be in correct position and orientation. However, if the sequence to be aligned is very short, and may contain mismatches, setting a smaller Window size may be neccessary to locate a match. If the sequence contains a palindromic sequence, for example a restriction cut-site, the Window size should exceed its length to ensure aligning in correct orientation. The Window size should in no case be longer than any of the sequences included in the aligning process (including the reference sequence).

Handling long sequences

The maximum length of single lines displayed in the editor depends on the font-size set for the alignment, and the number is displayed in the toolbar. If the sequence subject to sequencing is less than the max length, while the total length of the project sequence is longer, just use the range parameters to set the range to be used in the alignment.

If the sequence subject to sequencing exceeds the max length, make two or several alignments by shifting the range values, and for convenience, save a separate alignment file for each range.

Whenever the range is changed the sequence reads are realigned automatically.