From 2e48b5d15b673b89a988999566a6e7562a56b5ff Mon Sep 17 00:00:00 2001
From: Stefan Bienert <stefan.bienert@unibas.ch>
Date: Wed, 16 Mar 2022 09:20:44 +0100
Subject: [PATCH] Prepare for AF2 2.2.0

---
 CHANGELOG.md                           | 10 +++++++++-
 run_af2/bin/submit-af2                 |  6 ------
 run_af2/src/run_af2/_shared.py         | 20 --------------------
 run_af2/src/run_af2/run_singularity.py | 11 -----------
 4 files changed, 9 insertions(+), 38 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index d3ddb5a..9e98c05 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,8 +1,16 @@
+Changes in Release 3.0.0
+=================================================================================
+
+* `run_af2` Python package:
+  * Prepare to run AF2 pipeline 2.2.0
+  * Remove option `--is-prokaryote-list`
+
+
 Changes in Release 2.2.0
 =================================================================================
 
 * `run_af2` Python package:
-  * add command line options `--use-precomputed-msas`, `--no-run-relax` and
+  * Add command line options `--use-precomputed-msas`, `--no-run-relax` and
     `--use-gpu-relax`
 
 
diff --git a/run_af2/bin/submit-af2 b/run_af2/bin/submit-af2
index 014b8b8..1108268 100755
--- a/run_af2/bin/submit-af2
+++ b/run_af2/bin/submit-af2
@@ -29,7 +29,6 @@ if test $# -lt 2; then
     echo "usage: submit-af2 [--use-gpu]"
     echo "                  [--db-preset {reduced_dbs,full_dbs}]"
     echo "                  [--model-preset {monomer,monomer_casp14,monomer_ptm,multimer}]"
-    echo "                  [--is-prokaryote-list <bool>,<bool>,...]"
     echo "                  [--max-template-date YYYY-MM-DD]"
     echo "                  <OUTPUT DIR> <FASTA FILE> [<FASTA FILE> ...]"
     exit 1
@@ -56,11 +55,6 @@ for i in 1 2 3 4 5; do
                        shift
                        AF_PIPELINE_PARAM="${AF_PIPELINE_PARAM} --model-preset ${1}"
                        shift
-                   else if test x"${1}" = x"--is-prokaryote-list"; then
-                            shift
-                            AF_PIPELINE_PARAM="${AF_PIPELINE_PARAM} --is-prokaryote-list ${1}"
-                            shift
-                       fi
                    fi
               fi
          fi
diff --git a/run_af2/src/run_af2/_shared.py b/run_af2/src/run_af2/_shared.py
index 577ec12..5671bb3 100644
--- a/run_af2/src/run_af2/_shared.py
+++ b/run_af2/src/run_af2/_shared.py
@@ -110,16 +110,6 @@ def parse_af2_arguments(parser):
         + "AF2 pipeline.",
         default="monomer",
     )
-    af2_group.add_argument(
-        "-i",
-        "--is-prokaryote-list",
-        type=str,
-        help="For the multimer model, declare sequences to by prokaryotic or "
-        + "not. Goes by true/ false, needs to be listed for every input FASTA "
-        + "as a list.",
-        metavar="<true|false>,<true|false>,...",
-        default=None,
-    )
     af2_group.add_argument(
         "--use-precomputed-msas",
         action="store_true",
@@ -254,16 +244,6 @@ def parse_af2_arguments(parser):
                 flush=True,
             )
 
-    # check that --is-prokaryote-list has as many values as sequence files
-    if opts.is_prokaryote_list is not None:
-        if opts.is_prokaryote_list.count(",") + 1 != len(opts.fasta_files):
-            print(
-                "Number of values for '--is-prokaryote-list' does not match "
-                + "the number of FASTA files. Aborting.",
-                file=sys.stderr,
-            )
-            sys.exit(1)
-
     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 24af0d0..66b5542 100644
--- a/run_af2/src/run_af2/run_singularity.py
+++ b/run_af2/src/run_af2/run_singularity.py
@@ -116,7 +116,6 @@ def _assemble_singularity_call(  # pylint: disable=too-many-arguments
     use_gpu,
     db_preset,
     model_preset,
-    is_prokaryote_list,
     use_precomputed_msas,
     no_run_relax,
     use_gpu_relax,
@@ -156,8 +155,6 @@ def _assemble_singularity_call(  # pylint: disable=too-many-arguments
             "--logtostderr",
         ]
     )
-    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,
@@ -208,7 +205,6 @@ def run_af2_singularity_image(  # pylint: disable=too-many-arguments
     use_gpu=False,
     db_preset="full_dbs",
     model_preset="monomer",
-    is_prokaryote_list=None,
     use_precomputed_msas=False,
     no_run_relax=False,
     use_gpu_relax=True,
@@ -273,11 +269,6 @@ def run_af2_singularity_image(  # pylint: disable=too-many-arguments
     :param model_preset: Model configuration - corresponds to the model_preset
                          parameter in AF2.
     :type model_preset: :class:`str`
-    :param is_prokaryote_list: For the multimer model, mark sequences as
-                               prokaryotic. Corresponds to the
-                               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`
@@ -416,7 +407,6 @@ def run_af2_singularity_image(  # pylint: disable=too-many-arguments
         use_gpu,
         db_preset,
         model_preset,
-        is_prokaryote_list,
         use_precomputed_msas,
         no_run_relax,
         use_gpu_relax,
@@ -488,7 +478,6 @@ def main():
             opts.use_gpu,
             opts.db_preset,
             opts.model_preset,
-            opts.is_prokaryote_list,
             opts.use_precomputed_msas,
             opts.no_run_relax,
             opts.use_gpu_relax,
-- 
GitLab