Description: expect muscle3 as executable instead of muscle.
 When installed concurrently, muscle3 may be a preferrable default over plain
 muscle because the latter would probably be muscle 5, which is not compatible
 with the biopython wrapper.
 .
 Forwarding is not needed since wrappers are deprecated and due to be removed
 in an upcoming biopython version.
Author: Étienne Mollier <emollier@debian.org>
Bug-Debian: https://bugs.debian.org/1009118
Forwarded: not-needed
Last-Update: 2022-11-24
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- python-biopython.orig/Bio/Align/Applications/_Muscle.py
+++ python-biopython/Bio/Align/Applications/_Muscle.py
@@ -10,6 +10,14 @@
 from Bio.Application import _Option, _Switch, AbstractCommandline
 from subprocess import getoutput
 
+# Prefer defaulting to muscle3, as can be installed alongside muscle version 5.
+default_muscle = "muscle3"
+output = getoutput(default_muscle + " --version")
+if "not found" in output or "not recognized" in output:
+    # The below should ascertain plain muscle is muscle 3 indeed.
+    output = getoutput("muscle --version")
+    if "MUSCLE" in output and "Edgar" in output:
+        default_muscle = "muscle"
 
 class MuscleCommandline(AbstractCommandline):
     r"""Command line wrapper for the multiple alignment program MUSCLE.
@@ -43,7 +51,7 @@
 
     """
 
-    def __init__(self, cmd="muscle", **kwargs):
+    def __init__(self, cmd=default_muscle, **kwargs):
         """Initialize the class."""
         CLUSTERING_ALGORITHMS = ["upgma", "upgmb", "neighborjoining"]
         DISTANCE_MEASURES_ITER1 = [
--- python-biopython.orig/Tests/test_Muscle_tool.py
+++ python-biopython/Tests/test_Muscle_tool.py
@@ -51,12 +51,18 @@
 else:
     from subprocess import getoutput
 
-    output = getoutput("muscle -version")
+    output = getoutput("muscle3 -version")
     # Since "not found" may be in another language, try and be sure this is
     # really the MUSCLE tool's output
     if "not found" not in output and "not recognized" not in output:
         if "MUSCLE" in output and "Edgar" in output:
-            muscle_exe = "muscle"
+            muscle_exe = "muscle3"
+    else:
+        # Maybe the unversionned version will still be muscle 3.
+        output = getoutput("muscle -version")
+        if "not found" not in output and "not recognized" not in output:
+            if "MUSCLE" in output and "Edgar" in output:
+                muscle_exe = "muscle"
 
 if not muscle_exe:
     raise MissingExternalDependencyError(
