-
Notifications
You must be signed in to change notification settings - Fork 240
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
69 changed files
with
2,731 additions
and
394 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
/* bam_sample.c -- group data by sample. | ||
Copyright (C) 2010, 2011 Broad Institute. | ||
Copyright (C) 2013, 2016 Genome Research Ltd. | ||
Copyright (C) 2013, 2016-2018 Genome Research Ltd. | ||
Author: Heng Li <[email protected]>, Petr Danecek <[email protected]> | ||
|
@@ -167,10 +167,14 @@ int bam_smpl_add_bam(bam_smpl_t *bsmpl, char *bam_hdr, const char *fname) | |
void *bam_smpls = khash_str2int_init(); | ||
int first_smpl = -1, nskipped = 0; | ||
const char *p = bam_hdr, *q, *r; | ||
while ((q = strstr(p, "@RG")) != 0) | ||
while (p != NULL && (q = strstr(p, "@RG")) != 0) | ||
{ | ||
char *eol = strchr(q + 3, '\n'); | ||
if (q > bam_hdr && *(q - 1) != '\n') { // @RG must be at start of line | ||
p = eol; | ||
continue; | ||
} | ||
p = q + 3; | ||
r = q = 0; | ||
if ((q = strstr(p, "\tID:")) != 0) q += 4; | ||
if ((r = strstr(p, "\tSM:")) != 0) r += 4; | ||
if (r && q) | ||
|
@@ -220,7 +224,7 @@ int bam_smpl_add_bam(bam_smpl_t *bsmpl, char *bam_hdr, const char *fname) | |
} | ||
else | ||
break; | ||
p = q > r ? q : r; | ||
p = eol; | ||
} | ||
int nsmpls = khash_str2int_size(bam_smpls); | ||
khash_str2int_destroy_free(bam_smpls); | ||
|
@@ -234,6 +238,7 @@ int bam_smpl_add_bam(bam_smpl_t *bsmpl, char *bam_hdr, const char *fname) | |
{ | ||
// no suitable read group is available in this bam: ignore the whole file. | ||
free(file->fname); | ||
if ( file->rg2idx ) khash_str2int_destroy_free(file->rg2idx); | ||
bsmpl->nfiles--; | ||
return -1; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,13 +23,14 @@ | |
# DEALINGS IN THE SOFTWARE. | ||
|
||
dnl Process this file with autoconf to produce a configure script | ||
AC_INIT([BCFtools], m4_esyscmd_s([make print-version]), | ||
AC_INIT([BCFtools], m4_esyscmd_s([./version.sh 2>/dev/null]), | ||
[[email protected]], [], [http://www.htslib.org/]) | ||
AC_PREREQ([2.63]) dnl This version introduced 4-argument AC_CHECK_HEADER | ||
AC_CONFIG_SRCDIR([main.c]) | ||
AC_CONFIG_HEADERS([config.h]) | ||
|
||
m4_include([m4/ax_with_htslib.m4]) | ||
m4_include([m4/hts_prog_cc_warnings.m4]) | ||
|
||
dnl Copyright notice to be copied into the generated configure script | ||
AC_COPYRIGHT([Portions copyright (C) 2015,2017 Genome Research Ltd. | ||
|
@@ -39,6 +40,12 @@ redistribute it. There is NO WARRANTY, to the extent permitted by law.]) | |
|
||
AC_PROG_CC | ||
|
||
dnl Turn on compiler warnings, if possible | ||
HTS_PROG_CC_WARNINGS | ||
dnl Flags to treat warnings as errors. These need to be applied to CFLAGS | ||
dnl later as they can interfere with some of the tests (notably AC_SEARCH_LIBS) | ||
HTS_PROG_CC_WERROR(hts_late_cflags) | ||
|
||
AC_SYS_LARGEFILE | ||
|
||
AC_ARG_ENABLE([bcftools-plugins], | ||
|
@@ -214,10 +221,11 @@ AS_IF([test "$enable_perl_filters" != "no" ], [dnl | |
PERL_LIBS="`perl -MExtUtils::Embed -e ldopts`" | ||
AC_SUBST([PERL_CCOPTS]) | ||
AC_SUBST([PERL_LIBS]) | ||
USE_GPL=1 | ||
AC_SUBST([USE_GPL]) | ||
]) | ||
|
||
dnl Apply value from HTS_PROG_CC_WERROR (if set) | ||
AS_IF([test "x$hts_late_cflags" != x],[CFLAGS="$CFLAGS $hts_late_cflags"]) | ||
|
||
AC_CONFIG_FILES([config.mk]) | ||
AC_OUTPUT | ||
|
||
|
Oops, something went wrong.