File: _dynamic.pxd

package info (click to toggle)
obitools 3.0.1~b26%2Bdfsg-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 26,788 kB
  • sloc: ansic: 24,299; python: 657; sh: 27; makefile: 20
file content (92 lines) | stat: -rwxr-xr-x 2,117 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
#cython: language_level=3

cdef import from "stdlib.h":
    void* malloc(int size)  except NULL
    void* realloc(void* chunk,int size)  except NULL
    void free(void* chunk)
    
cdef import from "string.h":
    void bzero(void *s, size_t n)
    void memset(void* chunk,int car,int length)
    void memcpy(void* s1, void* s2, int n)
    
cdef struct AlignCell :
    double score
    int   path 
    
cdef struct AlignMatrix :
    AlignCell*  matrix
    int*        bestVJump
    int*        bestHJump
    int         msize
    int         vsize
    int         hsize
   


cdef AlignMatrix* allocateMatrix(int hsize, int vsize,AlignMatrix *matrix=?)

cdef void freeMatrix(AlignMatrix* matrix)

cdef void resetMatrix(AlignMatrix* matrix)


cdef struct alignSequence:
    long    length
    long    buffsize
    bint    hasQuality
    char*   sequence
    double* quality

cdef alignSequence* allocateSequence(object bioseq, alignSequence* seq=?) except *

cdef void freeSequence(alignSequence* seq)

cdef struct alignPath:
    long length
    long buffsize
    long vStart
    long hStart
    long *path
    
cdef alignPath* allocatePath(long l1,long l2,alignPath* path=?)

cdef void reversePath(alignPath* path)


cdef void freePath(alignPath* path)


cdef int bitCount(int x)
cpdef bint iupacMatch(unsigned char a, unsigned char b)
cpdef double iupacPartialMatch(unsigned char a, unsigned char b)
cpdef unsigned char encodeBase(unsigned char lettre)

cdef class DynamicProgramming:
    cdef AlignMatrix* matrix

    cdef object horizontalSeq 
    cdef object verticalSeq
    
    cdef alignSequence* hSeq
    cdef alignSequence* vSeq
    cdef alignPath*     path

    cdef double _opengap
    cdef double _extgap
    
    cdef object alignment
    
    cdef bint sequenceChanged
    cdef bint scoreChanged
    
    cdef int _vlen(self)
    cdef int _hlen(self)
    cdef int allocate(self) except -1
    cdef double doAlignment(self) except? 0
    cdef void reset(self)
    cdef inline int index(self, int x, int y)
    cdef inline bint _needToCompute(self)
    cdef void backtrack(self)
    cdef void clean(self)