def test_needleman_alignment(): ''' Checks if align method works ''' seq1 = "GCATGCU" seq2 = "GATTACA" needle = minineedle.NeedlemanWunsch(seq1, seq2) needle.change_matrix(minineedle.ScoreMatrix(1, -1, -1)) needle.align() assert (needle._alseq1 == [ "G", "C", "A", minineedle.Gap(), "T", "G", "C", "U" ]) assert (needle._alseq2 == [ "G", minineedle.Gap(), "A", "T", "T", "A", "C", "A" ])
def test_gap_char_change(): ''' Checks change of Gap character ''' gap = minineedle.Gap() gap.character = "imagap" assert (str(gap) == "imagap")
def test_smith_alignment(): ''' Checks if align method works ''' seq1 = "TGTTACGG" seq2 = "GGTTGACTA" smith = minineedle.SmithWaterman(seq1, seq2) smith.change_matrix(minineedle.ScoreMatrix(3, -3, -2)) smith.align() assert (smith.get_aligned_sequences()[0] == [ "G", "T", "T", minineedle.Gap(), "A", "C" ]) assert (smith.get_aligned_sequences()[1] == ["G", "T", "T", "G", "A", "C"])
def test_gap_char(): gap = minineedle.Gap("a") assert (str(gap) == "a")
def test_gap_equal(): g1 = minineedle.Gap() g2 = minineedle.Gap() assert (g1 == g2)