Skip to content

Commit

Permalink
add muscle_version util
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacovercast committed Sep 22, 2024
1 parent 7bfef63 commit c88e3c3
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions ipyrad/assemble/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import pandas as pd
import numpy as np
import string
import subprocess as sps

import ipyrad

Expand Down Expand Up @@ -491,6 +492,24 @@ def get_threaded_view(ipyclient, split=True):
return hostdict


def muscle_version():
"""
Detect muscle version to handle difference between command
line format requirements of v3 and v5
"""
cmd = [ipyrad.bins.muscle, "-version"]
proc = sps.Popen(cmd, stderr=sps.STDOUT, stdout=sps.PIPE)
msg = proc.communicate()[0]
ret = msg.decode()
if "v3" in ret:
v = "v3"
elif " 5" in ret:
v = "v5"
else:
raise IPyradError(f" Unrecognized muscle version: {ret}")
return v


##############################################################
def detect_cpus():
"""
Expand Down

0 comments on commit c88e3c3

Please sign in to comment.