Ejemplo n.º 1
0
 def get_common_extend(self, trees):
     """Wspolne rozszerzenie bedace suma wszystkich klastrow dla wszystkich drzew"""
     return find_consensus_tree(trees, 0)
Ejemplo n.º 2
0
            prunedTree = pruneTree(dendropy.Tree(tree), leaves)
            if prunedTree:
                draw.drawTree(prunedTree)

        print("\n\n")

        # tree.print_plot()

    for break_tree_index in range(len(break_trees)):
        if break_tree_index+1 < len(break_trees):
            distance = break_trees[break_tree_index].get_rf_distance(break_trees[break_tree_index+1])
            print(str(distance))

    try:
        # Znajdowanie drzewa konsensusu o podanym procencie zgodności
        consensus_tree = consensus_tree_file.find_consensus_tree(trees, percent)
        print("Consensus tree \n\n")
        #Wypisywanie drzewa konsensusu
        draw.drawTree(consensus_tree)
    except Exception as error:
        # Jezeli wyjatek -> rodzina klastrow niezgodna dla drzewa konsensusu
        print(str(error))

    try:
        # Znajdowanie wspolnego rozszerzenia
        common_extend = CommonExtend().get_common_extend(trees)
        #Wypisywanie wspolnego rozszerzenia
        print('\n\n')
        print('Wspolne rozszerzenie: \n\n')
        draw.drawTree(common_extend)
    except Exception as error: