Main Content

hmmprofalign

Align query sequence to profile using hidden Markov model alignment

Syntax

Score = hmmprofalign(Model, Seq)
[Score, Alignment] = hmmprofalign(Model, Seq)
[Score, Alignment, Pointer] = hmmprofalign(Model, Seq)
hmmprofalign(..., 'ShowScore', ShowScoreValue, ...)
hmmprofalign(..., 'Flanks', FlanksValue, ...)
hmmprofalign(..., 'ScoreFlanks', ScoreFlanksValue, ...)
hmmprofalign(..., 'ScoreNullTransitions', ScoreNullTransitionsValue, ...)

Arguments

Model

Hidden Markov model created with the function hmmprofstruct.

Seq

Amino acid or nucleotide sequence. You can also enter a structure with the field Sequence.

ShowScoreValue

Controls the display of the scoring space and the winning path. Choices are true or false (default).

FlanksValue

Controls the inclusion of the symbols generated by the FLANKING INSERT states in the output sequence. Choices are true or false (default).

ScoreFlanksValueControls the inclusion of the transition probabilities for the flanking states in the raw score. Choices are true or false (default).
ScoreNullTransitionsValueControls the adjustment of the raw score using the null model for transitions (Model.NullX). Choices are true or false (default).

Description

Score = hmmprofalign(Model, Seq) returns the score for the optimal alignment of the query amino acid or nucleotide sequence (Seq) to the profile hidden Markov model (Model). Scores are computed using log-odd ratios for emission probabilities and log probabilities for state transitions.

[Score, Alignment] = hmmprofalign(Model, Seq) also returns a character vector showing the optimal profile alignment.

Uppercase letters and dashes correspond to MATCH and DELETE states respectively (the combined count is equal to the number of states in the model). Lowercase letters are emitted by the INSERT states. For more information about the HMM profile, see hmmprofstruct.

[Score, Alignment, Pointer] = hmmprofalign(Model, Seq) also returns a vector of the same length as the profile model with indices pointing to the respective symbols of the query sequence. Null pointers (NaN) mean that such states did not emit a symbol in the aligned sequence because they represent model jumps from the BEGIN state of a MATCH state, model jumps from the from a MATCH state to the END state, or because the alignment passed through DELETE states.

hmmprofalign(..., 'PropertyName', PropertyValue, ...) calls hmmprofalign 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:

hmmprofalign(..., 'ShowScore', ShowScoreValue, ...), when ShowScoreValue is true, displays the scoring space and the winning path.

hmmprofalign(..., 'Flanks', FlanksValue, ...), when FlanksValue is true, includes the symbols generated by the FLANKING INSERT states in the output sequence.

hmmprofalign(..., 'ScoreFlanks', ScoreFlanksValue, ...), when ScoreFlanksValue is true, includes the transition probabilities for the flanking states in the raw score.

hmmprofalign(..., 'ScoreNullTransitions', ScoreNullTransitionsValue, ...), when ScoreNullTransitionsValue is true, adjusts the raw score using the null model for transitions (Model.NullX).

Note

Multiple target alignment is not supported in this implementation. All the Model.LoopX probabilities are ignored.

Examples

collapse all

This example shows how to align a query sequence to a HMM model profile using HMM model alignment.

Load the HMM profile structure of the 7 transmembrane receptor (Secretin family).

load('hmm_model_examples','model_7tm_2');

Load an example sequence and align it to the profile structure using the HMM alignment.

load('hmm_model_examples','sequences');
humanSeq = sequences(1).Sequence;
[a,s]=hmmprofalign(model_7tm_2,humanSeq,'showscore',true)

Figure contains an axes object. The axes object with title log-odds score for best path, xlabel Sequence index, ylabel Profile state contains 2 objects of type image, line. One or more of the lines displays its values using only markers

a = 
483.7231
s = 
'YILVKAIYTLGYSVS-LMSLATGSIILCLFRKLHCTRNYIHLNLFLSFILRAISVLVKDDVLYSSSgtlhcpdqpsswvgCKLSLVFLQYCIMANFFWLLVEGLYLHTLL-VA---MLPPRRCFLAYLLIGWGLPTVCIGAWTAAR------------LYLEDTGC-WDTN-DHSVPWWVIRIPILISIIVNFVLFISIIRILLQKLT----SPDVGGNDQSQYKRLAKSTLLLIPLFGVHYMVFAVFPIS----ISSKYQILFELCLGSFQGLVVAVLYCFLNSEV'

Version History

Introduced before R2006a