Exemple #1
0
def local_alignment(sequence1, sequence2):
	global_alignment.clean_matrix()
	global_alignment.init_matrix(sequence1, sequence2) # INICIALIZA LA MATRIZ DE PUNTAJES CON CEROS
	fill_matrix(sequence1, sequence2) # CALCULA TODOS LOS PUNTAJES
	alignments = traceback(["--"]+sequence1,["--"]+sequence2) # OBTIENE EL ALINEAMIENTO OPTIMO
	alignments.insert(0,global_alignment.alignmentScore(alignments[0], alignments[1]))
	return alignments
Exemple #2
0
def semiglobal_alignment(sequence1, sequence2):
	global_alignment.clean_matrix()
	global_alignment.init_matrix(sequence1, sequence2) # INICIALIZA LA MATRIZ DE PUNTAJES CON CEROS
	fill_first_values() # LLENA LA PRIMER FILA Y LA PRIMERA COLUMNA
	global_alignment.fill_matrix(sequence1, sequence2) # CALCULA TODOS LOS PUNTAJES
	new_col = max_number_semiglobal()
	alignments = traceback(["--"]+sequence1,["--"]+sequence2) # OBTIENE EL ALINEAMIENTO OPTIMO
	alignments.insert(0,global_alignment.alignmentScore(alignments[0], alignments[1]))
	return alignments
def local_alignment(sequence1, sequence2, newMatch, newMismatch, newGap):
    global_alignment.setValues(newMatch, newMismatch, newGap)
    global_alignment.clean_matrix()
    global_alignment.init_matrix(
        sequence1, sequence2)  # INICIALIZA LA MATRIZ DE PUNTAJES CON CEROS
    fill_matrix(sequence1, sequence2)  # CALCULA TODOS LOS PUNTAJES
    alignments = traceback(["--"] + sequence1, ["--"] +
                           sequence2)  # OBTIENE EL ALINEAMIENTO OPTIMO
    alignments.append(
        global_alignment.alignmentScore(alignments[0], alignments[1]))
    return alignments