本文整理汇总了Python中paleomix.atomiccmd.builder.AtomicCmdBuilder.set_kwargs方法的典型用法代码示例。如果您正苦于以下问题:Python AtomicCmdBuilder.set_kwargs方法的具体用法?Python AtomicCmdBuilder.set_kwargs怎么用?Python AtomicCmdBuilder.set_kwargs使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类paleomix.atomiccmd.builder.AtomicCmdBuilder
的用法示例。
在下文中一共展示了AtomicCmdBuilder.set_kwargs方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_builder__set_kwargs__after_finalize
# 需要导入模块: from paleomix.atomiccmd.builder import AtomicCmdBuilder [as 别名]
# 或者: from paleomix.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)
示例2: _bowtie2_template
# 需要导入模块: from paleomix.atomiccmd.builder import AtomicCmdBuilder [as 别名]
# 或者: from paleomix.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
示例3: customize
# 需要导入模块: from paleomix.atomiccmd.builder import AtomicCmdBuilder [as 别名]
# 或者: from paleomix.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("parse-examl", 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}
示例4: customize
# 需要导入模块: from paleomix.atomiccmd.builder import AtomicCmdBuilder [as 别名]
# 或者: from paleomix.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}
示例5: test_builder__set__kwargs__overwriting
# 需要导入模块: from paleomix.atomiccmd.builder import AtomicCmdBuilder [as 别名]
# 或者: from paleomix.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)
示例6: customize
# 需要导入模块: from paleomix.atomiccmd.builder import AtomicCmdBuilder [as 别名]
# 或者: from paleomix.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}
示例7: _get_bwa_template
# 需要导入模块: from paleomix.atomiccmd.builder import AtomicCmdBuilder [as 别名]
# 或者: from paleomix.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
示例8: test_builder__finalize__calls_atomiccmd
# 需要导入模块: from paleomix.atomiccmd.builder import AtomicCmdBuilder [as 别名]
# 或者: from paleomix.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("paleomix.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
示例9: test_builder__set_kwargs__called_twice
# 需要导入模块: from paleomix.atomiccmd.builder import AtomicCmdBuilder [as 别名]
# 或者: from paleomix.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)