althonos / pyhmmer

Cython bindings and Python interface to HMMER3.
https://pyhmmer.readthedocs.io
MIT License
128 stars 12 forks source link

Generating sequences #39

Closed mireklzicar closed 1 year ago

mireklzicar commented 1 year ago

Is it possible to generate sequences based on the hmm profile transition probabilities? (e.g. sample from the alphabet based on the vocabulary)

althonos commented 1 year ago

Hi @mireklzicar, at the moment there is no way to do this from either HMMER or PyHMMER I think. However, it should be possible to implement in Python, given that you have access to the emission scores and transition probabilities of the HMMs, so you could walk the HMM states and sample like you suggest.