def find_missing_tools(self, workflow=None):
"""
Find tools required by the workflow to test and not installed on the configured Galaxy server.
:type workflow: :class:`bioblend.galaxy.objects.wrappers.Workflow`
:param workflow: an optional instance of :class:`bioblend.galaxy.objects.wrappers.Workflow`
:rtype: list
:return: the list of missing tools
"""
_logger.debug("Checking required tools ...")
workflow = self.get_galaxy_workflow() if not workflow else workflow
available_tools = self._galaxy_instance.tools.list()
missing_tools = []
_logger.debug("Available tools: %s", ", ".join(["{0}, {1}".format(t.id, t.version) for t in available_tools]))
for order, step in _iteritems(workflow.steps):
if step.tool_id and len([t for t in available_tools
if t.id == step.tool_id and t.version == step.tool_version]) == 0:
missing_tools.append((step.tool_id, step.tool_version))
_logger.debug("Missing tools: {0}".format("None"
if len(missing_tools) == 0
else ", ".join(["{0} (version {1})"
.format(x[0], x[1]) for x in missing_tools])))
_logger.debug("Checking required tools: DONE")
return missing_tools
评论列表
文章目录