def test_additional_options(sequences): app1 = ClustalOmegaApp(sequences) app1.start() app2 = ClustalOmegaApp(sequences) app2.add_additional_options(["--full"]) app2.start() app1.join() app2.join() assert "--full" not in app1.get_command() assert "--full" in app2.get_command() assert app1.get_alignment() == app2.get_alignment()
def test_clustalo_tree(sequences): leaves = [phylo.TreeNode(index=i) for i in range(len(sequences))] inter1 = phylo.TreeNode([leaves[0], leaves[1]], [1.0, 1.0]) inter2 = phylo.TreeNode([leaves[2], leaves[3]], [2.5, 2.5]) root = phylo.TreeNode([inter1, inter2], [3.5, 2]) tree = phylo.Tree(root) # You cannot simultaneously set and get a tree in ClustalOmega # -> Test whether both is possible in separate calls app = ClustalOmegaApp(sequences) app.set_guide_tree(tree) app.start() app.join() app = ClustalOmegaApp(sequences) app.start() app.join() assert app.get_guide_tree() is not None
def test_additional_options(sequences): bin_path = BIN_PATH[ClustalOmegaApp] if is_not_installed(bin_path): pytest.skip(f"'{bin_path}' is not installed") app1 = ClustalOmegaApp(sequences) app1.start() app2 = ClustalOmegaApp(sequences) app2.add_additional_options(["--full"]) app2.start() app1.join() app2.join() assert "--full" not in app1.get_command() assert "--full" in app2.get_command() assert app1.get_alignment() == app2.get_alignment()
def test_clustalo_matrix(sequences): ref_matrix = [[0, 1, 2, 3], [1, 0, 1, 2], [2, 1, 0, 1], [3, 2, 1, 0]] app = ClustalOmegaApp(sequences) app.full_matrix_calculation() app.set_distance_matrix(np.array(ref_matrix)) app.start() app.join() test_matrix = app.get_distance_matrix() assert np.allclose(ref_matrix, test_matrix)
def test_clustalo_matrix(sequences): bin_path = BIN_PATH[ClustalOmegaApp] if is_not_installed(bin_path): pytest.skip(f"'{bin_path}' is not installed") ref_matrix = [[0, 1, 2, 3], [1, 0, 1, 2], [2, 1, 0, 1], [3, 2, 1, 0]] app = ClustalOmegaApp(sequences) app.full_matrix_calculation() app.set_distance_matrix(np.array(ref_matrix)) app.start() app.join() test_matrix = app.get_distance_matrix() assert np.allclose(ref_matrix, test_matrix)