showalignment - Display color-coded sequence alignment

Syntax

showalignment(Alignment)

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

Arguments

Alignment

Either of the following:

  • 3-by-N character array showing the pairwise alignment of two sequences, such as returned by the nwalign or swalign function.

  • Vector or character array containing a multiple alignment, such as returned by the multialign function.

MatchColorValue

Color to highlight matching characters. Can be either of the following:

  • 1-by-3 RGB vector

  • String specifying one of the following colors:

    • 'r' — red

    • 'g' — green

    • 'b' — blue

    • 'c' — cyan

    • 'm' — magenta

    • 'y' — yellow

Default is red, [255 0 0] or 'r'.

SimilarColorValue

Color to highlight similar characters. Can be either of the following:

  • 1-by-3 RGB vector

  • String specifying one of the following colors:

    • 'r' — red

    • 'g' — green

    • 'b' — blue

    • 'c' — cyan

    • 'm' — magenta

    • 'y' — yellow

Default is magenta, [255 0 255] or 'm'.

StarterPointersValueTwo-element vector that specifies the starting indices in the original sequences of a local pairwise alignment, such as the third output returned by the swalign function.
ColumnsValue

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

Description

showalignment(Alignment) displays a color-coded alignment in a MATLAB® Figure window. For pairwise sequence alignments, matching and similar characters are highlighted in red and magenta, respectively. For multiple sequence alignments, highly conserved positions are highlighted in red and conserved positions are highlighted in magenta.

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


showalignment(Alignment, ...'MatchColor', MatchColorValue, ...)
specifies the color to highlight matching characters in the output display. Default is red, [255 0 0] or 'r'. For example, to use cyan, enter [0 255 255] or 'c'.

showalignment(Alignment, ...'SimilarColor' SimilarColorValue, ...) specifies the color to highlight similar characters in the output display. Default is magenta, [255 0 255] or 'm'.

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

showalignment(Alignment, ...'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. Default is 64.

Examples

Globally align two amino acid sequences and display their color-coded alignment.

[Score, Alignment] = nwalign('VSPAGMASGYD','IPGKASYD');
showalignment(Alignment);        

Read a multiple-sequence alignment file and display the color-coded alignment.

gag = multialignread('aagag.aln');
showalignment(gag)

See Also

Bioinformatics Toolbox™ functions: multialign, multialignviewer, nwalign, swalign

  


 © 1984-2008- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS