Documentation Center

  • Trial Software
  • Product Updates

showalignment

Display color-coded sequence alignment

Syntax

showalignment(Alignment)

showalignment(..., 'MatchColor', MatchColorValue, ...)
showalignment(..., 'SimilarColor' SimilarColorValue, ...)
showalignment(..., 'StartPointers', StartPointersValue, ...)
showalignment(..., 'Columns', ColumnsValue, ...)
showalignment(..., 'TerminalGap', TerminalGapValue, ...)

Description

showalignment(Alignment) displays a color-coded sequence alignment in a MATLAB® Figure window.

showalignment(..., 'PropertyName', PropertyValue, ...) calls showalignment with optional properties that use property name/property value pairs. You can specify one or more properties in any order. Enclose each PropertyName in single quotation marks. Each PropertyName is case insensitive. These property name/property value pairs are as follows:


showalignment(..., 'MatchColor', MatchColorValue, ...)
specifies the color to highlight matching characters in the output display.

showalignment(..., 'SimilarColor' SimilarColorValue, ...) specifies the color to highlight similar characters in the output display.

showalignment(..., 'StartPointers', StartPointersValue, ...) specifies the starting indices in the original sequences of a local pairwise alignment.

showalignment(..., 'Columns', ColumnsValue, ...) specifies the number of characters to display in one row when displaying a pairwise alignment, and labels the start of each row with the sequence positions.

showalignment(..., 'TerminalGap', TerminalGapValue, ...) controls the inclusion or exclusion of terminal gaps from the count of matches and similar residues when displaying a pairwise alignment. TerminalGapValue can be true (default) or false.

Input Arguments

Alignment

Pairwise or multiple sequence alignment specified by one of the following:

MatchColorValue

Color to highlight matching characters in the output display. Specify the color with one of the following:

  • Three-element numeric vector of RGB values

  • String containing a predefined single-letter color code

  • String containing a predefined color name

For example, to use cyan, enter [0 1 1], 'c', or 'cyan'. For more information on specifying colors, see ColorSpec.

Default: Red, which is specified by [1 0 0], 'r', or 'red'

SimilarColorValue

Color to highlight similar characters in the output display. Specify the color with one of the following:

  • Three-element numeric vector of RGB values

  • String containing a predefined single-letter color code

  • String containing a predefined color name

For example, to use cyan, enter [0 1 1], 'c', or 'cyan'. For more information on specifying colors, see ColorSpec.

Default: Magenta, which is specified by [1 0 1], 'm', or 'magenta'

StartPointersValue

Two-element vector that specifies the starting indices in the original sequences of a local pairwise alignment.

    Tip   You can use the third output returned by swalign as the StartPointersValue.

ColumnsValue

Scalar that specifies the number of characters to display in one row when displaying a pairwise alignment.

Default: 64

TerminalGapValue

Specifies whether to include or exclude terminal gaps from the count of matches and similar residues when displaying a pairwise alignment. Choices are true (default) or false.

Examples

Display a pairwise sequence alignment:

% Globally align two amino acid sequences
[Score, Alignment] = nwalign('VSPAGMASGYD','IPGKASYD');
% Display the color-coded alignment
showalignment(Alignment);

Notice that for pairwise sequence alignments, matching and similar characters appear in red and magenta respectively..

 

Display a multiple sequence alignment

% Read a multiple-sequence alignment file
gag = multialignread('aagag.aln');
% Display the color-coded alignment
showalignment(gag)

Notice that for multiple sequence alignments, highly conserved positions appear in red and conserved positions appear in magenta.

    Tip   To view a multiple-sequence alignment and interact with it, use the seqalignviewer function.

Alternatives

You can also display a multiple or pairwise sequence alignment using the seqalignviewer function. The alignment displays in the Biological Sequence Alignment window, where you can view and interactively adjust a sequence alignment.

See Also

| | | | | | | |

Tutorials

Was this topic helpful?