This PR adds a test program for calculate_clair3_full_alignment() for the purposes of debugging any potential memory issues in the function.
Using valgrind with the full Python entrypoint throws lots of noise that can be difficult to filter: its simpler and easier to write a standalone C program to inspect errors. The program does nothing more than read inputs and run the function. I produced sample inputs but dumping the contents of the CFFI pointer to file immediately before the function call in Python. There are some hardcoded values in the C program which I believe are universal.
I quick test shows some invalid reads triggered in the Levenshtein distance code. I haven't yet looked entirely at the cause of all of these: a few I believe are caused when the read has a deletion at the location of the variant. I could certainly reduce the number of invalid reads by adding some guards to the calling of the function.
This PR adds a test program for
calculate_clair3_full_alignment()
for the purposes of debugging any potential memory issues in the function.Using valgrind with the full Python entrypoint throws lots of noise that can be difficult to filter: its simpler and easier to write a standalone C program to inspect errors. The program does nothing more than read inputs and run the function. I produced sample inputs but dumping the contents of the CFFI pointer to file immediately before the function call in Python. There are some hardcoded values in the C program which I believe are universal.
I quick test shows some invalid reads triggered in the Levenshtein distance code. I haven't yet looked entirely at the cause of all of these: a few I believe are caused when the read has a deletion at the location of the variant. I could certainly reduce the number of invalid reads by adding some guards to the calling of the function.