Closed snerligit closed 2 years ago
Hi @snerligit ,
You're trying to create a DigitalSequence
but using a text sequence, so the encoding is wrong (it needs to be encoded with A=0, C=1, D=2
, etc.; with your current code you're encoding it with ASCII, so A=65, C=67...).
To create a new DigitalSequence
from a text sequence, first create a TextSequence
, then call the digitize
method as follow:
seq = pyhmmer.easel.TextSequence(name=b"seq1", sequence=sequence.encode()).digitize(hmm.alphabet)
I've added a check in v0.6.3
, so that the code you posted raises an exception when creating a DigitalSequence
with invalid characters, instead of segfaulting later in the search pipeline.
Hi,
I have created a hmm file and stored on the disk. I read it later to see how I score a specific sequence using search_hmm. But that results in segmentation fault. See the code snippet below:
` with pyhmmer.plan7.HMMFile(targetfile) as hmmfilehandler:
Any help debugging this issue is appreciated. Thank you.