Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions colabfold/mmseqs/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def mmseqs_search_monomer(
dbbase: Path,
base: Path,
uniref_db: Path = Path("uniref30_2302_db"),
template_db: Path = Path(""), # Unused by default
template_db: Path = Path("pdb100_230517"), # Unused by default
metagenomic_db: Path = Path("colabfold_envdb_202108_db"),
mmseqs: Path = Path("mmseqs"),
use_env: bool = True,
Expand Down Expand Up @@ -322,7 +322,9 @@ def main():
parser.add_argument(
"--db1", type=Path, default=Path("uniref30_2302_db"), help="UniRef database"
)
parser.add_argument("--db2", type=Path, default=Path(""), help="Templates database")
parser.add_argument(
"--db2", type=Path, default=Path("pdb100_230517"), help="Templates database"
)
parser.add_argument(
"--db3",
type=Path,
Expand Down
35 changes: 35 additions & 0 deletions tests/test_search.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import sys

import pytest

from colabfold.mmseqs import search


def test_use_templates_without_db2(tmp_path, monkeypatch):
"""--use-templates must use the template database of setup_databases.sh (#748)"""
dbbase = tmp_path.joinpath("colabfold_db")
dbbase.mkdir()
for suffix in [".dbtype", ".idx"]:
dbbase.joinpath(f"uniref30_2302_db{suffix}").touch()
query = tmp_path.joinpath("query.fasta")
query.write_text(">test\nMEIIALLIEEGIIIIKDKKVAERFLKDLESSQGMDWKEIRERAERAKKQLEEGIEWAKKTKL\n")

monkeypatch.setattr(search, "run_mmseqs", lambda *args, **kwargs: None)
monkeypatch.setattr(
sys,
"argv",
[
"colabfold_search",
str(query),
str(dbbase),
str(tmp_path.joinpath("out")),
"--use-env",
"0",
"--use-templates",
"1",
],
)

# the template database is not downloaded here, but the error has to name it
with pytest.raises(FileNotFoundError, match="pdb100_230517"):
search.main()