func TestCalculateDistanceOptAli(t *testing.T) { optaln1 := new(algorithms.OptAli) result1 := optaln1.CalculateDistance("SimpleTest", "SimplTest") assert.Equal(t, 1, result1, "Calculation for Optimal Alignment is not correct!") optaln2 := new(algorithms.OptAli) result2 := optaln2.CalculateDistance("ATCGT", "TGGTG") assert.Equal(t, 3, result2, "Calculation for Optimal Alignment is not correct!") optaln3 := new(algorithms.OptAli) result3 := optaln3.CalculateDistance("GACTTAC", "CGTGAATTCAT") assert.Equal(t, 6, result3, "Calculation for Optimal Alignment is not correct!") }
func main() { optaln := new(algorithms.OptAli) log.Println(optaln.CalculateDistance("SimpleTest", "SimplTest")) optaln = new(algorithms.OptAli) log.Println(optaln.CalculateDistance("ATCGT", "TGGTG")) optaln = new(algorithms.OptAli) log.Println(optaln.CalculateDistance("GACTTAC", "CGTGAATTCAT")) damleu := new(algorithms.DamLev) log.Println(damleu.CalculateDistanceWithAlphabet("SimpleTest", "SimplTest", 20)) damleu = new(algorithms.DamLev) log.Println(damleu.CalculateDistanceWithAlphabet("ATCGT", "TGGTG", 20)) //gap, missmatchscore, exactscore neewun := algorithms.NewNeeWun(-2, 1, 1) log.Println(neewun.CalculateDistance("ATCGT", "TGGTG")) smiwat := algorithms.NewSmiWat(-4, 3, 5) log.Println(smiwat.CalculateDistance("GACTTAC", "CGTGAATTCAT")) }