Martinsos / edlib

Lightweight, super fast C/C++ (& Python) library for sequence alignment using edit (Levenshtein) distance.
http://martinsos.github.io/edlib
MIT License
492 stars 162 forks source link

Documentation outdated (v1.1.2 vs v1.2.7) #220

Open sodiumnitrate opened 9 months ago

sodiumnitrate commented 9 months ago

Hi, As far as I can see, the only documentation for the C API is for v1.1.2. There seem to be key differences between these two versions, notably the two extra fields in the edlibAlignConfig struct.

Old documentation says to do something like:

EdlibAlignResult result = edlibAlign("ACGTTAC", 7, "CGTTAG", 6, edlibNewAlignConfig(-1, EDLIB_MODE_SHW, EDLIB_TASK_PATH));

while this gives an error in v1.2.7:

error: too few arguments to function ‘EdlibAlignConfig edlibNewAlignConfig(int, EdlibAlignMode, EdlibAlignTask, const EdlibEqualityPair*, int)’
    9 |                                     edlibNewAlignConfig(-1, EDLIB_MODE_SHW, EDLIB_TASK_PATH));
      |                                     ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

In file included from src/edlib_test.cpp:3:
src/edlib/include/edlib.h:146:32: note: declared here
  146 |     EDLIB_API EdlibAlignConfig edlibNewAlignConfig(
      |                                ^~~~~~~~~~~~~~~~~~~

The following works:

EdlibAlignResult result = edlibAlign("ACGTTAC", 7, "CGTTAG", 6, edlibNewAlignConfig(-1, EDLIB_MODE_SHW, EDLIB_TASK_PATH, NULL, 0));

While the code is commented quite well that I was able to figure it out quickly, I just wanted to note it here in case others are stuck. Of course, updating the docs would be ideal, but I understand it takes time.