Commit Graph

14 Commits (5c43a1fdc9dbdf141200c1b2353d5c3502426433)

Author SHA1 Message Date
Rob Davies 5c43a1fdc9 Removed more dependencies on utils.h
bamlite.c now includes some wrappers for gzopen/gzread/gzclose that print
messages when errors occur.  They do not attempt to quit the program but
pass on the return code.  bwaseqio.c now checks the return codes from
bam_open, bam_close and bam_read1.

Code in bwt_gen.c now checks for IO errors itself instead of using the
wrappers.  A benefit of this is it can now say which file had a problem.

Removed call to err_fatal_simple in is_bwt and unnecessary inclusion of
malloc_wrap.h in ksw.h.
2013-05-03 11:38:48 +01:00
Rob Davies 96e445d9e4 Reduce dependency on utils.h - new malloc wrapping scheme.
Remove xmalloc, xcalloc, xrealloc and xstrdup from utils.h and revert calls
to the normal malloc, calloc, realloc, strdup.  Add new files malloc_wrap.[ch]
with the wrapper functions.  malloc_wrap.h #defines malloc etc. to the
wrapper, but only if USE_MALLOC_WRAPPERS has been defined.

Put #include "malloc_wrap.h" in any file that uses *alloc or strdup.  This
is also in a #ifdef USE_MALLOC_WRAPPERS ... #endif block to make using the
wrappers optional.  Add -DUSE_MALLOC_WRAPPERS into the makefile so they
should normally get added.

This is an improvement on the previous method as we now don't need to
worry about stray function calls that were not changed to the wrapped version
and the code will still work even if the wrapping is disabled.

Other possible methods of doing this are using malloc_hook (glibc-specific),
adding -include malloc_wrap.h to the gcc command-line (somewhat
gcc-specific) or making our own malloc function and using dlopen (scary).
This way is probably the most portable.
2013-05-02 15:12:01 +01:00
Heng Li 3d8a8c1e37 r374: fix - clipping penalty not always working
This only happens to gaps where mem underestimates the bandwidth without
considering the clipping penalty.
2013-04-10 01:09:37 -04:00
Heng Li e0991d6a45 r323: added Z-dropoff, a variant of blast's X-drop 2013-03-05 00:34:33 -05:00
Heng Li 59bc9341f6 code backup; more changes coming later 2013-03-04 17:29:07 -05:00
Heng Li 64d92d26df more documentation in ksw.h 2013-02-27 21:40:46 -05:00
Heng Li 4bb0bdddca r306: introduce clipping penalty
More clipping leads to more severe reference bias. We should not clip the
alignment unless necessary.
2013-02-27 21:13:39 -05:00
Heng Li 28a7d501f2 updated to the latest ksw; NOT TESTED YET!!! 2013-02-12 16:35:05 -05:00
Heng Li d8e4d57956 Don't use narrow band.
I may retry this feature if the profilter indicates that this greatly helps.
2013-02-07 21:22:54 -05:00
Heng Li d91e320972 towards reimplementing banded NW alignment 2013-02-05 12:06:56 -05:00
Heng Li 788e9d1e3d fixed a couple of leaks; buggy atm 2013-02-04 15:40:26 -05:00
Heng Li ba18db1a9f sw extension works for the simplest case 2013-02-04 12:37:38 -05:00
Heng Li e8a1962efe code backup; it is wrong 2013-02-03 17:25:40 -05:00
Heng Li c8c79ef024 mate rescue seems working (not MT) 2011-11-06 16:20:40 -05:00