当前位置: 首页>>代码示例>>Python>>正文


Python Toil.parseLocator方法代码示例

本文整理汇总了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")
开发者ID:chapmanb,项目名称:toil,代码行数:11,代码来源:abstractBatchSystem.py

示例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
开发者ID:benedictpaten,项目名称:cactus,代码行数:52,代码来源:cactus_progressive.py


注:本文中的toil.common.Toil.parseLocator方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。