localalign
Return local optimal and suboptimal alignments between two sequences
Syntax
AlignStruct
= localalign(Seq1
, Seq2
)
AlignStruct
= localalign(Seq1
, Seq2
,
...'NumAln', NumAlnValue
, ...)
AlignStruct
= localalign(Seq1
, Seq2
,
...'MinScore', MinScoreValue
, ...)
AlignStruct
= localalign(Seq1
, Seq2
,
...'Percent', PercentValue
, ...)
AlignStruct
= localalign(Seq1
, Seq2
,
...'DoAlignment', DoAlignmentValue
, ...)
AlignStruct
= localalign(Seq1
, Seq2
,
...'Alphabet', AlphabetValue
, ...)
AlignStruct
= localalign(Seq1
, Seq2
,
...'ScoringMatrix', ScoringMatrixValue
,
...)
AlignStruct
= localalign(Seq1
, Seq2
,
...'Scale', ScaleValue
, ...)
AlignStruct
= localalign(Seq1
, Seq2
,
...'GapOpen', GapOpenValue
, ...)
Description
returns
information about the first optimal (highest scoring) local alignment
between two sequences in a MATLAB® structure. AlignStruct
= localalign(Seq1
, Seq2
)
calls AlignStruct
= localalign(Seq1
, Seq2
,
...'PropertyName
', PropertyValue
,
...)localalign
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:
returns
information about one or more nonintersecting, local alignments (optimal
and suboptimal). It limits the number of alignments to return by specifying
the number of local alignments to return. It returns the alignments
in decreasing order according to their score.AlignStruct
= localalign(Seq1
, Seq2
,
...'NumAln', NumAlnValue
, ...)
returns
information about nonintersecting, local alignments (optimal and suboptimal),
whose score is greater than AlignStruct
= localalign(Seq1
, Seq2
,
...'MinScore', MinScoreValue
, ...)MinScoreValue
.
returns information about one or more nonintersecting local alignments
(optimal and suboptimal), whose scores are within AlignStruct
= localalign(Seq1
, Seq2
,
...'Percent', PercentValue
, ...)PercentValue
percent
of the highest score. It returns the alignments in decreasing order
according to their score.
specifies
whether to include the pairwise alignments in the AlignStruct
= localalign(Seq1
, Seq2
,
...'DoAlignment', DoAlignmentValue
, ...)Alignment
field
of the output structure. Choices are true
(default)
or false
.
specifies
the type of sequences. Choices are AlignStruct
= localalign(Seq1
, Seq2
,
...'Alphabet', AlphabetValue
, ...)'AA'
(default)
or 'NT'
.
specifies the scoring matrix to use for the local
alignment.AlignStruct
= localalign(Seq1
, Seq2
,
...'ScoringMatrix', ScoringMatrixValue
,
...)
specifies
a scale factor applied to the output scores, thereby controlling the
units of the output scores. Choices are any positive value. Default
is AlignStruct
= localalign(Seq1
, Seq2
,
...'Scale', ScaleValue
, ...)1
, which does not change the units of the output
score.
specifies
the penalty for opening a gap in the alignment. Choices are any positive
value. Default is AlignStruct
= localalign(Seq1
, Seq2
,
...'GapOpen', GapOpenValue
, ...)8
.
Input Arguments
|
First amino acid or nucleotide sequence specified by any of the following:
Tip For help with letter and integer representations of amino acids and nucleotides, see Amino Acid Lookup or Nucleotide Lookup. |
|
Second amino acid or nucleotide sequence, which |
|
Positive scalar (< or = Note If you specify a Tip Use Default: |
|
Positive scalar specifying the minimum score of local, nonintersecting alignments (optimal and suboptimal) to return. Note If you specify a Tip Use |
|
Positive scalar between Note If you specify a Tip Use |
|
Controls the inclusion of the pairwise alignments in the |
|
Character vector or string specifying the type of sequences. Choices are
|
|
Either of the following:
Note If you need to compile |
|
Positive value that specifies a scale factor that is applied to the output scores, thereby controlling the units of the output scores. For example, if the output score is initially determined in
bits, and you enter Default is Note If the Tip Before comparing alignment scores from multiple alignments,
ensure that the scores are in the same units. Use the |
|
Positive value specifying the penalty for opening a gap in the alignment. Default: |
Output Arguments
|
MATLAB structure or array of structures containing information about the local optimal and suboptimal alignments between two sequences. Each structure represents an optimal or suboptimal alignment and contains the following fields.
|
Examples
Limit the number of alignments to return between two sequences by specifying the number of alignments:
% Create variables containing two amino acid sequences. Seq1 = 'VSPAGMASGYDPGKA'; Seq2 = 'IPGKATREYDVSPAG'; % Use the NumAln property to return information about the % top three local alignments. struct1 = localalign(Seq1, Seq2, 'numaln', 3) struct1 = Score: [3x1 double] Start: [3x2 double] Stop: [3x2 double] Alignment: {3x1 cell} % View the scores of the first and second alignments. struct1.Score(1:2) ans = 11.0000 9.6667 % View the first alignment. struct1.Alignment{1} ans = VSPAG ||||| VSPAG
Limit the number of alignments to return between two sequences by specifying a minimum score:
% Create variables containing two amino acid sequences. Seq1 = 'VSPAGMASGYDPGKA'; Seq2 = 'IPGKATREYDVSPAG'; % Use the MinScore property to return information about % only local alignments with a score greater than 8. % Use the DoAlignment property to exclude the actual alignments. struct2 = localalign(Seq1,Seq2,'minscore',8,'doalignment',false) struct2 = Score: [2x1 double] Start: [2x2 double] Stop: [2x2 double]
Limit the number of alignments to return between two sequences by specifying a percentage from the maximum score:
% Create variables containing two amino acid sequences. Seq1 = 'VSPAGMASGYDPGKA'; Seq2 = 'IPGKATREYDVSPAG'; % Use the Percent property to return information about only % local alignments with a score within 15% of the maximum score. struct3 = localalign(Seq1, Seq2, 'percent', 15) struct3 = Score: [2x1 double] Start: [2x2 double] Stop: [2x2 double] Alignment: {2x1 cell}
Specify a scoring matrix and gap opening penalty when aligning two sequences:
% Create variables containing two nucleotide sequences. Seq1 = 'CCAATCTACTACTGCTTGCAGTAC'; Seq2 = 'AGTCCGAGGGCTACTCTACTGAAC'; % Create a scoring matrix with a match score of 10 and a mismatch % score of -9 sm = [10 -9 -9 -9; -9 10 -9 -9; -9 -9 10 -9; -9 -9 -9 10]; % Use the ScoringMatrix and GapOpen properties when returning % information about the top three local alignments. struct4 = localalign(Seq1, Seq2, 'alpha', 'nt', ... 'scoringmatrix', sm, 'gapopen', 20, 'numaln', 3) struct4 = Score: [3x1 double] Start: [3x2 double] Stop: [3x2 double] Alignment: {3x1 cell}
More About
References
[1] Barton, G. (1993). An efficient algorithm to locate all locally optimal alignments between two sequences allowing for gaps. CABIOS 9, 729–734.
Version History
Introduced in R2009b
See Also
multialignread
| fastaread
| gethmmalignment
| seqalignviewer
| multialign
| nwalign
| swalign
| blosum
| pam
| dayhoff
| gonnet
| nuc44