mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Copy changes over
This commit is contained in:
@@ -34,18 +34,17 @@ def _get_samtools_version():
|
||||
if not cmd_exists('samtools'):
|
||||
raise Exception('This tool needs samtools, but it is not on PATH.')
|
||||
# Get the version of samtools via --version-only, if available
|
||||
p = subprocess.Popen(['samtools', '--version-only'],
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE)
|
||||
output, error = p.communicate()
|
||||
|
||||
# --version-only is available
|
||||
# Format is <version x.y.z>+htslib-<a.b.c>
|
||||
if p.returncode == 0:
|
||||
try:
|
||||
output = subprocess.check_output(['samtools', '--version-only'], stderr=subprocess.PIPE)
|
||||
# --version-only is available
|
||||
# Format is <version x.y.z>+htslib-<a.b.c>
|
||||
version = output.split('+')[0]
|
||||
return version
|
||||
except subprocess.CalledProcessError:
|
||||
# --version-only not available
|
||||
pass
|
||||
|
||||
output = subprocess.Popen(['samtools'], stderr=subprocess.PIPE, stdout=subprocess.PIPE).communicate()[1]
|
||||
output = subprocess.check_output(['samtools'], stderr=subprocess.PIPE)
|
||||
lines = output.split('\n')
|
||||
for line in lines:
|
||||
if line.lower().startswith('version'):
|
||||
|
||||
Reference in New Issue
Block a user