Esempio n. 1
0
def return_UPGMA_working(seq_list, names_list, protdist_outfile,
                         pylip_temps_path):
    '''
	with protdist
	:param seq_list: list of sequence for the UPGMA
	:param names_list: the name of the sequences at seq_list, at the same order
	:return: UPGMA tree
	'''
    #protdist_outfile = "protdist_outfile.ph"
    mafft_and_phylip.runIt(
        names_list, seq_list, protdist_outfile, pylip_temps_path
    )  #to uncomment when really ranning the tool on the server
    matrix = make_initiale_matrix_from_protdist(protdist_outfile)
    #print(matrix)
    distance_matrix = make_distance_matrix(names_list, matrix)
    return make_UPGMA(distance_matrix), distance_matrix
Esempio n. 2
0
def return_UPGMA(seq_list, names_list, protdist_outfile, pylip_temps_path):
    '''
	with protdist
	:param seq_list: list of sequence for the UPGMA
	:param names_list: the name of the sequences at seq_list, at the same order
	:return: UPGMA tree
	'''
    #protdist_outfile = "protdist_outfile.ph"
    new_names_list = list()
    for i in range(len(names_list)):
        new_names_list.append("GG" + str(i))  #for the regex

    #print(new_names_list)
    mafft_and_phylip.runIt(
        new_names_list, seq_list, protdist_outfile, pylip_temps_path
    )  #to uncomment when really ranning the tool on the server
    matrix = make_initiale_matrix_from_protdist(protdist_outfile)
    #print(matrix)
    distance_matrix = make_distance_matrix(names_list, matrix)
    return make_UPGMA(distance_matrix), distance_matrix