mengyao / Complete-Striped-Smith-Waterman-Library

298 stars 112 forks source link

Semi-global alignment request #17

Closed armintoepfer closed 2 years ago

armintoepfer commented 9 years ago

It would be very helpful to use the current implementation not only for local alignments, but also semi global alignments, such as finding the full query in a longer reference sequence. For this, maxColumn should report the last entry of each column, instead of the maximum. I would be grateful for this enhancement.

Thanks, Armin

mengyao commented 9 years ago

Dear Armin,

Thank you very much for your interests in SSW.

Yes, to implement a semi global alignment (without back trace) may be done without much work.

The running time of a semi global alignment revised from SSW may be slower, since branches (if … else …) are needed in the inner loop of the matrix calculation: negative values need to be allowed, if they are from insertions.

I will do this when I have time.

Yours,

Mengyao

On Jan 20, 2015, at 10:34 AM, Armin Töpfer notifications@github.com wrote:

It would be very helpful to use the current implementation not only for local alignments, but also semi global alignments, such as finding the full query in a longer reference sequence. For this, maxColumn should report the last entry of each column, instead of the maximum. I would be grateful for this enhancement.

Thanks, Armin

— Reply to this email directly or view it on GitHub https://github.com/mengyao/Complete-Striped-Smith-Waterman-Library/issues/17.

armintoepfer commented 9 years ago

Hey Mengyao, already found some time? I'm still counting on you :)

mengyao commented 9 years ago

Dear Armin,

I’m very sorry for the late reply.

I apologize that I don’t have time to implement this. Now I’m doing a new job, and busy with other projects.

Hope you can revise the program yourself.

In order to make the semi global alignment, you need to revise two functions in ssw.c in similar way:

sw_sse2_byte sw_sse2_word

The main point you need to revise is in the loop begin from line 204: /* inner loop to process the query sequence */ for (j = 0; LIKELY(j < segLen); ++j) {

// when you update vF (line 233), negative values need to be allowed.

}

With this revision, it will give you the best semi global alignment score. To get the alignment path, more difficult revision needs to be done with the back trace part.

Hope this helps.

Yours,

Mengyao

On Apr 24, 2015, at 7:39 PM, Armin Töpfer notifications@github.com wrote:

Hey Mengyao, already found some time? I'm still counting on you :)

Armin — Reply to this email directly or view it on GitHub https://github.com/mengyao/Complete-Striped-Smith-Waterman-Library/issues/17#issuecomment-96102069.

armintoepfer commented 7 years ago

Dear Mengyao,

since this seems to be an easy feature fix for you, would you be so nice and provide a patch or a feature branch for this? I'd appreciate it.

Thank you, Armin