コード例 #1
0
 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
コード例 #2
0
 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
コード例 #3
0
ファイル: treeholder.py プロジェクト: rohanmaddamsetti/lib
def generate_tree_with_splits_from_str(tree_str, dataset):
    '''Uses `tree_str` and `dataset` to create a PhylogeneticTree object
    and calls `calc_splits` on the object before returning it.
    '''
    tree_stream = StringIO(tree_str)
    tree_list = read_and_encode_splits(dataset, tree_stream)
    t = PhylogeneticTree(tree_list[0])
    t.calc_splits()
    return t
コード例 #4
0
ファイル: treeholder.py プロジェクト: faircloth-lab/sate-core
def generate_tree_with_splits_from_str(tree_str, dataset, force_fully_resolved=False):
    '''Uses `tree_str` and `dataset` to create a PhylogeneticTree object
    and calls `calc_splits` on the object before returning it.
    '''
    tree_stream = StringIO(tree_str)
    tree_list = read_and_encode_splits(dataset, tree_stream)
    t = tree_list[0]
    if force_fully_resolved:
        resolve_polytomies(t, update_splits=True)
    t = PhylogeneticTree(t)
    t.calc_splits()
    return t
コード例 #5
0
ファイル: treeholder.py プロジェクト: kibet-gilbert/sate-core
def generate_tree_with_splits_from_str(tree_str,
                                       dataset,
                                       force_fully_resolved=False):
    '''Uses `tree_str` and `dataset` to create a PhylogeneticTree object
    and calls `calc_splits` on the object before returning it.
    '''
    tree_stream = StringIO(tree_str)
    tree_list = read_and_encode_splits(dataset, tree_stream)
    t = tree_list[0]
    if force_fully_resolved:
        resolve_polytomies(t, update_splits=True)
    t = PhylogeneticTree(t)
    t.calc_splits()
    return t