Commit Graph

56 Commits (96e445d9e43e7d4a4cb32a1681098a6e7a170561)

Author SHA1 Message Date
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
Rob Davies 90ecd344ba Merge branch 'master' into master_fixes. Merged up to master r375.
Conflicts:
	bwt.c
2013-04-11 11:15:39 +01:00
Heng Li 53bb846407 r373: optionally distable mate rescue 2013-04-09 16:13:55 -04:00
Rob Davies c862a1a396 Merge branch 'master' into master_fixes 2013-03-18 13:35:12 +00:00
Heng Li e5355fe3a0 r364: bug in mem pairing (no effect with -A=1)
Forgot to adjust for matching score. This bug has no effect when -A takes the
default value.
2013-03-14 22:01:26 -04:00
Rob Davies cca27c1ef5 Merge branch 'master' into master_fixes
Conflicts:
	bwamem.c
	bwamem_pair.c
	example.c
2013-03-13 12:12:28 +00:00
Heng Li aa7cdf4bb3 r361: flag proper pair even if multi-primary
Up to here, all the features in my checklist have been implemented.
2013-03-12 00:00:04 -04:00
Heng Li 6c665189ad r359: identical output to 0.7.2 (without -a) 2013-03-11 23:16:18 -04:00
Heng Li 26f4c704ed drop the old SAM writer 2013-03-11 22:24:54 -04:00
Heng Li 0b0455ca51 replace PE; BUGGY right now!! 2013-03-11 22:18:23 -04:00
Rob Davies 9228e48efd Merge branch 'master' into master_fixes
Conflicts:
	Makefile
2013-03-11 13:50:49 +00:00
Heng Li 2d01a297fb Improving 'properly paired' flag.
If one end has a low quality tail that happens to have a score-20 hit,
the pair won't be flagged as properly paired because bwa-mem thought it has
multiple hits. By filtering with -T, we won't have this problem.
2013-03-09 18:05:50 -05:00
Heng Li 274c0ac96c r343: bugfix in mem - wrong mate info for unmap
SAM generation is always among the nastiest bits. I would need to refactor at
some point (hardly happening).
2013-03-08 12:40:31 -05:00
Rob Davies aabd990e8f Merge branch 'master' into master_fixes
Conflicts:
	Makefile
	bwape.c
	bwase.c
	bwtsw2_aux.c
	stdaln.c
2013-03-08 16:46:45 +00:00
Heng Li b5b50ac8da r341: bugfix - wrong mate position
when one end is mapped with a score less than -T. Caused by the -T option.
2013-03-07 21:35:57 -05:00
Rob Davies 3d33ab063e Merge branch 'master' into master_fixes
Merged to master version b621d3a

Conflicts:
	Makefile
	bntseq.c
	bwa.c
	bwase.c
	bwaseqio.c
	bwtaln.c
	bwtindex.c
	bwtio.c
	bwtmisc.c
	bwtsw2_aux.c
	cs2nt.c
	fastmap.c
	khash.h
	kseq.h
	ksw.c
	kvec.h
	simple_dp.c
	utils.c
	utils.h
2013-03-01 09:37:46 +00:00
Heng Li e70c7c2a71 r284: amend cross-reference hit
I really hate this: complex and twisted logic for a nasty scenario that almost
never happens to short reads - but it may become serious when the reference
genome consists of many contigs.

On toy examples, the code seems to work. Don't know if it really works...
2013-02-26 00:03:49 -05:00
Heng Li 20aa848b3c r279: for PE mapq, consider the number of pairs
If there are a lot of proper pairs, it is more likely that the best pair is
wrong.
2013-02-25 13:00:35 -05:00
Heng Li 9957e04590 r278: don't perform too many mate-sw 2013-02-25 11:56:02 -05:00
Heng Li ee59a13109 simplified bwamem.h
Hide mem_seed_t and mem_chain_t. Don't expose unnecessary routines.
2013-02-24 12:17:29 -05:00
Heng Li b4c38bcc1c append fasta/q comment 2013-02-23 16:57:34 -05:00
Heng Li 17c123d65a pring paired-end SAM 2013-02-22 16:38:48 -05:00
Heng Li ba15b787cb rework PE mapq; don't know if better 2013-02-22 14:47:57 -05:00
Heng Li 6c1a113753 mate-SW for all high-scoring hits 2013-02-22 13:26:23 -05:00
Heng Li 38fc5c8822 reduce mapQ when a read is moved 2013-02-22 12:54:42 -05:00
Heng Li 6a16edc15e tuning PE mapQ 2013-02-22 12:47:26 -05:00
Heng Li c0093264de wrong logic: paired mapQ should <q_pe 2013-02-22 12:34:46 -05:00
Heng Li c5ce72f593 scoring pairs by score, not by errors
This is important for bwa-mem which does local alignment. A short exact match
is worse than a long inexact match. Also fixed a bug in approximating mapping
quality.
2013-02-22 12:10:20 -05:00
Heng Li ed08d08f36 fixed bugs caused by interger overflow 2013-02-22 11:17:31 -05:00
Heng Li dfc63acc11 bugfix: another ">" vs. "<" bug
That hurts, as I am going to reverse all these again!
2013-02-22 11:06:36 -05:00
Heng Li d5820177c6 bugfix: wrong mate-sw qry coor for rev 2013-02-22 11:02:14 -05:00
Heng Li 81fe6f8e38 bugfix: a typo leading to wrong pairing 2013-02-22 10:57:07 -05:00
Heng Li 58e4cc207f bugfix: 1) fill seedcov; 2) pairing not working 2013-02-21 21:26:01 -05:00
Heng Li a9cae8c9af minor changes 2013-02-21 10:39:17 -05:00
Heng Li 41624fb347 bugfix: choosing the worse instead of the best 2013-02-20 20:43:22 -05:00
Heng Li ea8f4f4d34 clean bill from valgrind 2013-02-20 20:26:57 -05:00
Heng Li 5626fe29b7 Well, at least output sth 2013-02-20 19:11:44 -05:00
Heng Li 688872fb1b code backup 2013-02-19 00:50:39 -05:00
Heng Li 66585b7982 code backup 2013-02-18 16:33:06 -05:00
Heng Li f0a6285aba perform mate-SW for some suboptimal alignments 2013-02-16 11:52:04 -05:00
Heng Li ea9fc7df48 keep the number of SW performed 2013-02-16 11:03:27 -05:00
Heng Li 8ee464478a matesw working; for testing only 2013-02-16 10:48:50 -05:00
Heng Li fe2236f6fe code backup 2013-02-16 10:09:30 -05:00
Heng Li 5f8c6efbc3 forbid x-bounary bns_get_seq(); code backup 2013-02-16 09:48:44 -05:00
Heng Li df1ff2b36e better and proper way to infer orinentation 2013-02-14 12:59:32 -05:00
Heng Li 688b524cdf code backup; tired.. 2013-02-13 23:55:56 -05:00
Heng Li 87d619a21f minor code simplification 2013-02-13 23:16:16 -05:00
Heng Li 604e3d8da1 code backup; to upgrade ksw.{c,h} 2013-02-12 16:15:26 -05:00
Heng Li 2fc469d0c9 code backup 2013-02-12 12:09:36 -05:00
Heng Li e5ab59db53 Multiple changes:
1. Removed bwa.{h,c}. I am not going to finish them anyway.
2. Updated to the latest khash.h, which should be faster.
3. Define 64-bit vector and 128-bit integer/vector in utils.h.
2013-02-12 09:50:28 -05:00