diff --git a/CHANGELOG.md b/CHANGELOG.md index 62679c651772fa40b4d4bd01986485bb310e0874..d3ddb5a67273e3de1e21c0b90348806b0ac032cd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,11 @@ +Changes in Release 2.2.0 +================================================================================= + +* `run_af2` Python package: + * add command line options `--use-precomputed-msas`, `--no-run-relax` and + `--use-gpu-relax` + + Changes in Release 2.1.0 ================================================================================= @@ -10,7 +18,7 @@ Changes in Release 2.0.0 * `run_af2` Python package: * Prepare to run AF2 pipeline 2.1 - * rename command line options `--pdb70_database_path` and + * Rename command line options `--pdb70_database_path` and `--obsolete_pdbs_path` to `--pdb70-database-path` and `--obsolete-pdbs-path` diff --git a/run_af2/src/run_af2/_shared.py b/run_af2/src/run_af2/_shared.py index f2affaaddcbfddc4799fb4ce76ce1fa1baf0dda1..577ec12bbd016bfca4dd32ceb13b71b4485e0c78 100644 --- a/run_af2/src/run_af2/_shared.py +++ b/run_af2/src/run_af2/_shared.py @@ -120,6 +120,26 @@ def parse_af2_arguments(parser): metavar="<true|false>,<true|false>,...", default=None, ) + af2_group.add_argument( + "--use-precomputed-msas", + action="store_true", + help="Use existing MSAs from current working directory.", + default=False, + ) + af2_group.add_argument( + "--no-run-relax", + action="store_true", + help="Don't Run relaxation on models after prediction. That is " + + "inverted of alphafold's own --run_relax, and meant to replace " + + "'--run_relax=False'", + default=False, + ) + af2_group.add_argument( + "--use-gpu-relax", + action="store_true", + help="Use GPU for relaxation (if GPU is enabled).", + default=True, + ) af2_group.add_argument( "--version", action="version", diff --git a/run_af2/src/run_af2/run_singularity.py b/run_af2/src/run_af2/run_singularity.py index 9b04f8d4aa18c2ac12d5b217b32ce7d7cdf5d12f..24af0d08ced100999eba6c68c084d94613d7c562 100644 --- a/run_af2/src/run_af2/run_singularity.py +++ b/run_af2/src/run_af2/run_singularity.py @@ -117,6 +117,9 @@ def _assemble_singularity_call( # pylint: disable=too-many-arguments db_preset, model_preset, is_prokaryote_list, + use_precomputed_msas, + no_run_relax, + use_gpu_relax, data_paths, extra_arg_list, ): @@ -156,6 +159,14 @@ def _assemble_singularity_call( # pylint: disable=too-many-arguments if is_prokaryote_list is not None: snglrty_cmd.append(f"--is_prokaryote_list={is_prokaryote_list}") + bool_args = { + "use_precomputed_msas": use_precomputed_msas, + "run_relax": not no_run_relax, + "use_gpu_relax": use_gpu_relax, + } + for arg, val in bool_args.items(): + snglrty_cmd.append(f"--{arg}={str(val)}") + for flag, path in data_paths.items(): snglrty_cmd.append(f"--{flag}={path}") @@ -198,6 +209,9 @@ def run_af2_singularity_image( # pylint: disable=too-many-arguments db_preset="full_dbs", model_preset="monomer", is_prokaryote_list=None, + use_precomputed_msas=False, + no_run_relax=False, + use_gpu_relax=True, af2_image_file=None, # af2_image_dir="/export/soft/singularity-containers/alphafold", af2_image_dir="/scicore/home/schwede/GROUP/alphafold_data/", @@ -264,6 +278,17 @@ def run_af2_singularity_image( # pylint: disable=too-many-arguments is_prokaryote_list parameter in AF2. :type is_prokaryote_list: :class:`str` like needed by AF2, e.g. "true,false,true" + :param use_precomputed_msas: Use existing MSAs from cwd. Corresponds to the + use_precomputed_msas parameter in AF2. + :type use_precomputed_msas: :class:`bool` + :param no_run_relax: Disable relaxation at the end of modelling. + Corresponds to AF2's no_run_relax parameter but works + oppositely, True means no relaxation, False means + relaxation. + :type no_run_relax: :class:`bool` + :param use_gpu_relax: Run relaxation on GPU. Corresponds to the + use_gpu_relax parameter in AF2. + :type use_gpu_relax: :class:`bool` :param af2_image_file: Declare a Singularity image to run the AF2 pipeline from. If None, an image from af2_image_dir will be used. @@ -392,6 +417,9 @@ def run_af2_singularity_image( # pylint: disable=too-many-arguments db_preset, model_preset, is_prokaryote_list, + use_precomputed_msas, + no_run_relax, + use_gpu_relax, data_paths, extra_arg_list, ) @@ -461,6 +489,9 @@ def main(): opts.db_preset, opts.model_preset, opts.is_prokaryote_list, + opts.use_precomputed_msas, + opts.no_run_relax, + opts.use_gpu_relax, opts.singularity_image, extra_arg_list=extra_arg_list, **data_paths, @@ -474,4 +505,4 @@ def main(): # LocalWords: str dir snglrty tmpdir tmp argparse os ArgumentParser metavar # LocalWords: RawDescriptionHelpFormatter nargs getenv startswith ValueError # LocalWords: RuntimeError bfd BFD dbs mgnify HHblits uniclust Uniclust pdb -# LocalWords: multimer seqres uniprot +# LocalWords: multimer seqres uniprot msas MSAs precomputed