Skip to content
Snippets Groups Projects
Commit 01d2ac18 authored by Bienchen's avatar Bienchen
Browse files

Merge branch 'main' into feature-modelcif

parents d9b13702 f758d66d
No related branches found
No related tags found
No related merge requests found
......@@ -19,7 +19,7 @@ class TestProveanAnno(unittest.TestCase):
self.nrdb_prefix = "nr"
self.nrdb = os.path.join(self.nrdb_dir, self.nrdb_prefix)
os.makedirs(self.nrdb_dir)
open(self.nrdb, "a").close()
open(self.nrdb, 'a').close()
# generate fake executables
self.provean_exe = os.path.join(self.tmp_dir.name, "provean")
......@@ -66,6 +66,16 @@ class TestProveanAnno(unittest.TestCase):
cdhit_exe=self.cdhit_exe,
blastdbcmd_exe=self.blastdbcmd_exe,
)
# try only with nrdb dir but without prefix
with self.assertRaises(ValueError):
ProveanVarSeqAnno(
self.nrdb_dir,
tmp_dir=self.tmp_dir.name,
provean_exe=self.provean_exe,
psiblast_exe=self.psiblast_exe,
cdhit_exe=self.cdhit_exe,
blastdbcmd_exe=self.blastdbcmd_exe,
)
ProveanVarSeqAnno(
self.nrdb,
tmp_dir=self.tmp_dir.name,
......
......@@ -96,7 +96,11 @@ class ProveanVarSeqAnno(VarSeqAnno):
f"not exist ({self.blast_nrdb_dirname})"
)
blast_files = os.listdir(self.blast_nrdb_dirname)
n = sum([f.startswith(self.blast_nrdb_prefix) for f in blast_files])
n = 0
for f in blast_files:
if f.startswith(self.blast_nrdb_prefix) and \
os.path.isfile(os.path.join(self.blast_nrdb_dirname,f)):
n += 1
if n == 0:
raise ValueError(
f"No files starting with expected prefix "
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment