Skip to content

Commit

Permalink
Parse version from MUSCLE v5
Browse files Browse the repository at this point in the history
  • Loading branch information
rrwick committed Nov 19, 2021
1 parent b9306e6 commit 87953f2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
5 changes: 5 additions & 0 deletions test/test_software.py
Original file line number Diff line number Diff line change
Expand Up @@ -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) == '?'

Expand Down
6 changes: 5 additions & 1 deletion trycycler/software.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 '?'

Expand Down

0 comments on commit 87953f2

Please sign in to comment.