From 1528824fd4a2b13b82066caa4d89cd7917113949 Mon Sep 17 00:00:00 2001 From: Danny Park Date: Wed, 10 Jun 2020 19:13:46 -0400 Subject: [PATCH 1/5] bump viral-core to 2.1.2 --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index eeb8b617..756481a0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM quay.io/broadinstitute/viral-core:2.1.1 +FROM quay.io/broadinstitute/viral-core:2.1.2 LABEL maintainer "viral-ngs@broadinstitute.org" From 9f49432037782688b5478a9f6549a92c7e1b620f Mon Sep 17 00:00:00 2001 From: Danny Park Date: Wed, 10 Jun 2020 19:25:39 -0400 Subject: [PATCH 2/5] decondify Tools --- assemble/gap2seq.py | 11 ++++++----- assemble/mafft.py | 13 ++++++++----- assemble/mummer.py | 16 +++++++++------- assemble/muscle.py | 14 ++++++++------ assemble/spades.py | 15 +++++++++------ assemble/trinity.py | 11 ++++------- 6 files changed, 44 insertions(+), 36 deletions(-) diff --git a/assemble/gap2seq.py b/assemble/gap2seq.py index 84182acb..179c91fb 100644 --- a/assemble/gap2seq.py +++ b/assemble/gap2seq.py @@ -21,8 +21,7 @@ import util.file import util.misc -TOOL_NAME = 'gap2seq' -TOOL_VERSION = '3.1.1a2' +TOOL_NAME = 'Gap2Seq' log = logging.getLogger(__name__) @@ -31,11 +30,13 @@ class Gap2SeqTool(tools.Tool): def __init__(self, install_methods=None): if install_methods is None: - install_methods = [tools.CondaPackage(TOOL_NAME, version=TOOL_VERSION, executable='Gap2Seq')] - tools.Tool.__init__(self, install_methods=install_methods) + + if install_methods is None: + install_methods = [tools.PrexistingUnixCommand(shutil.which(TOOL_NAME), require_executability=True)] + super(Gap2SeqTool, self).__init__(install_methods=install_methods) def version(self): - return TOOL_VERSION + return None def execute(self, args): # pylint: disable=W0221 tool_cmd = [self.install_and_get_path()] + list(args) diff --git a/assemble/mafft.py b/assemble/mafft.py index 4a9c9b2f..801b3664 100644 --- a/assemble/mafft.py +++ b/assemble/mafft.py @@ -15,7 +15,6 @@ import subprocess TOOL_NAME = "mafft" -TOOL_VERSION = '7.464' _log = logging.getLogger(__name__) @@ -24,12 +23,16 @@ class MafftTool(tools.Tool): def __init__(self, install_methods=None): if install_methods is None: - install_methods = [] - install_methods.append(tools.CondaPackage(TOOL_NAME, version=TOOL_VERSION)) - tools.Tool.__init__(self, install_methods=install_methods) + install_methods = [tools.PrexistingUnixCommand(shutil.which(TOOL_NAME), require_executability=True)] + super(MafftTool, self).__init__(install_methods=install_methods) def version(self): - return TOOL_VERSION + if self.tool_version is None: + self._get_tool_version() + return self.tool_version + + def _get_tool_version(self): + self.tool_version = subprocess.check_output([self.install_and_get_path(), '--version']).decode('UTF-8').strip().split()[0] def __seqIdsAreAllUnique(self, filePath, inputFormat="fasta"): seqIds = [] diff --git a/assemble/mummer.py b/assemble/mummer.py index 948b2a49..b4c20c16 100644 --- a/assemble/mummer.py +++ b/assemble/mummer.py @@ -13,8 +13,7 @@ import subprocess import Bio.SeqIO -TOOL_NAME = "mummer4" -tool_version = '4.0.0beta2' +TOOL_NAME = "mummer" log = logging.getLogger(__name__) @@ -23,13 +22,16 @@ class MummerTool(tools.Tool): def __init__(self, install_methods=None): if install_methods is None: - install_methods = [ - tools.CondaPackage(TOOL_NAME, executable="mummer", version=tool_version) - ] - tools.Tool.__init__(self, install_methods=install_methods) + install_methods = [tools.PrexistingUnixCommand(shutil.which(TOOL_NAME), require_executability=True)] + super(MummerTool, self).__init__(install_methods=install_methods) def version(self): - return tool_version + if self.tool_version is None: + self._get_tool_version() + return self.tool_version + + def _get_tool_version(self): + self.tool_version = subprocess.check_output([self.install_and_get_path(), '-version']).decode('UTF-8').strip() def executable_path(self): exec_path = tools.Tool.executable_path(self) diff --git a/assemble/muscle.py b/assemble/muscle.py index 8e68dce4..ec993c34 100644 --- a/assemble/muscle.py +++ b/assemble/muscle.py @@ -14,8 +14,6 @@ import logging TOOL_NAME = "muscle" -TOOL_VERSION = '3.8.1551' -CONDA_TOOL_VERSION = '3.8.1551' _log = logging.getLogger(__name__) @@ -24,12 +22,16 @@ class MuscleTool(tools.Tool): def __init__(self, install_methods=None): if install_methods is None: - install_methods = [] - install_methods.append(tools.CondaPackage(TOOL_NAME, version=CONDA_TOOL_VERSION)) - tools.Tool.__init__(self, install_methods=install_methods) + install_methods = [tools.PrexistingUnixCommand(shutil.which(TOOL_NAME), require_executability=True)] + super(MuscleTool, self).__init__(install_methods=install_methods) def version(self): - return TOOL_VERSION + if self.tool_version is None: + self._get_tool_version() + return self.tool_version + + def _get_tool_version(self): + self.tool_version = subprocess.check_output([self.install_and_get_path(), '-version']).decode('UTF-8').strip().split()[1] # pylint: disable=W0221 def execute( diff --git a/assemble/spades.py b/assemble/spades.py index dcc9b232..4c0e6bfd 100644 --- a/assemble/spades.py +++ b/assemble/spades.py @@ -19,8 +19,7 @@ import util.file import util.misc -TOOL_NAME = 'spades' -TOOL_VERSION = '3.12.0' +TOOL_NAME = 'spades.py' log = logging.getLogger(__name__) @@ -29,12 +28,16 @@ class SpadesTool(tools.Tool): def __init__(self, install_methods=None): if install_methods is None: - install_methods = [tools.CondaPackage(TOOL_NAME, version=TOOL_VERSION, executable='spades.py', - verifycmd='spades.py --version')] - tools.Tool.__init__(self, install_methods=install_methods) + install_methods = [tools.PrexistingUnixCommand(shutil.which(TOOL_NAME), require_executability=True)] + super(SpadesTool, self).__init__(install_methods=install_methods) def version(self): - return TOOL_VERSION + if self.tool_version is None: + self._get_tool_version() + return self.tool_version + + def _get_tool_version(self): + self.tool_version = subprocess.check_output([self.install_and_get_path(), '--version']).decode('UTF-8').strip().split()[1] def execute(self, args): # pylint: disable=W0221 tool_cmd = [self.install_and_get_path()] + list(map(str, args)) diff --git a/assemble/trinity.py b/assemble/trinity.py index 1412262c..9514138f 100644 --- a/assemble/trinity.py +++ b/assemble/trinity.py @@ -19,9 +19,7 @@ import tools import util.misc -TOOL_NAME = "trinity" -TOOL_VERSION = "2011-11-26" -CONDA_TOOL_VERSION = "date.2011_11_26" # conda versions cannot have hyphens... +TOOL_NAME = "Trinity" log = logging.getLogger(__name__) @@ -51,12 +49,11 @@ class TrinityTool(tools.Tool): def __init__(self, install_methods=None): if install_methods is None: - install_methods = [] - install_methods.append(tools.CondaPackage(TOOL_NAME, executable="Trinity", version=CONDA_TOOL_VERSION)) - tools.Tool.__init__(self, install_methods=install_methods) + install_methods = [tools.PrexistingUnixCommand(shutil.which(TOOL_NAME), require_executability=True)] + super(TrinityTool, self).__init__(install_methods=install_methods) def version(self): - return TOOL_VERSION + return None def execute(self, inFastq1, From e74006b5c87460bdb417229102e118754db9b1d5 Mon Sep 17 00:00:00 2001 From: Danny Park Date: Wed, 10 Jun 2020 19:36:46 -0400 Subject: [PATCH 3/5] missing imports --- assemble/mafft.py | 1 + assemble/mummer.py | 1 + assemble/muscle.py | 1 + 3 files changed, 3 insertions(+) diff --git a/assemble/mafft.py b/assemble/mafft.py index 801b3664..c0c92f44 100644 --- a/assemble/mafft.py +++ b/assemble/mafft.py @@ -12,6 +12,7 @@ import util.misc import os import os.path +import shutil import subprocess TOOL_NAME = "mafft" diff --git a/assemble/mummer.py b/assemble/mummer.py index b4c20c16..a502a8a0 100644 --- a/assemble/mummer.py +++ b/assemble/mummer.py @@ -10,6 +10,7 @@ import os import os.path import random +import shutil import subprocess import Bio.SeqIO diff --git a/assemble/muscle.py b/assemble/muscle.py index ec993c34..0eff6b90 100644 --- a/assemble/muscle.py +++ b/assemble/muscle.py @@ -10,6 +10,7 @@ import os import os.path +import shutil import subprocess import logging From e653b7bc17372bd93d255e7edf0272c18f2c16c0 Mon Sep 17 00:00:00 2001 From: Danny Park Date: Wed, 10 Jun 2020 19:48:45 -0400 Subject: [PATCH 4/5] fix typo --- assemble/gap2seq.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/assemble/gap2seq.py b/assemble/gap2seq.py index 179c91fb..7273bacd 100644 --- a/assemble/gap2seq.py +++ b/assemble/gap2seq.py @@ -29,8 +29,6 @@ class Gap2SeqTool(tools.Tool): """Tool wrapper for the Gap2Seq gap-closing tool.""" def __init__(self, install_methods=None): - if install_methods is None: - if install_methods is None: install_methods = [tools.PrexistingUnixCommand(shutil.which(TOOL_NAME), require_executability=True)] super(Gap2SeqTool, self).__init__(install_methods=install_methods) From e3b753b95b445d5ea7764b2cc26b64388ba3957b Mon Sep 17 00:00:00 2001 From: Danny Park Date: Wed, 10 Jun 2020 20:36:23 -0400 Subject: [PATCH 5/5] bump core to 2.1.3 --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 756481a0..81f1e270 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM quay.io/broadinstitute/viral-core:2.1.2 +FROM quay.io/broadinstitute/viral-core:2.1.3 LABEL maintainer "viral-ngs@broadinstitute.org"