is there a library that provides simple features for learning/representing markov models on DNA/RNA sequences? for example given a long sequence, learn the matrix of dinucleotide frequencies from that sequence, and then answer questions like: what is the expected number of occurrences of a subsequence given that dinucleotide freq. matrix?

e.g. if you have:

```
s = ATGGGGTATTGGGTTAAAAGGGGTTATAGCCCGATGCGCGT
```

what is the expected number of occurrences of `ATATG`

given the dinucleotide freq. matrix of `s`

?

Is there a library that implements all of these simple markov-model related features? BioPython seems to have some HMM features but I was not able to find actual documentation or examples. thanks.