def phylogeneticTreeFromFile(self, treefile, file_format): dataset = Dataset() dataset.read(open(treefile, 'rU'), schema=file_format) dendropy_tree = dataset.tree_lists[0][0] tree = PhylogeneticTree(dendropy_tree) tree.calc_splits() delete_outdegree_one(tree._tree) return tree
def read_and_encode_splits(dataset, tree_stream): """Reads the file-like object `tree_stream` as a source of trees for the the taxa found in dataset. and then encodes the splits of the nodes of the trees. This is a convenience function that bridges between dendropy 2 and 3 API's """ _LOG.debug("NOT covered in tests") tree_list = read_trees_into_dataset(dataset, tree_stream) assert len(tree_list) == 1 delete_outdegree_one(tree_list[0]) return tree_list
def read_and_encode_splits(dataset, tree_stream, starting_tree=False): """Reads the file-like object `tree_stream` as a source of trees for the the taxa found in dataset. and then encodes the splits of the nodes of the trees. This is a convenience function that bridges between dendropy 2 and 3 API's """ _LOG.debug("NOT covered in tests") tree_list = read_trees_into_dataset(dataset, tree_stream, starting_tree=starting_tree) assert len(tree_list) == 1 delete_outdegree_one(tree_list[0]) return tree_list