From 87953f291e48a68ee3c148457ca43509e6d7d7f8 Mon Sep 17 00:00:00 2001 From: Ryan Wick Date: Fri, 19 Nov 2021 16:37:23 +1100 Subject: [PATCH] Parse version from MUSCLE v5 --- test/test_software.py | 5 +++++ trycycler/software.py | 6 +++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/test/test_software.py b/test/test_software.py index a283156..7d6c350 100644 --- a/test/test_software.py +++ b/test/test_software.py @@ -23,6 +23,11 @@ def test_parse_muscle_version_1(): def test_parse_muscle_version_2(): + output = 'muscle 5.0.1430_osx64' + assert trycycler.software.parse_muscle_version(output) == '5.0.1430' + + +def test_parse_muscle_version_3(): output = 'Not the correct output' assert trycycler.software.parse_muscle_version(output) == '?' diff --git a/trycycler/software.py b/trycycler/software.py index c2b6529..5cf0929 100755 --- a/trycycler/software.py +++ b/trycycler/software.py @@ -59,10 +59,14 @@ def check_muscle(): def parse_muscle_version(output): - if 'MUSCLE v' in output: + if 'MUSCLE v' in output: # for version 3 output = output.split('MUSCLE v')[1] output = output.split(' ')[0] return output.strip() + elif 'muscle ' in output: # For version 5 + output = output.split('muscle ')[1] + output = output.split('_')[0] + return output.strip() else: return '?'