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


Python AtomicCmdBuilder.set_kwargs方法代码示例

本文整理汇总了Python中pypeline.atomiccmd.builder.AtomicCmdBuilder.set_kwargs方法的典型用法代码示例。如果您正苦于以下问题:Python AtomicCmdBuilder.set_kwargs方法的具体用法?Python AtomicCmdBuilder.set_kwargs怎么用?Python AtomicCmdBuilder.set_kwargs使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pypeline.atomiccmd.builder.AtomicCmdBuilder的用法示例。


在下文中一共展示了AtomicCmdBuilder.set_kwargs方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: customize

# 需要导入模块: from pypeline.atomiccmd.builder import AtomicCmdBuilder [as 别名]
# 或者: from pypeline.atomiccmd.builder.AtomicCmdBuilder import set_kwargs [as 别名]
    def customize(cls, input_alignment, input_partition, output_alignment, output_partition, dependencies = ()):
        command = AtomicCmdBuilder("raxmlHPC")

        # Read and (in the case of empty columns) reduce input
        command.set_option("-f", "c")
        # Output files are saved with a .Pypeline postfix, and subsequently renamed
        command.set_option("-n", "Pypeline")
        # Model required, but not used
        command.set_option("-m", "GTRGAMMA")
        # Ensures that output is saved to the temporary directory
        command.set_option("-w", "%(TEMP_DIR)s")

        # Symlink to sequence and partitions, to prevent the creation of *.reduced files outside temp folder
        # In addition, it may be nessesary to remove the .reduced files if created
        command.set_option("-s", "%(TEMP_IN_ALIGNMENT)s")
        command.set_option("-q", "%(TEMP_IN_PARTITION)s")

        command.set_kwargs(IN_ALIGNMENT      = input_alignment,
                          IN_PARTITION      = input_partition,

                          TEMP_IN_ALIGNMENT = "RAxML_alignment",
                          TEMP_IN_PARTITION = "RAxML_partitions",
                          TEMP_OUT_INFO     = "RAxML_info.Pypeline",

                          OUT_ALIGNMENT     = output_alignment,
                          OUT_PARTITION     = output_partition,
                          CHECK_VERSION     = RAXML_VERSION)

        return {"command" : command}
开发者ID:CarlesV,项目名称:paleomix,代码行数:31,代码来源:raxml.py

示例2: customize

# 需要导入模块: from pypeline.atomiccmd.builder import AtomicCmdBuilder [as 别名]
# 或者: from pypeline.atomiccmd.builder.AtomicCmdBuilder import set_kwargs [as 别名]
    def customize(cls, input_alignment, input_partition, output_file, dependencies = ()):
        """
        Arguments:
        input_alignment  -- An alignment file in a format readable by RAxML.
        input_partition  -- A set of partitions in a format readable by RAxML.
        output_filename  -- Filename for the output binary sequence."""

        command = AtomicCmdBuilder("examlParser", set_cwd = True)

        command.set_option("-s", "%(TEMP_OUT_ALN)s")
        command.set_option("-q", "%(TEMP_OUT_PART)s")
        # Output file will be named output.binary, and placed in the CWD
        command.set_option("-n", "output")

        # Substitution model
        command.set_option("-m", "DNA", fixed = False)


        command.set_kwargs(# Auto-delete: Symlinks
                          TEMP_OUT_PART   = os.path.basename(input_partition),
                          TEMP_OUT_ALN    = os.path.basename(input_alignment),

                          # Input files, are not used directly (see below)
                          IN_ALIGNMENT    = input_alignment,
                          IN_PARTITION    = input_partition,

                          # Final output file, are not created directly
                          OUT_BINARY      = output_file,

                          CHECK_EXAML     = PARSER_VERSION)

        return {"command" : command}
开发者ID:health1987,项目名称:paleomix,代码行数:34,代码来源:examl.py

示例3: _bowtie2_template

# 需要导入模块: from pypeline.atomiccmd.builder import AtomicCmdBuilder [as 别名]
# 或者: from pypeline.atomiccmd.builder.AtomicCmdBuilder import set_kwargs [as 别名]
def _bowtie2_template(call, prefix, iotype = "IN", **kwargs):
    params = AtomicCmdBuilder(call, **kwargs)
    for postfix in ("1.bt2", "2.bt2", "3.bt2", "4.bt2", "rev.1.bt2", "rev.2.bt2"):
        key = "%s_PREFIX_%s" % (iotype, postfix.upper())
        params.set_kwargs(**{key : (prefix + "." + postfix)})

    return params
开发者ID:CarlesV,项目名称:paleomix,代码行数:9,代码来源:bowtie2.py

示例4: test_builder__set_kwargs__after_finalize

# 需要导入模块: from pypeline.atomiccmd.builder import AtomicCmdBuilder [as 别名]
# 或者: from pypeline.atomiccmd.builder.AtomicCmdBuilder import set_kwargs [as 别名]
def test_builder__set_kwargs__after_finalize():
    expected = {"IN_PATH" : "/a/b/"}
    builder = AtomicCmdBuilder("echo")
    builder.set_kwargs(IN_PATH = "/a/b/")
    builder.finalize()
    assert_raises(AtomicCmdBuilderError, builder.set_kwargs, OUT_PATH = "/dst/file")
    assert_equal(builder.kwargs, expected)
开发者ID:CarlesV,项目名称:paleomix,代码行数:9,代码来源:builder_test.py

示例5: customize

# 需要导入模块: from pypeline.atomiccmd.builder import AtomicCmdBuilder [as 别名]
# 或者: from pypeline.atomiccmd.builder.AtomicCmdBuilder import set_kwargs [as 别名]
    def customize(cls, input_alignment, input_partition, output_alignment, dependencies = ()):
        command = AtomicCmdBuilder("raxmlHPC", set_cwd = True)

        # Read and (in the case of empty columns) reduce input
        command.set_option("-f", "j")
        # Output files are saved with a .Pypeline postfix, and subsequently renamed
        command.set_option("-n", "Pypeline")
        # Model required, but not used
        command.set_option("-m", "GTRGAMMA")
        # Set random seed for bootstrap generation. May be set to a fixed value to allow replicability.
        command.set_option("-b", int(random.random() * 2**31 - 1), fixed = False)
        # Generate a single bootstrap alignment (makes growing the number of bootstraps easier).
        command.set_option("-N", 1, fixed = False)

        # Symlink to sequence and partitions, to prevent the creation of *.reduced files outside temp folder
        # In addition, it may be nessesary to remove the .reduced files if created
        command.set_option("-s", "input.alignment")
        command.set_option("-q", "input.partition")

        command.set_kwargs(IN_ALIGNMENT      = input_alignment,
                          IN_PARTITION      = input_partition,

                          OUT_ALIGNMENT     = output_alignment,
                          OUT_INFO          = fileutils.swap_ext(output_alignment, ".info"))

        return {"command" : command}
开发者ID:schae234,项目名称:pypeline,代码行数:28,代码来源:raxml.py

示例6: customize

# 需要导入模块: from pypeline.atomiccmd.builder import AtomicCmdBuilder [as 别名]
# 或者: from pypeline.atomiccmd.builder.AtomicCmdBuilder import set_kwargs [as 别名]
    def customize(cls, input_file, output_file, algorithm = "auto", dependencies = ()):
        command = AtomicCmdBuilder(_PRESETS[algorithm.lower()])
        command.add_value("%(IN_FASTA)s")
        command.set_kwargs(IN_FASTA   = input_file,
                           OUT_STDOUT = output_file,
                           CHECK_VERSION = MAFFT_VERSION)

        return {"command"      : command,
                "dependencies" : dependencies}
开发者ID:CarlesV,项目名称:paleomix,代码行数:11,代码来源:mafft.py

示例7: _get_bwa_template

# 需要导入模块: from pypeline.atomiccmd.builder import AtomicCmdBuilder [as 别名]
# 或者: from pypeline.atomiccmd.builder.AtomicCmdBuilder import set_kwargs [as 别名]
def _get_bwa_template(call, prefix, iotype = "IN", **kwargs):
    extensions = ["amb", "ann", "bwt", "pac", "sa"]
    try:
        if BWA_VERSION.version < (0, 6, 0):
            extensions.extend(("rbwt", "rpac", "rsa"))
    except versions.VersionRequirementError:
        pass # Ignored here, handled elsewhere

    params = AtomicCmdBuilder(call, **kwargs)
    for postfix in extensions:
        key = "%s_PREFIX_%s" % (iotype, postfix.upper())
        params.set_kwargs(**{key : (prefix + "." + postfix)})

    return params
开发者ID:schae234,项目名称:pypeline,代码行数:16,代码来源:bwa.py

示例8: test_builder__finalize__calls_atomiccmd

# 需要导入模块: from pypeline.atomiccmd.builder import AtomicCmdBuilder [as 别名]
# 或者: from pypeline.atomiccmd.builder.AtomicCmdBuilder import set_kwargs [as 别名]
def test_builder__finalize__calls_atomiccmd():
    was_called = []
    class _AtomicCmdMock:
        def __init__(self, *args, **kwargs):
            assert_equal(args, (["echo", "-out", "%(OUT_FILE)s", "%(IN_FILE)s"],))
            assert_equal(kwargs, {"IN_FILE" : "/in/file", "OUT_FILE" : "/out/file", "set_cwd" : True})
            was_called.append(True)

    with Monkeypatch("pypeline.atomiccmd.builder.AtomicCmd", _AtomicCmdMock):
        builder = AtomicCmdBuilder("echo", set_cwd = True)
        builder.add_option("-out", "%(OUT_FILE)s")
        builder.add_value("%(IN_FILE)s")
        builder.set_kwargs(OUT_FILE = "/out/file",
                           IN_FILE  = "/in/file")

        builder.finalize()
        assert was_called
开发者ID:CarlesV,项目名称:paleomix,代码行数:19,代码来源:builder_test.py

示例9: _process_output

# 需要导入模块: from pypeline.atomiccmd.builder import AtomicCmdBuilder [as 别名]
# 或者: from pypeline.atomiccmd.builder.AtomicCmdBuilder import set_kwargs [as 别名]
def _process_output(stdin, output_file, reference, run_fixmate = False):
    convert = AtomicCmdBuilder("safeSAM2BAM")
    convert.set_option("--flag-as-sorted")
    convert.set_option("-F", "0x4", sep = "", fixed = False) # Remove misses
    convert.set_kwargs(IN_STDIN    = stdin,
                      OUT_STDOUT  = AtomicCmd.PIPE,
                      CHECK_PYSAM = PYSAM_VERSION,
                      CHECK_SAMTOOLS = SAMTOOLS_VERSION)

    fixmate = None
    if run_fixmate:
        fixmate = AtomicCmdBuilder(("samtools", "fixmate", "-", "-"),
                               IN_STDIN   = convert,
                               OUT_STDOUT = AtomicCmd.PIPE,
                               CHECK_SAMTOOLS = SAMTOOLS_VERSION)

    sort = AtomicCmdBuilder(("samtools", "sort"))
    sort.set_option("-o") # Output to STDOUT on completion
    sort.add_value("-")
    sort.add_value("%(TEMP_OUT_BAM)s")
    sort.set_kwargs(IN_STDIN     = fixmate or convert,
                   OUT_STDOUT   = AtomicCmd.PIPE,
                   TEMP_OUT_BAM = "sorted",
                   CHECK_SAM = SAMTOOLS_VERSION)

    calmd = AtomicCmdBuilder(("samtools", "calmd"))
    calmd.add_value("-")
    calmd.add_value("%(IN_REF)s")
    calmd.set_option("-b") # Output BAM
    calmd.set_kwargs(IN_REF   = reference,
                    IN_STDIN = sort,
                    OUT_STDOUT = output_file,
                    CHECK_SAM = SAMTOOLS_VERSION)

    order = ["convert", "sort", "calmd"]
    commands = {"convert" : convert,
                "sort"    : sort,
                "calmd"   : calmd}

    if run_fixmate:
        order.insert(1, "fixmate")
        commands["fixmate"] = fixmate

    return order, commands
开发者ID:schae234,项目名称:pypeline,代码行数:46,代码来源:bwa.py

示例10: test_builder__set__kwargs__overwriting

# 需要导入模块: from pypeline.atomiccmd.builder import AtomicCmdBuilder [as 别名]
# 或者: from pypeline.atomiccmd.builder.AtomicCmdBuilder import set_kwargs [as 别名]
def test_builder__set__kwargs__overwriting():
    expected = {"IN_PATH" : "/a/b/"}
    builder = AtomicCmdBuilder("echo")
    builder.set_kwargs(IN_PATH = "/a/b/")
    assert_raises(AtomicCmdBuilderError, builder.set_kwargs, IN_PATH = "/dst/file")
    assert_equal(builder.kwargs, expected)
开发者ID:CarlesV,项目名称:paleomix,代码行数:8,代码来源:builder_test.py

示例11: test_builder__set_kwargs__called_twice

# 需要导入模块: from pypeline.atomiccmd.builder import AtomicCmdBuilder [as 别名]
# 或者: from pypeline.atomiccmd.builder.AtomicCmdBuilder import set_kwargs [as 别名]
def test_builder__set_kwargs__called_twice():
    expected = {"IN_PATH" : "/a/b/", "OUT_PATH" : "/dst/file"}
    builder = AtomicCmdBuilder("echo")
    builder.set_kwargs(OUT_PATH = "/dst/file")
    builder.set_kwargs(IN_PATH = "/a/b/")
    assert_equal(builder.kwargs, expected)
开发者ID:CarlesV,项目名称:paleomix,代码行数:8,代码来源:builder_test.py


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