示例#1
0
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"
    ])
示例#2
0
def test_gap_char_change():
    '''
    Checks change of Gap character
    '''
    gap = minineedle.Gap()
    gap.character = "imagap"
    assert (str(gap) == "imagap")
示例#3
0
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"])
示例#4
0
def test_gap_char():
    gap = minineedle.Gap("a")
    assert (str(gap) == "a")
示例#5
0
def test_gap_equal():
    g1 = minineedle.Gap()
    g2 = minineedle.Gap()
    assert (g1 == g2)