Ejemplo n.º 1
0
def work(filename):
    sequences = parasail.sequences_from_file(filename)
    print(len(sequences))
    print(len(sequences[0]))
    print(sequences[0])
    print(len(sequences[-1]))
    print(sequences[-1])
    print(sequences[0][0])
    with pytest.raises(TypeError):
        print(sequences['asdf'])
    with pytest.raises(TypeError):
        print(sequences[0]['asdf'])
    with pytest.raises(IndexError):
        print(sequences[1000000])
    with pytest.raises(IndexError):
        print(sequences[-1000000])
    with pytest.raises(IndexError):
        print(sequences[0][1000000])
    with pytest.raises(IndexError):
        print(sequences[0][-1000000])
    print("name:    '{}'".format(sequences[0].name))
    print("comment: '{}'".format(sequences[0].comment))
    print("seq:     '{}'".format(sequences[0].seq))
    print("qual:    '{}'".format(sequences[0].qual))
    print("characters: {}".format(sequences.characters))
    print("shortest:   {}".format(sequences.shortest))
    print("longest:    {}".format(sequences.longest))
    print("mean:       {}".format(sequences.mean))
    print("stddev:     {}".format(sequences.stddev))
    result = parasail.sw(str(sequences[0]), str(sequences[1]), 10, 1, parasail.blosum62)
    print(result.score)
    result = parasail.sw(sequences[0], sequences[1], 10, 1, parasail.blosum62)
    print(result.score)
Ejemplo n.º 2
0
 def work(self):
     sequences = parasail.sequences_from_file(self.tmpfile)
     print(len(sequences))
     print(len(sequences[0]))
     print(sequences[0])
     print(len(sequences[-1]))
     print(sequences[-1])
     print(sequences[0][0])
     with self.assertRaises(TypeError):
         print(sequences['asdf'])
     with self.assertRaises(TypeError):
         print(sequences[0]['asdf'])
     with self.assertRaises(IndexError):
         print(sequences[1000000])
     with self.assertRaises(IndexError):
         print(sequences[-1000000])
     with self.assertRaises(IndexError):
         print(sequences[0][1000000])
     with self.assertRaises(IndexError):
         print(sequences[0][-1000000])
     print("name:    '{}'".format(sequences[0].name))
     print("comment: '{}'".format(sequences[0].comment))
     print("seq:     '{}'".format(sequences[0].seq))
     print("qual:    '{}'".format(sequences[0].qual))
     print("characters: {}".format(sequences.characters))
     print("shortest:   {}".format(sequences.shortest))
     print("longest:    {}".format(sequences.longest))
     print("mean:       {}".format(sequences.mean))
     print("stddev:     {}".format(sequences.stddev))
     result = parasail.sw(str(sequences[0]), str(sequences[1]), 10, 1,
                          parasail.blosum62)
     print(result.score)
     result = parasail.sw(sequences[0], sequences[1], 10, 1,
                          parasail.blosum62)
     print(result.score)
Ejemplo n.º 3
0
def test1():
    result = parasail.sw("asdf", "asdf", 10, 1, parasail.blosum62)
    try:
        traceback = result.traceback
        print_traceback_attributes(traceback)
    except AttributeError:
        pass
    else:
        raise Error("AttributeError expected, Failure")
Ejemplo n.º 4
0
def test0():
    result = parasail.sw("asdf", "asdf", 10, 1, parasail.blosum62)
    try:
        cigar = result.cigar
        print_cigar_attributes(cigar)
    except AttributeError:
        pass
    else:
        raise Error("AttributeError expected, Failure")
Ejemplo n.º 5
0
def test1():
    result = parasail.sw("asdf","asdf",10,1,parasail.blosum62)
    try:
        traceback = result.traceback
        print_traceback_attributes(traceback)
    except AttributeError:
        pass
    else:
        raise Error("AttributeError expected, Failure")
Ejemplo n.º 6
0
def test0():
    result = parasail.sw("asdf","asdf",10,1,parasail.blosum62)
    try:
        cigar = result.cigar
        print_cigar_attributes(cigar)
    except AttributeError:
        pass
    else:
        raise Error("AttributeError expected, Failure")
Ejemplo n.º 7
0
def test3():
    matrix = parasail.matrix_create("acgt", 1, -1)
    result = parasail.sw("acgt", "acgt", 10, 1, matrix)
    assert (result.score == 4)
    del result
    del matrix
Ejemplo n.º 8
0
def test2():
    result = parasail.sw("asdf", "asdf", 10, 1, parasail.pam50)
    assert (result.score == 27)
    del result
Ejemplo n.º 9
0
 def test2(self):
     result = parasail.sw("asdf", "asdf", 10, 1, parasail.pam50)
     self.assertEqual(result.score, 27)
Ejemplo n.º 10
0
 def test1(self):
     result = parasail.sw("asdf", "asdf", 10, 1, parasail.blosum62)
     self.assertEqual(result.score, 20)
Ejemplo n.º 11
0
 def test3(self):
     matrix = parasail.matrix_create("acgt", 1, -1)
     result = parasail.sw("acgt", "acgt", 10, 1, matrix)
     self.assertEqual(result.score, 4)
Ejemplo n.º 12
0
def test():
    result = parasail.sw_table("asdf","asdfasdf",10,1,parasail.blosum62)
    print result
    print result.saturated
    print result.score
    with pytest.raises(AttributeError):
        print result.matches
    with pytest.raises(AttributeError):
        print result.similar
    with pytest.raises(AttributeError):
        print result.length
    print result.score_table

    result = parasail.sw_stats_table("asdf","asdfasdf",10,1,parasail.blosum62)
    print result
    print result.saturated
    print result.score
    print result.matches
    print result.similar
    print result.length
    print result.score_table
    print result.matches_table
    print result.similar_table
    print result.length_table

    result = parasail.sw_rowcol("asdf","asdfasdf",10,1,parasail.blosum62)
    print result
    print result.saturated
    print result.score
    with pytest.raises(AttributeError):
        print result.matches
    with pytest.raises(AttributeError):
        print result.similar
    with pytest.raises(AttributeError):
        print result.length
    print result.score_row
    print result.score_col

    result = parasail.sw_stats_rowcol("asdf","asdfasdf",10,1,parasail.blosum62)
    print result
    print result.saturated
    print result.score
    print result.matches
    print result.similar
    print result.length
    print result.score_row
    print result.score_col
    print result.matches_row
    print result.matches_col
    print result.similar_row
    print result.similar_col
    print result.length_row
    print result.length_col

    result = parasail.sw("asdf","asdf",10,1,parasail.blosum62)
    print result
    print result.saturated
    print result.score
    with pytest.raises(AttributeError):
        print result.matches
    with pytest.raises(AttributeError):
        print result.similar
    with pytest.raises(AttributeError):
        print result.length
    with pytest.raises(AttributeError):
        print result.score_table

    result = parasail.sw_stats("asdf","asdf",10,1,parasail.blosum62)
    print result
    print result.saturated
    print result.score
    print result.matches
    print result.similar
    print result.length

    result = parasail.sw_scan_32("asdf","asdf",10,1,parasail.blosum62)
    print result
    print result.saturated
    print result.score
    with pytest.raises(AttributeError):
        print result.matches
    with pytest.raises(AttributeError):
        print result.similar
    with pytest.raises(AttributeError):
        print result.length

    result = parasail.sw_scan_16("asdf","asdf",10,1,parasail.blosum62)
    print result
    print result.saturated
    print result.score
    with pytest.raises(AttributeError):
        print result.matches
    with pytest.raises(AttributeError):
        print result.similar
    with pytest.raises(AttributeError):
        print result.length

    result = parasail.sw_stats_striped_16("asdf","asdf",10,1,parasail.blosum62)
    print result
    print result.saturated
    print result.score
    print result.matches
    print result.similar
    print result.length

    print parasail.blosum62.name
    print parasail.blosum62.size
    print parasail.blosum62.matrix

    profile = parasail.profile_create_8("asdf", parasail.blosum62)
    profile = parasail.profile_create_8("asdf", parasail.blosum62)
    print profile
    print profile.s1
    print profile.matrix

    result = parasail.sw_striped_profile_8(profile,"asdf",10,1)
    print result
    print result.saturated
    print result.score

    profile = parasail.profile_create_sat("asdf", parasail.blosum62)
    print profile
    print profile.s1
    print profile.matrix
    print dir(profile.matrix)
    print profile.matrix.min
    print profile.matrix.max
    print profile.matrix.size

    result = parasail.sw_striped_profile_sat(profile,"asdf",10,1)
    print result
    print result.saturated
    print result.score
    print type(result.score)
Ejemplo n.º 13
0
 def test1(self):
     result = parasail.sw("asdf", "asdf", 10, 1, parasail.blosum62)
     with self.assertRaises(AttributeError):
         print_traceback_attributes(result.traceback)
Ejemplo n.º 14
0
def test():
    result = parasail.sw_table("asdf", "asdfasdf", 10, 1, parasail.blosum62)
    print result
    print result.saturated
    print result.score
    with pytest.raises(AttributeError):
        print result.matches
    with pytest.raises(AttributeError):
        print result.similar
    with pytest.raises(AttributeError):
        print result.length
    print result.score_table

    result = parasail.sw_stats_table("asdf", "asdfasdf", 10, 1,
                                     parasail.blosum62)
    print result
    print result.saturated
    print result.score
    print result.matches
    print result.similar
    print result.length
    print result.score_table
    print result.matches_table
    print result.similar_table
    print result.length_table

    result = parasail.sw_rowcol("asdf", "asdfasdf", 10, 1, parasail.blosum62)
    print result
    print result.saturated
    print result.score
    with pytest.raises(AttributeError):
        print result.matches
    with pytest.raises(AttributeError):
        print result.similar
    with pytest.raises(AttributeError):
        print result.length
    print result.score_row
    print result.score_col

    result = parasail.sw_stats_rowcol("asdf", "asdfasdf", 10, 1,
                                      parasail.blosum62)
    print result
    print result.saturated
    print result.score
    print result.matches
    print result.similar
    print result.length
    print result.score_row
    print result.score_col
    print result.matches_row
    print result.matches_col
    print result.similar_row
    print result.similar_col
    print result.length_row
    print result.length_col

    result = parasail.sw("asdf", "asdf", 10, 1, parasail.blosum62)
    print result
    print result.saturated
    print result.score
    with pytest.raises(AttributeError):
        print result.matches
    with pytest.raises(AttributeError):
        print result.similar
    with pytest.raises(AttributeError):
        print result.length
    with pytest.raises(AttributeError):
        print result.score_table

    result = parasail.sw_stats("asdf", "asdf", 10, 1, parasail.blosum62)
    print result
    print result.saturated
    print result.score
    print result.matches
    print result.similar
    print result.length

    result = parasail.sw_scan_32("asdf", "asdf", 10, 1, parasail.blosum62)
    print result
    print result.saturated
    print result.score
    with pytest.raises(AttributeError):
        print result.matches
    with pytest.raises(AttributeError):
        print result.similar
    with pytest.raises(AttributeError):
        print result.length

    result = parasail.sw_scan_16("asdf", "asdf", 10, 1, parasail.blosum62)
    print result
    print result.saturated
    print result.score
    with pytest.raises(AttributeError):
        print result.matches
    with pytest.raises(AttributeError):
        print result.similar
    with pytest.raises(AttributeError):
        print result.length

    result = parasail.sw_stats_striped_16("asdf", "asdf", 10, 1,
                                          parasail.blosum62)
    print result
    print result.saturated
    print result.score
    print result.matches
    print result.similar
    print result.length

    print parasail.blosum62.name
    print parasail.blosum62.size
    print parasail.blosum62.matrix

    profile = parasail.profile_create_8("asdf", parasail.blosum62)
    profile = parasail.profile_create_8("asdf", parasail.blosum62)
    print profile
    print profile.s1
    print profile.matrix

    result = parasail.sw_striped_profile_8(profile, "asdf", 10, 1)
    print result
    print result.saturated
    print result.score

    profile = parasail.profile_create_sat("asdf", parasail.blosum62)
    print profile
    print profile.s1
    print profile.matrix
    print dir(profile.matrix)
    print profile.matrix.min
    print profile.matrix.max
    print profile.matrix.size

    result = parasail.sw_striped_profile_sat(profile, "asdf", 10, 1)
    print result
    print result.saturated
    print result.score
    print type(result.score)
Ejemplo n.º 15
0
print result
print result.saturated
print result.score
print result.matches
print result.similar
print result.length
print result.score_row
print result.score_col
print result.matches_row
print result.matches_col
print result.similar_row
print result.similar_col
print result.length_row
print result.length_col

result = parasail.sw("asdf","asdf",10,1,parasail.blosum62)
print result
print result.saturated
print result.score
print result.matches
print result.similar
print result.length
print result.score_table

result = parasail.sw_stats("asdf","asdf",10,1,parasail.blosum62)
print result
print result.saturated
print result.score
print result.matches
print result.similar
print result.length
Ejemplo n.º 16
0
def test1():
    result = parasail.sw("asdf", "asdf", 10, 1, parasail.blosum62)
    assert (result.score == 20)
    del result
Ejemplo n.º 17
0
    def test(self):
        result = parasail.sw_table("asdf", "asdfasdf", 10, 1,
                                   parasail.blosum62)
        print(result)
        print(result.saturated)
        print(result.score)
        with self.assertRaises(AttributeError):
            print(result.matches)
        with self.assertRaises(AttributeError):
            print(result.similar)
        with self.assertRaises(AttributeError):
            print(result.length)
        print(result.score_table)

        result = parasail.sw_stats_table("asdf", "asdfasdf", 10, 1,
                                         parasail.blosum62)
        print(result)
        print(result.saturated)
        print(result.score)
        print(result.matches)
        print(result.similar)
        print(result.length)
        print(result.score_table)
        print(result.matches_table)
        print(result.similar_table)
        print(result.length_table)

        result = parasail.sw_rowcol("asdf", "asdfasdf", 10, 1,
                                    parasail.blosum62)
        print(result)
        print(result.saturated)
        print(result.score)
        with self.assertRaises(AttributeError):
            print(result.matches)
        with self.assertRaises(AttributeError):
            print(result.similar)
        with self.assertRaises(AttributeError):
            print(result.length)
        print(result.score_row)
        print(result.score_col)

        result = parasail.sw_stats_rowcol("asdf", "asdfasdf", 10, 1,
                                          parasail.blosum62)
        print(result)
        print(result.saturated)
        print(result.score)
        print(result.matches)
        print(result.similar)
        print(result.length)
        print(result.score_row)
        print(result.score_col)
        print(result.matches_row)
        print(result.matches_col)
        print(result.similar_row)
        print(result.similar_col)
        print(result.length_row)
        print(result.length_col)

        result = parasail.sw("asdf", "asdf", 10, 1, parasail.blosum62)
        print(result)
        print(result.saturated)
        print(result.score)
        with self.assertRaises(AttributeError):
            print(result.matches)
        with self.assertRaises(AttributeError):
            print(result.similar)
        with self.assertRaises(AttributeError):
            print(result.length)
        with self.assertRaises(AttributeError):
            print(result.score_table)

        result = parasail.sw_stats("asdf", "asdf", 10, 1, parasail.blosum62)
        print(result)
        print(result.saturated)
        print(result.score)
        print(result.matches)
        print(result.similar)
        print(result.length)

        result = parasail.sw_scan_32("asdf", "asdf", 10, 1, parasail.blosum62)
        print(result)
        print(result.saturated)
        print(result.score)
        with self.assertRaises(AttributeError):
            print(result.matches)
        with self.assertRaises(AttributeError):
            print(result.similar)
        with self.assertRaises(AttributeError):
            print(result.length)

        result = parasail.sw_scan_16("asdf", "asdf", 10, 1, parasail.blosum62)
        print(result)
        print(result.saturated)
        print(result.score)
        with self.assertRaises(AttributeError):
            print(result.matches)
        with self.assertRaises(AttributeError):
            print(result.similar)
        with self.assertRaises(AttributeError):
            print(result.length)

        result = parasail.sw_stats_striped_16("asdf", "asdf", 10, 1,
                                              parasail.blosum62)
        print(result)
        print(result.saturated)
        print(result.score)
        print(result.matches)
        print(result.similar)
        print(result.length)

        print(parasail.blosum62.name)
        print(parasail.blosum62.size)
        print(parasail.blosum62.matrix)

        profile = parasail.profile_create_8("asdf", parasail.blosum62)
        profile = parasail.profile_create_8("asdf", parasail.blosum62)
        print(profile)
        print(profile.s1)
        print(profile.matrix)

        result = parasail.sw_striped_profile_8(profile, "asdf", 10, 1)
        print(result)
        print(result.saturated)
        print(result.score)

        profile = parasail.profile_create_sat("asdf", parasail.blosum62)
        print(profile)
        print(profile.s1)
        print(profile.matrix)
        print(dir(profile.matrix))
        print(profile.matrix.min)
        print(profile.matrix.max)
        print(profile.matrix.size)

        result = parasail.sw_striped_profile_sat(profile, "asdf", 10, 1)
        print(result)
        print(result.saturated)
        print(result.score)
        print(type(result.score))
Ejemplo n.º 18
0
 def test0(self):
     result = parasail.sw("asdf", "asdf", 10, 1, parasail.blosum62)
     with self.assertRaises(AttributeError):
         print_cigar_attributes(result.cigar)