Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Various collected fixes (updated versions of several existing PRs) #139

Merged
merged 11 commits into from
Jul 30, 2017

Conversation

jmarshall
Copy link
Contributor

@jmarshall jmarshall commented Jun 28, 2017

Hi Heng,

To facilitate merging I've collected and tidied up a number of pull requests into one larger PR. With one exception, these are just build and minor bug fixes and a README cleanup. For various of the proposed PRs, I've analysed the underlying problem and come up with what I believe is the best fix.

This PR supersedes the following:

And adds some new minor fixes:

This one is a small piece of new functionality:

Thanks for considering this.

jmarshall and others added 8 commits April 25, 2017 13:51
The u_int32_t type comes from <sys/types.h>, which is often included
as a byproduct of other headers on glibc platforms, but not on FreeBSD
or Alpine Linux.  Use <stdint.h>'s uint32_t instead, which is used
elsewhere in bwa source code.
Fixes compilation on non-glibc platforms, e.g., FreeBSD and Alpine Linux.
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 lh3#54.
[Based on PR lh3#37 with the additions below.]

Don't free non-malloced items in BWTFree().  If BWTCreate() is ever
called with a non-NULL decodeTable, BWTFree() will need to not free
decodeTable -- see FIXME comment.

Close packedFile in BWTIncConstructFromPacked() in the normal case.
Ignore it in error cases, as they immediately call exit() anyway.
In the bwa.c and bwase.c calls, rlen is an int64_t returned from
bns_get_seq() and is the number of reference bases covered by the
alignment; l_query/len is an int and the query length of the alignment;
and the result is an int given to an int parameter of ksw_global[2]().

As even the result is int and as rlen is effectively bounded by the
maximum length of a reference sequence, we maintain the status quo in
this code and simply cast rlen to int to silence Clang's "use llabs()"
(llabs() would not be a great answer given an int64_t anyway).

The bwtsw2_pair.c call needs to remain fabs() so both divisions are
done in floating point; cast to double to prevent Clang suggesting
changing the call to integer abs().
As -o is still free in the mem command, use that standard option to
specify an output file (and keep -f to parallel bwase/bwape commands).
Document it in the usage and man page.
Correct header formatting, fix some typos in headers
jmarshall and others added 3 commits June 29, 2017 15:36
This counter is only used in a log message.  Fixes lh3#131.
FASTQ files containing NULs are invalid but should not cause bwa to
crash, as it does if the quality line contains a NUL.  Fixes lh3#122.
[Andreas Tille]
Check exact number of arguments of bwtupdate
Fix spelling

[Fabian Klötzl]
change printing as size_t is unsigned
@lh3 lh3 merged commit 0976272 into lh3:master Jul 30, 2017
@jmarshall jmarshall deleted the fixes branch July 31, 2017 11:15
luispedro added a commit to ngless-toolkit/ngless that referenced this pull request Jul 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

incorrect use of abs intrinsic
5 participants