Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: plan7.HMM.validate() fails to raise exceptions with ill formatted hmm profiles #69

Open
Sann5 opened this issue May 31, 2024 · 1 comment
Labels
bug Something isn't working external Issue comes from a dependency or some external code.

Comments

@Sann5
Copy link

Sann5 commented May 31, 2024

According to the documentation "HMMER", "NAME", "LENG", "ALPH", "HMM" are mandatory tags in the header of hmm files but I found that:

  1. omitting the "ALPH" line will generate a segmentation fault (not raise an exception), and
  2. omitting the "HMM" line will not raise an exception

It seems to me that this is an issue with the HMMER parser since this behaviour also arises when using the CLI, i.e.
hmmconvert ill_formated.hmm.

Here is the relevant code to reproduce the behavior (I'm using a MacbookPro with an Intel processor and MacOS Sonoma):

  1. Create an environment
conda create --name test_pyhmmer bioconda::pyhmmer
conda activate test_pyhmmer
  1. Download and unzip the attached hmm files and test script
    test_files_and_script.zip

  2. Try validating the hmm files with the attached script

# Expected behavior: exception raised
# Observed behavior: segmentation fault
cd my_downloads_are_here
./validate_hmm_profiles.py no_alph.hmm
# Expected behavior: exception raised
# Observed behavior: no exception raised
./validate_hmm_profiles.py no_hmm.hmm

Just as a reference, this is what the validation script is doing...

from pyhmmer.plan7 import HMMFile
import sys

with HMMFile(sys.argv[1]) as hmm_file:
    for hmm_profile in hmm_file:
        hmm_profile.validate(tolerance=0.0001)
@Sann5
Copy link
Author

Sann5 commented Jun 1, 2024

Small update. I emailed the Eddy Lab because of this bug. Sean said they have addressed both issues and that the changes will appear in the next HMMER3 release.

@althonos althonos added bug Something isn't working external Issue comes from a dependency or some external code. labels Jun 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working external Issue comes from a dependency or some external code.
Projects
None yet
Development

No branches or pull requests

2 participants