Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations cowski on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calculating frequency-transition matrix from state-transition matrix

Status
Not open for further replies.

saints123

Computer
Joined
Mar 27, 2012
Messages
1
Location
SG
I am solving a Hidden Markov Model (HMM) problem for DNA sequences.

Given:
1. DNA sequence
ATGGGCTCCTCCGCCATCACCGTGAGCTTCCTCCTCTTTCTGGCATTTCAGCTCCCAGGGCAAACAGGAGCAAATCCCGTGTATGGCTCTGTGTCCAATGCAGACCTGATGGATTTCAAGTAAAAG
2. State-transition matrix (21x6)

State A T G C End
0 1 -1 -1 -1 -1
1 -1 2 -1 -1 -1
2 -1 -1 3 -1 -1
3 4 7 6 5 -1
4 8 11 10 9 -1
5 8 11 10 9 -1
6 8 11 10 9 -1
7 12 11 13 9 -1
8 14 17 16 15 -1
9 14 17 16 15 -1
10 14 17 16 15 -1
11 14 17 16 15 -1
12 18 17 19 15 -1
13 18 17 16 15 -1
14 4 7 6 5 20
15 4 7 6 5 20
16 4 7 6 5 20
17 4 7 6 5 20
18 -1 -1 -1 -1 20
19 -1 -1 -1 -1 20
20 -1 -1 -1 -1 -1

Output:
I need to calculate the 20X20 frequency-transition matrix

Example:
ATGGGCTCCT

A->T is state 1->2 ==> count:1

T->G is state 2->3 ==> count:1

G->G is state 3->6 ==> count:1

G->G is state 6->10==> count:1

G->C is state 10->15==>count:1

State 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
0
1 1
2 1
3 1
4
5
6 1
7
8
9
10 1
11
12
13
14
15
16
17
18
19
20

I know how to proceed manually but I am unclear on how to solve this using Matlab.

Please guide me on how to proceed. Any assistance shall be appreciated!

Thanks!
 
Homework postings are not allowed

TTFN
faq731-376
7ofakss
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top