swalign

Locally align two sequences using the Smith-Waterman algorithm

Syntax

swalign(Seq1, Seq2, 'PropertyName', PropertyValue...)
[Score, Alignment] = swalign(Seq1, Seq2) 
[Score, Alignment, Start] = swalign(Seq1, Seq2)

swalign(..., 'Alphabet', AlphabetValue)
swalign(..., 'ScoringMatrix', ScoringMatrixValue)
swalign(..., 'Scale', ScaleValue)
swalign(..., 'GapOpen', GapOpenValue)
swalign(..., 'ExtendGap', ExtendGapValue)
swalign(..., 'Showscore', ShowscoreValue)

Arguments

Seq1, Seq2

Nucleotide or amino acid sequences. Enter a character string or vector of integers. You can also enter a structure with the field Sequence.

Alphabet

Property to select an amino acid or nucleotide sequences. Enter either 'AA' or 'NT'. The default value is 'AA'.

ScoringMatrix

Enter the name of a scoring matrix. Values are 'PAM40', 'PAM250', DAYHOFF, GONNET, 'BLOSUM30' increasing by 5 to 'BLOSUM90', or 'BLOSUM62', or 'BLOSUM100'.

The default value when AlphabetValue = 'aa' is 'BLOSUM50', while the default value when AlphabeValue = 'nt' is nuc44.

ScaleProperty to specify a scaling factor for a scoring matrix.

GapOpen

Enter an integer for the gap penalty. Default value is 8.

ExtendGap

Enter an integer for the extended gap penalty. The default value equals the GapOpen value.

ShowscoreProperty to control displaying the scoring space and the winning path. Enter either true or false. The default value is false.

Description

swalign(Seq1, Seq2, 'PropertyName', PropertyValue...) returns the alignment score in bits for the optimal alignment. The scale factor used to calculate the score is provided by the scoring matrix. If this is not defined, then swalign returns the raw score.

[Score, Alignment] = swalign(Seq1, Seq2) returns a 3-by-n character array showing the two sequences and the local alignment between them. Amino acids that match are indicated with the symbol |, while related amino acids (nonmatches with a positive scoring matrix value) are indicated with the symbol :.

[Score, Alignment, Start] = swalign(Seq1, Seq2) returns a 2-by-1 vector with the starting point indices where the alignment begins for each sequence.

swalign(...,'Alphabet', AlphabetValue) specifies whether the sequences are amino acids ('AA') or nucleotides ('NT'). The default value is 'AA'.

swalign(..., 'ScoringMatrix', ScoringMatrixValue) specifies the scoring matrix to use for the alignment. The default is 'blosum50' for Alphabet = 'AA' or 'NUC44' for Alphabet = NT.

swalign(..., 'Scale', ScaleValue) indicates the scale factor of the scoring matrix to return the score using arbitrary units. If the scoring matrix also provides a scale factor, then both are used.

swalign(..., 'GapOpen', GapOpenValue) specifies the penalty for opening a gap in the alignment. The default gap open penalty is 8.

swalign(..., 'ExtendGap', ExtendGapValue) specifies the penalty for extending a gap in the alignment. If ExtendGap is not specified, then extensions to gaps are scored with the same value as GapOpen.

swalign(..., 'Showscore', ShowscoreValue) displays the scoring space and the winning path.

Examples

Return the score in bits and the local alignment using the default ScoringMatrix ('BLOSUM50') and default values for the GapOpen and ExtendGap values.

[Score, Alignment] = swalign('VSPAGMASGYD','IPGKASYD')

Score =
     8.6667

Alignment =
PAGMASGYD
| | || ||
P-GKAS-YD

Align two amino sequences using a specified scoring matrix ('pam250') and a gap open penalty of 5.

[Score, Alignment] = swalign('HEAGAWGHEE','PAWHEAE',...
                             'ScoringMatrix', 'pam250',...
                             'GapOpen',5)

Score =
     8
Alignment =
GAWGHE
:|| ||
PAW-HE

Align two amino sequences and return the Score in nat units (nats).

[Score, Alignment] = swalign('HEAGAWGHEE','PAWHEAE',...
                             'Scale',log(2))

Score =
    6.4694
Alignment =
AWGHE
|| ||
AW-HE

See Also

Bioinformatics Toolbox functions blosum, dayhoff, gonnet, nt2aa, nwalign, showalignment


© 1994-2005 The MathWorks, Inc.