diff --git a/CHANGELOG.md b/CHANGELOG.md index 9e98c059bae823d2cdf724635ba5d55e49a9e80e..77fe29b8a47d3d2d560e320ddfe79261d7c9ee17 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,11 @@ +Changes in Release 3.1.0 +================================================================================= + +* `run_af2` Python package: + * Add command line option `--num-multimer-predictions-per-model` + * Switch default value of option `--use-gpu-relax` to False + + Changes in Release 3.0.0 ================================================================================= diff --git a/run_af2/src/run_af2/_shared.py b/run_af2/src/run_af2/_shared.py index 5671bb34db78f50d862ac12d026db5ccda9d29f1..31a46a1bc1ea5a5ef044fce176b2cdc4262e8beb 100644 --- a/run_af2/src/run_af2/_shared.py +++ b/run_af2/src/run_af2/_shared.py @@ -128,7 +128,15 @@ def parse_af2_arguments(parser): "--use-gpu-relax", action="store_true", help="Use GPU for relaxation (if GPU is enabled).", - default=True, + default=False, + ) + af2_group.add_argument( + "--num-multimer-predictions-per-model", + type=int, + help="Number of models per prediction. Only applies with " + + "--model-preset=multimer.", + metavar="<NUMBER>", + default=5, ) af2_group.add_argument( "--version", @@ -244,6 +252,16 @@ def parse_af2_arguments(parser): flush=True, ) + # check that --use-gpu-relax is only enabled together with --use-gpu + if opts.use_gpu_relax and not opts.use_gpu: + print( + "WARNING: Enabling --use-gpu-relax on non-gpu compute nodes " + + "will fail. You are seeing this warning since you enabled " + + "--use-gpu-relax but not --use-gpu.", + file=sys.stderr, + flush=True, + ) + if opts.singularity_image is not None: if not os.path.exists(opts.singularity_image): print( diff --git a/run_af2/src/run_af2/run_singularity.py b/run_af2/src/run_af2/run_singularity.py index 66b5542b59044ee9ebb7534658683035064db2e0..1fe4bd23094ebdde35020181da4f31c3321c5583 100644 --- a/run_af2/src/run_af2/run_singularity.py +++ b/run_af2/src/run_af2/run_singularity.py @@ -119,6 +119,7 @@ def _assemble_singularity_call( # pylint: disable=too-many-arguments use_precomputed_msas, no_run_relax, use_gpu_relax, + num_multimer_predictions_per_model, data_paths, extra_arg_list, ): @@ -152,6 +153,8 @@ def _assemble_singularity_call( # pylint: disable=too-many-arguments f"--max_template_date={max_template_date}", f"--db_preset={db_preset}", f"--model_preset={model_preset}", + "--num_multimer_predictions_per_model=" + + f"{num_multimer_predictions_per_model}", "--logtostderr", ] ) @@ -207,7 +210,8 @@ def run_af2_singularity_image( # pylint: disable=too-many-arguments model_preset="monomer", use_precomputed_msas=False, no_run_relax=False, - use_gpu_relax=True, + use_gpu_relax=False, + num_multimer_predictions_per_model=5, af2_image_file=None, # af2_image_dir="/export/soft/singularity-containers/alphafold", af2_image_dir="/scicore/home/schwede/GROUP/alphafold_data/", @@ -280,6 +284,12 @@ def run_af2_singularity_image( # pylint: disable=too-many-arguments :param use_gpu_relax: Run relaxation on GPU. Corresponds to the use_gpu_relax parameter in AF2. :type use_gpu_relax: :class:`bool` + :param num_multimer_predictions_per_model: In multimer mode, no. of + predictions per model. + Corresponds to the + num_multimer_predictions_per_model + parameter in AF2. + :type num_multimer_predictions_per_model: :class:`int` :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. @@ -410,6 +420,7 @@ def run_af2_singularity_image( # pylint: disable=too-many-arguments use_precomputed_msas, no_run_relax, use_gpu_relax, + num_multimer_predictions_per_model, data_paths, extra_arg_list, ) @@ -481,6 +492,7 @@ def main(): opts.use_precomputed_msas, opts.no_run_relax, opts.use_gpu_relax, + opts.num_multimer_predictions_per_model, opts.singularity_image, extra_arg_list=extra_arg_list, **data_paths,