mengyao / Complete-Striped-Smith-Waterman-Library

298 stars 112 forks source link

Simple ssw wrapper for python #12

Closed a-slide closed 10 years ago

a-slide commented 10 years ago

We wrote a simple wrapper for python 2.7 that can be use easily by importing the python class Aligner. For now it only works for DNA sequences. The strategy used was similar to the one employed for the c++ wrapper (ie. the returned c structure is converted into a language specific object), with some differences due to specificity of the python language. Doxygen documentation was added and can be parsed using doxypy as an input filter in the dox configuration file. Inline functions _cigar_int_toop and _cigar_int_toint had to be moved from ssw.h to ssw.c as simple non static non inline functions since it was impossible to map then with python ctypes librairy. The makefile was also modified to generate the dynamic library (libssw.so) required for communication with Python. Do no hesitate to ask if you want more information.

mengyao commented 10 years ago

Thank you very much for your work on the Python wrapper.

May I ask which institution are you working with? I may acknowledge you in my PhD thesis and defense.

Sincerely,

Mengyao

mengyao commented 10 years ago

Hi,

Thank you very much for the python wrapper. This is a very useful contribution to SSW.

I was wondering would you mind to update the README file accordingly to add a simple description of how to use the Python API? If you would like to change the README to README.md format please feel free to do so.

Please let me know.

Many thanks,

Mengyao

On Jan 18, 2014, at 7:01 AM, Slide notifications@github.com wrote:

We wrote a simple wrapper for python 2.7 that can be use easily by importing the python class Aligner. For now it only works for DNA sequences. The strategy used was similar to the one employed for the c++ wrapper (ie. the returned c structure is converted into a language specific object), with some differences due to specificity of the python language. Doxygen documentation was added and can be parsed using doxypy as an input filter in the dox configuration file. Inline functions cigar_int_to_op and cigar_int_to_int had to be moved from ssw.h to ssw.c as simple non static non inline functions since it was impossible to map then with python ctypes librairy. The makefile was also modified to generate the dynamic library (libssw.so) required for communication with Python. Do no hesitate to ask if you want more information.

You can merge this Pull Request by running

git pull https://github.com/clementleger/Complete-Striped-Smith-Waterman-Library master Or view, comment on, or merge it at:

https://github.com/mengyao/Complete-Striped-Smith-Waterman-Library/pull/12

Commit Summary

Add Python wrapper Build library for python wrapper Better Makefile support Rewrote a more pythonic ssw_wrapper Build: fix lib build for older systems Return a python object instead of a ctype structure Return a python object instead of a ctype structure Inline func cigar_int_to_op and cigar_int_to_int moved from ssw.h to ssw.c as normal functions for python compatibility Implement CIGAR string field conversion File Changes

M src/Makefile (8) M src/ssw.c (28) M src/ssw.h (28) A src/ssw_wrap.py (366) Patch Links:

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

Mengyao

"The plain fact is that the planet does not need more 'successful' people. But it does desperately need more peacemakers, healers, restorers, storytellers, and lovers of every shape and form. It needs people who live well in their places. It needs people of moral courage willing to join the fight to make the world habitable and humane. And these needs have little to do with success as our culture has defined it." - David Orr

a-slide commented 10 years ago

Hi, You're welcome, it is nice to have a ssw aligner for python that is much faster that a pure python aligner. You also did a great job from your side by implementing this fast ssw aligner. Did your try the module? The work was done by my brother on it's free time and by me during my work time in a french academic laboratory (INSERM UMR 1089, Nantes, France). As for the update of the readme file, I won't do it right now but just let me 2 or 3 weeks. Adrien

mengyao commented 10 years ago

Hi Adrien,

Thank you for your quick reply.

I haven’t tried the API yet. It’s not convenient for me to try Python program currently, since I’m not using this language.

I will test it later when I finish my graduation staffs, but I don’t mind to put the Python API at GitHub now. Let people try it, and we can improve it.

Please bring my thanks to your brother, too. France is strong at algorithm development. It’s a pleasure to see it myself.

Also thank you for willing to update the README file. Please take your time.

Best wishes,

Mengyao

On Jan 18, 2014, at 10:53 AM, Slide notifications@github.com wrote:

Hi, You're welcome, it is nice to have a ssw aligner for python that is much faster that a pure python aligner. You also did a great job from your side by implementing this fast ssw aligner. Did your try the module? The work was done by my brother on it's free time and by me on my work time (INSERM UMR 1089, Nantes, France). As for the update of the readme file, I won't do it right now but just let me 2 or 3 weeks. Adrien

— Reply to this email directly or view it on GitHub.

wanpinglee commented 10 years ago

Hi Adrien, Mengyao,

Thank you so much, Adrien. It's really nice having the Python API. I've circulated the API to my friends and colleagues.

Cheers, Wan-Ping

On Fri, Jul 18, 2014 at 12:04 PM, mengyao notifications@github.com wrote:

Hi Adrien,

Thank you for your quick reply.

I haven’t tried the API yet. It’s not convenient for me to try Python program currently, since I’m not using this language.

I will test it later when I finish my graduation staffs, but I don’t mind to put the Python API at GitHub now. Let people try it, and we can improve it.

Please bring my thanks to your brother, too. France is strong at algorithm development. It’s a pleasure to see it myself.

Also thank you for willing to update the README file. Please take your time.

Best wishes,

Mengyao

On Jan 18, 2014, at 10:53 AM, Slide notifications@github.com wrote:

Hi, You're welcome, it is nice to have a ssw aligner for python that is much faster that a pure python aligner. You also did a great job from your side by implementing this fast ssw aligner. Did your try the module? The work was done by my brother on it's free time and by me on my work time (INSERM UMR 1089, Nantes, France). As for the update of the readme file, I won't do it right now but just let me 2 or 3 weeks. Adrien

— Reply to this email directly or view it on GitHub.

— Reply to this email directly or view it on GitHub https://github.com/mengyao/Complete-Striped-Smith-Waterman-Library/pull/12#issuecomment-49448464 .

Wan-Ping Lee Senior Lead Scientist, R&D, Seven Bridges Genomics Inc.

https://sites.google.com/site/wanpinglee

mengyao commented 10 years ago

Thank you, Wan-Ping.

Bests,

Mengyao

On Jan 18, 2014, at 12:11 PM, Wan-Ping Lee notifications@github.com wrote:

Hi Adrien, Mengyao,

Thank you so much, Adrien. It's really nice having the Python API. I've circulated the API to my friends and colleagues.

Cheers, Wan-Ping

On Fri, Jul 18, 2014 at 12:04 PM, mengyao notifications@github.com wrote:

Hi Adrien,

Thank you for your quick reply.

I haven’t tried the API yet. It’s not convenient for me to try Python program currently, since I’m not using this language.

I will test it later when I finish my graduation staffs, but I don’t mind to put the Python API at GitHub now. Let people try it, and we can improve it.

Please bring my thanks to your brother, too. France is strong at algorithm development. It’s a pleasure to see it myself.

Also thank you for willing to update the README file. Please take your time.

Best wishes,

Mengyao

On Jan 18, 2014, at 10:53 AM, Slide notifications@github.com wrote:

Hi, You're welcome, it is nice to have a ssw aligner for python that is much faster that a pure python aligner. You also did a great job from your side by implementing this fast ssw aligner. Did your try the module? The work was done by my brother on it's free time and by me on my work time (INSERM UMR 1089, Nantes, France). As for the update of the readme file, I won't do it right now but just let me 2 or 3 weeks. Adrien

— Reply to this email directly or view it on GitHub.

— Reply to this email directly or view it on GitHub https://github.com/mengyao/Complete-Striped-Smith-Waterman-Library/pull/12#issuecomment-49448464 .

Wan-Ping Lee Senior Lead Scientist, R&D, Seven Bridges Genomics Inc.

https://sites.google.com/site/wanpinglee — Reply to this email directly or view it on GitHub.

a-slide commented 10 years ago

Thanks Wan-Ping, Let me know if you or one of your colleague face some issue while testing the wrapper. Regards. Adrien