import argparse
import alignment
import alignment_sol
import alignment_util
import random
import sys


labels = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"

D1 = alignment_util.readScoringMatrix("DNA1.txt")
D2 = alignment_util.readScoringMatrix("DNA2.txt")
D3 = alignment_util.genScoringMatrix(10, -5)
D4 = alignment_util.genScoringMatrix(5,0)
B  = alignment_util.readScoringMatrix("Blosum62.txt")

#############################
def test_SW(seq1, seq2, S, g):
    s, a1, a2 = alignment.SmithWaterman(seq1, seq2, S, g)
    s_sol, a1_sol, a2_sol = alignment_sol.SmithWaterman(seq1, seq2, S, g)
    score = 0
    
    # First: test that the function has returned has an optimal alignment
    if alignment_util.scoreAlignment(a1, a2, S, g) == s_sol:
        score += 70

    # Second: test that the function has returned an optimal score
    if s == s_sol:
        score += 20

    # Third: Test that the function has returned the correct score for the alignment
Esempio n. 2
0
 def setUp(self):
     self.S1 = alignment_util.readScoringMatrix("DNA1.txt")
     self.S2 = alignment_util.readScoringMatrix("DNA2.txt")
     self.S3 = alignment_util.genScoringMatrix(10, -10)
     self.S4 = alignment_util.readScoringMatrix("Blosum62.txt")
 def setUp(self):
     self.S1 = alignment_util.readScoringMatrix("DNA1.txt")
     self.S2 = alignment_util.readScoringMatrix("DNA2.txt")
     self.S3 = alignment_util.genScoringMatrix(10,-10)
     self.S4 = alignment_util.readScoringMatrix("Blosum62.txt")
import argparse
import alignment
import alignment_sol
import alignment_util
import random
import sys

labels = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"

D1 = alignment_util.readScoringMatrix("DNA1.txt")
D2 = alignment_util.readScoringMatrix("DNA2.txt")
D3 = alignment_util.genScoringMatrix(10, -5)
D4 = alignment_util.genScoringMatrix(5, 0)
B = alignment_util.readScoringMatrix("Blosum62.txt")


#############################
def test_SW(seq1, seq2, S, g):
    s, a1, a2 = alignment.SmithWaterman(seq1, seq2, S, g)
    s_sol, a1_sol, a2_sol = alignment_sol.SmithWaterman(seq1, seq2, S, g)
    score = 0

    # First: test that the function has returned has an optimal alignment
    if alignment_util.scoreAlignment(a1, a2, S, g) == s_sol:
        score += 70

    # Second: test that the function has returned an optimal score
    if s == s_sol:
        score += 20

    # Third: Test that the function has returned the correct score for the alignment