Skip to content

hmm.HMM.create() fails for DNA models #8

Description

@andrewparkermorgan

Hi,

Reading of models built from DNA sequences appears to fail: below I show an example using a motif from the Dfam database (DF0000029).

cp = hmm.HMM.create(input_format = "hmmer", file = "DF0000029.hmm")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/apm/anaconda3/lib/python3.4/site-packages/tral/hmm/hmm.py", line 261, in create
    hmmer_probabilities = next(HMM.read(file))
  File "/Users/apm/anaconda3/lib/python3.4/site-packages/tral/hmm/hmm_io.py", line 187, in read
    for i in string_emissions]
  File "/Users/apm/anaconda3/lib/python3.4/site-packages/tral/hmm/hmm_io.py", line 187, in <listcomp>
    for i in string_emissions]
ValueError: could not convert string to float: 'c'

It seems that too many columns are read from MATCH lines in the model: currently the number of columns is hard-coded as 20 (ie. amino acids) in hmm_io.py @ line 104.

Is there any support for DNA sequences in tral?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions