本文整理汇总了Python中toil.common.Toil.parseLocator方法的典型用法代码示例。如果您正苦于以下问题:Python Toil.parseLocator方法的具体用法?Python Toil.parseLocator怎么用?Python Toil.parseLocator使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类toil.common.Toil
的用法示例。
在下文中一共展示了Toil.parseLocator方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _getResultsFileName
# 需要导入模块: from toil.common import Toil [as 别名]
# 或者: from toil.common.Toil import parseLocator [as 别名]
def _getResultsFileName(self, toilPath):
"""
Get a path for the batch systems to store results. GridEngine, slurm,
and LSF currently use this and only work if locator is file.
"""
# Use parser to extract the path and type
locator, filePath = Toil.parseLocator(toilPath)
assert locator == "file"
return os.path.join(filePath, "results.txt")
示例2: setupBinaries
# 需要导入模块: from toil.common import Toil [as 别名]
# 或者: from toil.common.Toil import parseLocator [as 别名]
def setupBinaries(options):
"""Ensure that Cactus's C/C++ components are ready to run, and set up the environment."""
if options.latest:
os.environ["CACTUS_USE_LATEST"] = "1"
if options.binariesMode is not None:
# Mode is specified on command line
mode = options.binariesMode
else:
# Might be specified through the environment, or not, in which
# case the default is to use Docker.
mode = os.environ.get("CACTUS_BINARIES_MODE", "docker")
os.environ["CACTUS_BINARIES_MODE"] = mode
if mode == "docker":
# Verify Docker exists on the target system
from distutils.spawn import find_executable
if find_executable('docker') is None:
raise RuntimeError("The `docker` executable wasn't found on the "
"system. Please install Docker if possible, or "
"use --binariesMode local and add cactus's bin "
"directory to your PATH.")
# If running without Docker, verify that we can find the Cactus executables
elif mode == "local":
from distutils.spawn import find_executable
if find_executable('cactus_caf') is None:
raise RuntimeError("Cactus isn't using Docker, but it can't find "
"the Cactus binaries. Please add Cactus's bin "
"directory to your PATH (and run `make` in the "
"Cactus directory if you haven't already).")
if find_executable('ktserver') is None:
raise RuntimeError("Cactus isn't using Docker, but it can't find "
"`ktserver`, the KyotoTycoon database server. "
"Please install KyotoTycoon "
"(https://github.com/alticelabs/kyoto) "
"and add the binary to your PATH, or use the "
"Docker mode.")
else:
assert mode == "singularity"
jobStoreType, locator = Toil.parseLocator(options.jobStore)
if jobStoreType != "file":
raise RuntimeError("Singularity mode is only supported when using the FileJobStore.")
if options.containerImage:
imgPath = os.path.abspath(options.containerImage)
os.environ["CACTUS_USE_LOCAL_SINGULARITY_IMG"] = "1"
else:
# When SINGULARITY_CACHEDIR is set, singularity will refuse to store images in the current directory
if 'SINGULARITY_CACHEDIR' in os.environ:
imgPath = os.path.join(os.environ['SINGULARITY_CACHEDIR'], "cactus.img")
else:
imgPath = os.path.join(os.path.abspath(locator), "cactus.img")
os.environ["CACTUS_SINGULARITY_IMG"] = imgPath