本文整理汇总了Python中pypeline.node.CommandNode._run方法的典型用法代码示例。如果您正苦于以下问题:Python CommandNode._run方法的具体用法?Python CommandNode._run怎么用?Python CommandNode._run使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pypeline.node.CommandNode
的用法示例。
在下文中一共展示了CommandNode._run方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _run
# 需要导入模块: from pypeline.node import CommandNode [as 别名]
# 或者: from pypeline.node.CommandNode import _run [as 别名]
def _run(self, config, temp):
try:
CommandNode._run(self, config, temp)
except NodeError, error:
if self._command.join() == [1, None]:
with open(fileutils.reroot_path(temp, "template.stdout")) as handle:
lines = handle.readlines()
if lines and ("Giving up." in lines[-1]):
error = NodeError("%s\n\n%s" % (error, lines[-1]))
raise error
示例2: _run
# 需要导入模块: from pypeline.node import CommandNode [as 别名]
# 或者: from pypeline.node.CommandNode import _run [as 别名]
def _run(self, config, temp):
with gzip.open(self._in_vcf) as handle:
with open(os.path.join(temp, "heterozygous_snps.bed"), "w") as bed:
for line in handle:
if line.startswith("#"):
continue
fields = line.split("\t", 5)
if "," in fields[4]:
pos = int(fields[1])
bed.write("%s\t%i\t%i\n" % (fields[0], pos - 1, pos))
CommandNode._run(self, config, temp)
示例3: _run
# 需要导入模块: from pypeline.node import CommandNode [as 别名]
# 或者: from pypeline.node.CommandNode import _run [as 别名]
def _run(self, config, temp):
try:
CommandNode._run(self, config, temp)
except NodeError, error:
err_message = "DNA damage levels are too low"
if self._command.join() == [1]:
fpath = os.path.join(temp, "pipe_mapDamage.stdout")
with open(fpath) as handle:
for line in handle:
if err_message in line:
line = line.strip().replace("Warning:", "ERROR:")
error = NodeError("%s\n\n%s" % (error, line))
break
raise error
示例4: _run
# 需要导入模块: from pypeline.node import CommandNode [as 别名]
# 或者: from pypeline.node.CommandNode import _run [as 别名]
def _run(self, config, temp):
try:
CommandNode._run(self, config, temp)
except NodeError, error:
# Allow failures due to low coverage
with open(fileutils.reroot_path(temp, "template.stdout")) as handle:
codeml = handle.read()
if "sequences do not have any resolved nucleotides. Giving up." not in codeml:
raise error
with open(fileutils.reroot_path(temp, self._output_prefix + ".codeml"), "a") as handle:
handle.write("\nWARNING: No resolved nucleotides found, could not process gene.\n")
import sys
sys.stderr.write("WARNING: No resolved nucleotides in " + self._output_prefix + "\n")
示例5: test_commandnode_run__call_order
# 需要导入模块: from pypeline.node import CommandNode [as 别名]
# 或者: from pypeline.node.CommandNode import _run [as 别名]
def test_commandnode_run__call_order():
cmd_mock = _build_cmd_mock()
cmd_mock.should_receive("run").with_args("xTMPx").ordered.once
cmd_mock.should_receive("join").with_args().and_return((0,)).ordered.once
node = CommandNode(cmd_mock)
node._run(None, "xTMPx")