Skip to content
Merged
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
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ build/

.history/


# pip packages
dist/
*.egg-info/
7 changes: 5 additions & 2 deletions abcfold/abcfold.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import configparser
import json
import os
import re
import shutil
import socketserver
import sys
Expand Down Expand Up @@ -153,14 +154,16 @@ def run(args, config, defaults, config_file):
number_of_models=args.number_of_models,
num_recycles=args.num_recycles,
sif_path=args.sif_path,
save_distogram=args.save_distogram
)

if af3_success:
pattern = re.compile(f"^{name}.*", re.IGNORECASE)
af3_out_dir = list(
[
dir_
for dir_ in args.output_dir.glob(f"*{name.lower()}*")
if dir_.is_dir()
for dir_ in args.output_dir.glob("*")
if dir_.is_dir() and pattern.match(dir_.name)
]
)[0]
ao = AlphafoldOutput(af3_out_dir, input_params, name)
Expand Down
9 changes: 7 additions & 2 deletions abcfold/alphafold3/run_alphafold3.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ def run_alphafold3(
interactive: bool = False,
number_of_models: int = 5,
num_recycles: int = 10,
save_distogram: bool = False
) -> bool:
"""
Run Alphafold3 using the input JSON file
Expand Down Expand Up @@ -48,6 +49,7 @@ def run_alphafold3(
interactive=interactive,
number_of_models=number_of_models,
num_recycles=num_recycles,
save_distogram=save_distogram
)

logger.info("Running Alphafold3")
Expand Down Expand Up @@ -77,6 +79,7 @@ def generate_af3_cmd(
number_of_models: int = 10,
num_recycles: int = 5,
interactive: bool = False,
save_distogram: bool = False,
) -> str:
"""
Generate the Alphafold3 command
Expand Down Expand Up @@ -110,7 +113,8 @@ def generate_af3_cmd(
--model_dir=/root/models \
--output_dir=/root/af_output \
--num_diffusion_samples {number_of_models}\
--num_recycles {num_recycles}
--num_recycles {num_recycles}\
--save_distogram {str(save_distogram).lower()}
"""

else:
Expand All @@ -127,5 +131,6 @@ def generate_af3_cmd(
--model_dir=/root/models \
--output_dir=/root/af_output \
--num_diffusion_samples {number_of_models}\
--num_recycles {num_recycles}
--num_recycles {num_recycles}\
--save_distogram {str(save_distogram).lower()}
"""
6 changes: 6 additions & 0 deletions abcfold/argparse_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,12 @@ def alphafold_argparse_util(parser):
Alphafold3 to search for templates",
)

parser.add_argument(
"--save_distogram",
action="store_true",
help="[optional] store AlphaFold3 distograms",
)

return parser


Expand Down
Loading