Commit Graph

38 Commits (20e072f6af4f23feebc50647eb3d351c4b866281)

Author SHA1 Message Date
zzh 20e072f6af 所有代码都合并了,还差一点建立索引的时候,一起都建立了 2024-04-02 07:42:37 +08:00
zzh 7d085962a2 开始改成sbwa那种batch模式 2024-03-07 18:23:21 +08:00
zzh 44fe799773 添加了一些注释 2023-12-24 17:23:14 +08:00
Heng Li 02a9add042 added MIT license to some non-GPL source files 2020-07-01 23:02:01 -04:00
Heng Li cd29a7cb54 r1198: exit if .alt is malformatted
Resolves #232
2019-01-23 13:28:11 -05:00
John Marshall 1972a97813 Only realloc(pac,...) if it needs to be made larger
Similarly to the realloc(pac,...) within add1(), only bother to call
realloc() if appending the reverse complemented sequence requires more
space than is currently in the pac/m_pac buffer.

Avoids realloc(pac,0) (and a "Failed to allocate 0 bytes at bntseq.c"
message from wrap_realloc()) in the corner case of an empty reference
FASTA file.  Fixes #54.
2017-05-10 19:47:12 +01:00
Heng Li 71277f0fea r896: more flexible ALT reading 2014-10-14 23:37:24 -04:00
Heng Li df20911110 r890: bns_intv2rid() may wrongly return -1 2014-10-14 14:49:53 -04:00
Heng Li 7b62fbb4ba r880: bug in writing .ann file 2014-10-02 15:34:49 -04:00
Heng Li e4ad616d43 r816: read .alt file (not tested) 2014-09-05 12:49:50 -04:00
Heng Li 35ac99b4f7 r815: optionally output ref fasta header
Also fixed a bug in reading .ann files
2014-08-29 10:51:23 -04:00
Heng Li 836d464239 r713: a bug in retrieving ref seq on rev 2014-04-14 09:55:55 -04:00
Heng Li f2b7d67ed9 output extra debugging information 2014-04-13 12:51:44 -04:00
Heng Li 8638cfadc8 dev-472: get rid of bwa_fix_xref()
This function causes all kinds of problems when the reference genome consists
of many short reads/contigs/chromsomes. Some of the problems are nearly
unfixable at the point where bwa_fix_xref() gets called. This commit attempts
to fix the problem at the root. It disallows chains spanning multiple contigs
and never retrieves sequences bridging two adjacent contigs. Thus all the
chaining, extension, SW and global alignments are confined to on contig only.

This commit brings many changes. I have tested it on a couple examples
including Peter Field's PacBio example. It works well so far.
2014-04-10 20:54:27 -04: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
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 042e1f4442 r334: added pemerge to bwa 2013-03-06 21:55:02 -05:00
Rob Davies 8a078cc16d Merge branch 'master' into master_fixes
Conflicts:
	bntseq.c
	bwamem.c
2013-03-05 10:21:07 +00:00
Heng Li d35f33b513 r316: don't allocate zero-length memory
It is not a bug, but Electric Fence does not like that.
2013-03-04 10:22:18 -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 61dd3bf13a r283: prepare for fixing cross-ref aln 2013-02-25 22:49:15 -05:00
Heng Li 5f8c6efbc3 forbid x-bounary bns_get_seq(); code backup 2013-02-16 09:48:44 -05:00
Heng Li 5a0b32bfd2 updated to the latest kseq.h 2013-02-06 14:38:40 -05:00
Heng Li 00e5302219 routine to get subsequence from 2-bit pac 2013-02-01 16:39:50 -05:00
Rob Davies 55f1b36534 New wrapper for gzclose; added err_fflush calls and made it call fsync too.
Added a new utils.c wrapper err_gzclose and changed gzclose calls to use it.

Put in some more err_fflush calls before files being written are closed.

Made err_fflush call fsync.  This is useful for remote filesystems where
errors may not be reported on fflush or fclose as problems at the server
end may only be detected after they have returned.  If bwa is being used
only to write to local filesystems, calling fsync is not really necessary.
To disable it, comment out #define FSYNC_ON_FLUSH in utils.c.
2013-01-03 16:57:37 +00:00
Rob Davies b081ac9b8b Use wrapper functions to catch system errors
Use the wrapper functions in utils.c plus a few extra bits of error
checking code to catch system errors and exit non-zero when they occur.
2012-12-16 10:34:57 +00:00
Heng Li 8f89f55484 fixed a segfault when there are too few good bases. 2011-11-17 22:13:38 -05:00
Heng Li aabb807734 concatenate for-rev sequences in the end 2011-10-25 11:22:08 -04:00
Heng Li ca809a44d9 build .pac in memory; prepare for further changes 2011-10-25 10:27:13 -04:00
Heng Li 7626595e3a backup the current debugging code; more changes 2011-10-25 10:03:57 -04:00
Heng Li 1cb409aaf2 use forward-only pac to reduce memory 2011-10-21 12:03:14 -04:00
Heng Li fe9da3c704 allow to pac forward strand only 2011-10-21 10:57:12 -04:00
Heng Li ec307a10e6 PE seems working; more testing needed 2011-10-20 17:45:41 -04:00
Heng Li 2d2db5d50f aln seems working 2011-10-20 16:13:35 -04:00
Heng Li 46123639cf removed reverse pac; bwa is not working right now 2011-10-20 12:09:35 -04:00
Heng Li 70da24e177 restructure bns_fasta2bntseq() for further changes 2011-10-20 11:53:44 -04:00
Heng Li 72563c38f3 automatically choose the algorithm for BWT 2011-06-09 17:33:25 -04:00
Heng Li 007c3eb75d Imported from my local bwa repository, the master repository. 2011-01-13 20:52:12 -05:00