File: test_ssw.py

package info (click to toggle)
python-parasail 1.3.3-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 1,316 kB
  • sloc: python: 21,354; sh: 10; makefile: 2
file content (41 lines) | stat: -rw-r--r-- 1,187 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import parasail
from unittest import TestCase, main, expectedFailure


class Tests(TestCase):

    import pytest
    import platform
    @pytest.mark.skipif(platform.uname().machine=='aarch64', reason="FIXME: test4 ends up in Segmentation fault on arm64")
    def test1(self):
        p = parasail.ssw_init("asdf", parasail.blosum62, 1)
        r = parasail.ssw_profile(p, "asdf", 10, 1)

        print(p.s1)
#        print(p.s1Len)
        print(r.cigarLen)
        print(r.cigar[0])

    def test2(self):
        r = parasail.sw_trace("asdf", "asdf", 10, 1, parasail.blosum62)
        c = r.cigar
        print(c.len)
        print(c.seq[0])
        print(c.decode)

    @pytest.mark.skipif(platform.uname().machine=='aarch64', reason="FIXME: test4 ends up in Segmentation fault on arm64")
    def test3(self):
        p = parasail.profile_create_8("asdf", parasail.blosum62)
        r = parasail.sw_trace_striped_profile_8(p, "asdf", 10, 1)
        c = r.cigar
        print(c.len)
        print(c.seq[0])

    def test4(self):
        r = parasail.sw_trace("asdf", "asdf", 10, 1, parasail.blosum62)
        print(r.query)
        print(r.ref)


if __name__ == '__main__':
    main()