Hi Macro,

Many thanks! Your information is really helpful. I will try to understand code based on your information.

Yes, this implementation assume 2 sequence string with same length. If I can modify it generally to work with any pair of sequence string, I will.

Thanks so much again,

Duy.

*** Edit ***

[QUOTE=Marco13]In the implementation on GitHub, the matrix is divided into quadratic sub-matrices. The “sub” variable describes the size of these submatrices, and the “slice” is the number of the diagonal of submatrices:

```
-------------------------------
| | | |
| Slice 0 | Slice 1 | Slice 2 |
| | | |
-------------------------------
| | | |
| Slice 1 | Slice 2 | Slice 3 |
| | | |
-------------------------------
| | | |
| Slice 2 | Slice 3 | Slice 4 |
| | | |
-------------------------------
```

The “subIndexes” store the coordinates of these sub-matrices in the large matrix.

The fact that this implementation assumes

- that both strings have the same length AND
- that the length is evenly divisible by the size of the submatrix

is a simplification. This is not intended to be a “General Sequence Alognment Framework”, but only a proof of concept. Every generalization increases the complexity, and makes it necessary to treat special cases (and (for OpenCL), to introduce padding of the matrices).

The description of this approach in https://github.com/l-urence/smith-waterman/blob/735260a2a94d28a6b29230fffedf3dc3ff782cb8/ausarbeitung/psys_dna.pdf?raw=true is in German, but maybe you’ll find the algorithm or images helpful anyhow.[/QUOTE]

Hi Marco,

Now I could understand what code said. We just need set sub = 1 to resolve my problem. I also found something wrong in kernel.cl, I think we don’t need any for loop in cl code.

I have took time to port it into Java code and debug today and understood a lot of things. I will try to accomplish this code to resolve any pair of sequence with different length and the point is how to identify subindex values in case 2 different lengths of sequence strings.

Anyway, thanks so much. Since I have done, I will send you my implementation to use it as example in your website.

Thanks,

Duy.