pywfa icon indicating copy to clipboard operation
pywfa copied to clipboard

Wildcard causes segfault with pywfa installed via pip, works when installed from source

Open matthuska opened this issue 1 year ago • 3 comments

If I install pywfa using pip, I can run the example script from the README without any problems. However, if I use the wildcard option of WavefrontAligner I get a segfault:

$ diff works.py fails.py 
5c5
< a = WavefrontAligner(pattern)
---
> a = WavefrontAligner(pattern, wildcard="N")
$ python works.py
      ALIGNMENT	3M1X4M1D7M1I9M1X6M
      ALIGNMENT.COMPACT	1X1D1I1X
      PATTERN    TCTTTACTCGCGCGTT-GGAGAAATACAATAGT
                 ||| |||| ||||||| ||||||||| ||||||
      TEXT       TCTATACT-GCGCGTTTGGAGAAATAAAATAGT
$ python fails.py 
Segmentation fault

If I build from pywfa source (using the exact steps from the README), the segfault goes away and the wildcard works as expected:

$ python fails.py 
      ALIGNMENT 3M1X4M1D7M1I9M1X6M
      ETRACE    1X1D1I1X
      CIGAR     8M1D7M1I16M
      PATTERN    TCTTTACTCGCGCGTT-GGAGAAATACAATAGT
                 ||| |||| ||||||| ||||||||| ||||||
      TEXT       TCTATACT-GCGCGTTTGGAGAAATAAAATAGT

matthuska avatar Aug 15 '24 12:08 matthuska

Hi @matthuska, The pip package is out of sync with the repo and doesn't have the wildcard functionality. Ive been meaning to update the build, but have been a bit too busy lately.

kcleal avatar Aug 15 '24 21:08 kcleal

If you would be interested, I could do a small PR that sets up a GitHub action to automatically publish releases to PyPI. I use it myself and it makes doing releases a bit easier (just create the release on the GitHub web page, done).

As an example: https://github.com/rki-mf1/breakfast/blob/master/.github/workflows/release.yml

matthuska avatar Aug 16 '24 13:08 matthuska

Thanks that would be awesome. However, Im not sure that the current install script is compatible with osx-arm64, if you could add a runner that builds and tests using Ubuntu that would be great. I can try and sort out the macOS issue. The package will be released as a source distribution rather than a built wheel.

kcleal avatar Aug 16 '24 16:08 kcleal