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


Python PhyloBuddy.make_copy方法代码示例

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


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

示例1: test_in_place_ui

# 需要导入模块: import PhyloBuddy [as 别名]
# 或者: from PhyloBuddy import make_copy [as 别名]
def test_in_place_ui(capsys):
    # Some of this function is covered below, so just test an edge
    test_in_args = deepcopy(in_args)
    test_in_args.in_place = True
    test_in_args.trees = [Pb.make_copy(pb_objects[0])]
    test_in_args.screw_formats = "nexus"
    Pb.command_line_ui(test_in_args, Pb.make_copy(pb_objects[0]), skip_exit=True)
    out, err = capsys.readouterr()
    assert "Warning: The -i flag was passed in, but the positional" in err
开发者ID:JamesL13,项目名称:BuddySuite,代码行数:11,代码来源:phylobuddy_test.py

示例2: test_prune_taxa_ui

# 需要导入模块: import PhyloBuddy [as 别名]
# 或者: from PhyloBuddy import make_copy [as 别名]
def test_prune_taxa_ui(capsys):
    test_in_args = deepcopy(in_args)
    test_in_args.prune_taxa = [["fir"]]

    Pb.command_line_ui(test_in_args, Pb.make_copy(pb_objects[0]), skip_exit=True)
    out, err = capsys.readouterr()
    assert string2hash(out) == "99635c6dbf708f94cf4dfdca87113c44"

    test_in_args.prune_taxa = [["fir", "ovi"]]

    Pb.command_line_ui(test_in_args, Pb.make_copy(pb_objects[1]), skip_exit=True)
    out, err = capsys.readouterr()
    assert string2hash(out) == "2a385fa95024323fea412fd2b3c3e91f"
开发者ID:JamesL13,项目名称:BuddySuite,代码行数:15,代码来源:phylobuddy_test.py

示例3: test_root_ui_midpoint

# 需要导入模块: import PhyloBuddy [as 别名]
# 或者: from PhyloBuddy import make_copy [as 别名]
def test_root_ui_midpoint(capsys):
    test_in_args = deepcopy(in_args)
    test_in_args.root = [[]]

    Pb.command_line_ui(test_in_args, Pb.make_copy(pb_objects[0]), skip_exit=True)
    out, err = capsys.readouterr()
    assert string2hash(out) == "25ea14c2e89530a0fb48163c0ef2a102"

    test_in_args.root = [[True]]

    Pb.command_line_ui(test_in_args, Pb.make_copy(pb_objects[0]), skip_exit=True)
    out, err = capsys.readouterr()
    assert string2hash(out) == "25ea14c2e89530a0fb48163c0ef2a102"
开发者ID:xtmgah,项目名称:BuddySuite,代码行数:15,代码来源:phylobuddy_test.py

示例4: get

# 需要导入模块: import PhyloBuddy [as 别名]
# 或者: from PhyloBuddy import make_copy [as 别名]
 def get(self, code="", mode="objs"):
     """
     Returns copies of PhyloBuddy objects, the
     :param code:
     :param mode: {"objs", "paths"}
     :return: OrderedDict {key: resource}
     """
     files = self._parse_code(code)
     output = OrderedDict()
     key = ["", ""]
     for num_aligns in files["num_trees"]:
         key[0] = num_aligns
         n = self.code_dict["num_trees"][num_aligns]
         for _format in files["format"]:
             key[1] = _format
             f = self.code_dict["format"][_format]
             try:
                 assert not " ".join(key) in output
                 if mode == "objs":
                     output[" ".join(key)] = Pb.make_copy(self.pb_objs[n][f])
                 elif mode == "paths":
                     output[" ".join(key)] = self.res_paths[n][f]
                 else:
                     raise ValueError("The 'mode' parameter only accepts 'objs' or 'paths' as input.")
             except KeyError:
                 pass
     return output
开发者ID:JamesL13,项目名称:BuddySuite,代码行数:29,代码来源:phylobuddy_test.py

示例5: test_root_ui_mrca

# 需要导入模块: import PhyloBuddy [as 别名]
# 或者: from PhyloBuddy import make_copy [as 别名]
def test_root_ui_mrca(capsys):
    test_in_args = deepcopy(in_args)
    test_in_args.root = [["firSA25a", "penSH31b"]]

    Pb.command_line_ui(test_in_args, Pb.make_copy(pb_objects[0]), skip_exit=True)
    out, err = capsys.readouterr()
    assert string2hash(out) == "757489907bd5c82882d084ffcb22cfba"
开发者ID:JamesL13,项目名称:BuddySuite,代码行数:9,代码来源:phylobuddy_test.py

示例6: test_rename_ids_ui

# 需要导入模块: import PhyloBuddy [as 别名]
# 或者: from PhyloBuddy import make_copy [as 别名]
def test_rename_ids_ui(capsys):
    test_in_args = deepcopy(in_args)
    test_in_args.rename_ids = ['Mle', 'Phylo']

    Pb.command_line_ui(test_in_args, Pb.make_copy(pb_objects[0]), skip_exit=True)
    out, err = capsys.readouterr()
    assert string2hash(out) == "6843a620b725a3a0e0940d4352f2036f"
开发者ID:JamesL13,项目名称:BuddySuite,代码行数:9,代码来源:phylobuddy_test.py

示例7: test_root_ui_leaf

# 需要导入模块: import PhyloBuddy [as 别名]
# 或者: from PhyloBuddy import make_copy [as 别名]
def test_root_ui_leaf(capsys):
    test_in_args = deepcopy(in_args)
    test_in_args.root = [["firSA25a"]]

    Pb.command_line_ui(test_in_args, Pb.make_copy(pb_objects[0]), skip_exit=True)
    out, err = capsys.readouterr()
    assert string2hash(out) == "f32bdc34bfe127bb0453a80cf7b01302"
开发者ID:JamesL13,项目名称:BuddySuite,代码行数:9,代码来源:phylobuddy_test.py

示例8: test_print_trees_ui

# 需要导入模块: import PhyloBuddy [as 别名]
# 或者: from PhyloBuddy import make_copy [as 别名]
def test_print_trees_ui(capsys):
    test_in_args = deepcopy(in_args)
    test_in_args.print_trees = True

    Pb.command_line_ui(test_in_args, Pb.make_copy(pb_objects[0]), skip_exit=True)
    out, err = capsys.readouterr()
    assert string2hash(out) == "fe340117cb8f573100c00fc897e6c8ce"
开发者ID:JamesL13,项目名称:BuddySuite,代码行数:9,代码来源:phylobuddy_test.py

示例9: test_distance_ui

# 需要导入模块: import PhyloBuddy [as 别名]
# 或者: from PhyloBuddy import make_copy [as 别名]
def test_distance_ui(capsys):
    test_in_args = deepcopy(in_args)
    test_in_args.distance = [False]
    Pb.command_line_ui(test_in_args, Pb.make_copy(pb_objects[0]), skip_exit=True)
    out, err = capsys.readouterr()
    assert string2hash(out) == "7a9f9902ef30ca3d7ac97b63cfdd0b2e"

    test_in_args.distance = ["uwrf"]
    Pb.command_line_ui(test_in_args, Pb.make_copy(pb_objects[0]), skip_exit=True)
    out, err = capsys.readouterr()
    assert string2hash(out) == "6e520f6911aabdf91dfd075d1545bc1e"

    test_in_args.distance = ["ed"]
    Pb.command_line_ui(test_in_args, Pb.make_copy(pb_objects[0]), skip_exit=True)
    out, err = capsys.readouterr()
    assert string2hash(out) == "f0acdd9c751bce77fe14355cc77b69cc"
开发者ID:JamesL13,项目名称:BuddySuite,代码行数:18,代码来源:phylobuddy_test.py

示例10: test_screw_formats_ui

# 需要导入模块: import PhyloBuddy [as 别名]
# 或者: from PhyloBuddy import make_copy [as 别名]
def test_screw_formats_ui(capsys):
    test_in_args = deepcopy(in_args)
    test_in_args.screw_formats = "nexus"

    Pb.command_line_ui(test_in_args, Pb.make_copy(pb_objects[0]), skip_exit=True)
    out, err = capsys.readouterr()
    assert string2hash(out) == "543d2fc90ca1f391312d6b8fe896c59c"
开发者ID:xtmgah,项目名称:BuddySuite,代码行数:9,代码来源:phylobuddy_test.py

示例11: test_consensus_tree_ui

# 需要导入模块: import PhyloBuddy [as 别名]
# 或者: from PhyloBuddy import make_copy [as 别名]
def test_consensus_tree_ui(capsys):
    test_in_args = deepcopy(in_args)
    test_in_args.consensus_tree = [False]
    Pb.command_line_ui(test_in_args, Pb.make_copy(pb_objects[0]), skip_exit=True)
    out, err = capsys.readouterr()
    assert string2hash(out) == "f20cbd5aae5971cce8efbda15e4e0b7e"

    test_in_args.consensus_tree = [0.9]
    Pb.command_line_ui(test_in_args, Pb.make_copy(pb_objects[0]), skip_exit=True)
    out, err = capsys.readouterr()
    assert string2hash(out) == "447862ed1ed6e98f2fb535ecce70218b"

    test_in_args.consensus_tree = [1.5]
    Pb.command_line_ui(test_in_args, Pb.make_copy(pb_objects[0]), skip_exit=True)
    out, err = capsys.readouterr()
    assert string2hash(out) == "f20cbd5aae5971cce8efbda15e4e0b7e"
开发者ID:JamesL13,项目名称:BuddySuite,代码行数:18,代码来源:phylobuddy_test.py

示例12: test_print_trees_internal_ui

# 需要导入模块: import PhyloBuddy [as 别名]
# 或者: from PhyloBuddy import make_copy [as 别名]
def test_print_trees_internal_ui(capsys):
    # Most of this function is covered repeatedly below, so just test the -t flag
    test_in_args = deepcopy(in_args)
    test_in_args.test = True
    test_in_args.unroot = True
    Pb.command_line_ui(test_in_args, Pb.make_copy(pb_objects[0]), skip_exit=True)
    out, err = capsys.readouterr()
    assert err == "*** Test passed ***\n"
开发者ID:JamesL13,项目名称:BuddySuite,代码行数:10,代码来源:phylobuddy_test.py

示例13: test_list_ids_ui

# 需要导入模块: import PhyloBuddy [as 别名]
# 或者: from PhyloBuddy import make_copy [as 别名]
def test_list_ids_ui(capsys):
    test_in_args = deepcopy(in_args)
    test_in_args.list_ids = [True]

    Pb.command_line_ui(test_in_args, Pb.make_copy(pb_objects[0]), skip_exit=True)
    out, err = capsys.readouterr()
    assert string2hash(out) == "4f0857e0211ff0cd058d0cf7cbaf64d5"

    test_in_args.list_ids = [4]
    Pb.command_line_ui(test_in_args, Pb.make_copy(pb_objects[0]), skip_exit=True)
    out, err = capsys.readouterr()
    assert string2hash(out) == "bf2fbfe1bd52e9b27ae21f5c06e7763a"

    test_in_args.list_ids = [4]
    Pb.command_line_ui(test_in_args, Pb.PhyloBuddy("(, );"), skip_exit=True)
    out, err = capsys.readouterr()
    assert out == "#### tree_1 ####\nNone\n\n"
开发者ID:JamesL13,项目名称:BuddySuite,代码行数:19,代码来源:phylobuddy_test.py

示例14: test_show_unique

# 需要导入模块: import PhyloBuddy [as 别名]
# 或者: from PhyloBuddy import make_copy [as 别名]
def test_show_unique():
    tester = Pb.PhyloBuddy(resource("compare_trees.newick"))
    Pb.show_unique(tester)
    assert phylo_to_hash(tester) == "ea5b0d1fcd7f39cb556c0f5df96281cf"

    with pytest.raises(AssertionError):  # If only a single tree is present
        tester = Pb.PhyloBuddy(Pb.make_copy(pb_objects[0]))
        Pb.show_unique(tester)
开发者ID:JamesL13,项目名称:BuddySuite,代码行数:10,代码来源:phylobuddy_test.py

示例15: test_screw_formats_fail

# 需要导入模块: import PhyloBuddy [as 别名]
# 或者: from PhyloBuddy import make_copy [as 别名]
def test_screw_formats_fail(capsys):
    test_in_args = deepcopy(in_args)
    test_in_args.screw_formats = "foo"
    Pb.command_line_ui(test_in_args, Pb.make_copy(pb_objects[0]), skip_exit=True)
    foo_out, foo_err = capsys.readouterr()
    assert foo_err == "Error: unknown format 'foo'\n"
开发者ID:xtmgah,项目名称:BuddySuite,代码行数:8,代码来源:phylobuddy_test.py


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