It is known that introns tend to start with a pair of GT bases. Assume the base composition of the second base of introns is known from previous studies to be 80% T, 10% G, 5% A, and 5% C. The following code is given with specific observed sequence, define an improved 5' exon-intron junction detector using this information:

```
>install.packages("HMM")
>library("HMM")
>library(seqinr)
>States = c("Exon", "5site", "Intron")
>Symbols = c("A","C","G","T")
>transProbs = matrix(c('EE'=0.9,'E5'=0.1,'EI'=0, '5E'=0, '55'=0,
'5I'=1.0, 'IE'=0, 'I5'=0, 'II'=1.0), c(length(States),
length(States)), byrow = TRUE)
>emissionProbs = matrix(c('A'=0.25,'C'=0.25,'G'=0.25,'T'=0.25,
'A'=0.05,'C'=0.0,'G'=0.95,'T'=0.0, 'A'=0.4,'C'=0.1,'G'=0.1,'T'=0.4),
c(length(States), length(Symbols)), byrow = TRUE)
>observed_seq <- s2c('CTTCATGTGAAAGCAGACGTAAGTCA')
>hmm <- initHMM(States, Symbols, startProbs = c(1,0,0), transProbs =
transProbs, emissionProbs = emissionProbs)
>vit <- viterbi(hmm, observed_seq) #viterbi best labelling
>post <- posterior(hmm, observed_seq) # posterior decoding
```