Skip to content

Commit

Permalink
Expose env pairing to cli
Browse files Browse the repository at this point in the history
  • Loading branch information
milot-mirdita committed May 3, 2024
1 parent 07644a8 commit 57b220e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
7 changes: 5 additions & 2 deletions colabfold/batch.py
Original file line number Diff line number Diff line change
Expand Up @@ -731,7 +731,8 @@ def get_msa_and_templates(
]:
from colabfold.colabfold import run_mmseqs2

use_env = msa_mode == "mmseqs2_uniref_env"
use_env = msa_mode == "mmseqs2_uniref_env" or msa_mode == "mmseqs2_uniref_env_envpair"
use_envpair = msa_mode == "mmseqs2_uniref_env_envpair"
if isinstance(query_sequences, str): query_sequences = [query_sequences]

# remove duplicates before searching
Expand Down Expand Up @@ -840,7 +841,7 @@ def get_msa_and_templates(
paired_a3m_lines = run_mmseqs2(
query_seqs_unique,
str(result_dir.joinpath(jobname)),
use_env,
use_envpair,
use_pairing=True,
pairing_strategy=pairing_strategy,
host_url=host_url,
Expand Down Expand Up @@ -1304,6 +1305,7 @@ def run(

# backward-compatibility with old options
old_names = {"MMseqs2 (UniRef+Environmental)":"mmseqs2_uniref_env",
"MMseqs2 (UniRef+Environmental+Env. Pairing)":"mmseqs2_uniref_env_envpair",
"MMseqs2 (UniRef only)":"mmseqs2_uniref",
"unpaired+paired":"unpaired_paired"}
msa_mode = old_names.get(msa_mode,msa_mode)
Expand Down Expand Up @@ -1700,6 +1702,7 @@ def main():
default="mmseqs2_uniref_env",
choices=[
"mmseqs2_uniref_env",
"mmseqs2_uniref_env_envpair",
"mmseqs2_uniref",
"single_sequence",
],
Expand Down
3 changes: 2 additions & 1 deletion colabfold/colabfold.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,13 +168,14 @@ def download(ID, path):

if use_pairing:
use_templates = False
use_env = False
mode = ""
# greedy is default, complete was the previous behavior
if pairing_strategy == "greedy":
mode = "pairgreedy"
elif pairing_strategy == "complete":
mode = "paircomplete"
if use_env:
mode = mode + "-env"

# define path
path = f"{prefix}_{mode}"
Expand Down

0 comments on commit 57b220e

Please sign in to comment.