py-tesorter: add post install hmmpress step (#44940)

Signed-off-by: Shane Nehring <snehring@iastate.edu>
This commit is contained in:
snehring 2024-07-01 09:51:26 -05:00 committed by GitHub
parent aa58d3c170
commit 76ca264b72
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -3,6 +3,8 @@
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from glob import glob
from spack.package import *
@ -29,5 +31,20 @@ class PyTesorter(PythonPackage):
depends_on("py-biopython", type=("build", "run"))
depends_on("py-xopen", type=("build", "run"))
depends_on("hmmer@3.3:", type="run")
depends_on("hmmer@3.3:", type=("build", "run"))
depends_on("blast-plus", type="run")
@run_after("install")
def run_hmmpress(self):
hmmpress = Executable(self.spec["hmmer"].prefix.bin.hmmpress)
db_dir = join_path(
self.prefix,
"lib",
f"python{self.spec['python'].version.dotted[:2]}",
"site-packages",
"TEsorter",
"database",
)
with working_dir(db_dir):
for f in glob("*.hmm"):
hmmpress(f)