Subject: raise runtime error when trying to use wrapper on muscle 5.
Bug: https://github.com/biopython/biopython/issues/3902
Bug-Debian: https://bugs.debian.org/1009118
From: =?utf-8?q?=C3=89tienne_Mollier?= <emollier@debian.org>
Last-Update: 2022-11-24

Date: Sat, 14 Sep 2024 09:48:28 +0200

The muscle wrapper only supports muscle 3, and the biopython project is aiming
to remove wrapper support in an upcoming version.  Port of the wrapping code
to support both muscle versions will thus probably never happen.  The affected
code section is due to disappear in an upcoming biopython version and it thus
not forwarded upstream.

---
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
@@ -9,6 +9,7 @@
 from Bio.Application import _Option
 from Bio.Application import _Switch
 from Bio.Application import AbstractCommandline
+from subprocess import getoutput
 
 
 class MuscleCommandline(AbstractCommandline):
@@ -677,6 +678,10 @@
             #                           stdout and exit
             _Switch(["-version", "version"], "Write version string to stdout and exit"),
         ]
+        output = getoutput(cmd + " -version")
+        if "muscle 5" in output:
+            raise RuntimeError("muscle 5 is unsupported in biopython")
+
         AbstractCommandline.__init__(self, cmd, **kwargs)
 
 
