+# The default version string in bam.h and bcftools/bcf.h can be overriden directly
+# make VERSION="-DVERSION='\\\"my-version\\\"'"
+# or using the git-stamp rule
+# make git-stamp
+VERSION=
+
CC= gcc
-CFLAGS= -g -Wall -O2
+CFLAGS= -g -Wall $(VERSION) -O2
#LDFLAGS= -Wl,-rpath,\$$ORIGIN/../lib
DFLAGS= -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_USE_KNETFILE -D_CURSES_LIB=1
KNETFILE_O= knetfile.o
LIBPATH=
LIBCURSES= -lcurses # -lXCurses
+
.SUFFIXES:.c .o
.PHONY: all lib
all:$(PROG)
+git-stamp:
+ make VERSION="-DVERSION='\\\"`git describe --always --dirty`\\\"'"
+
.PHONY:all lib clean cleanlocal
.PHONY:all-recur lib-recur clean-recur cleanlocal-recur install-recur
@copyright Genome Research Ltd.
*/
-#define BAM_VERSION "0.1.19-96b5f2294a"
+#ifndef VERSION
+#define BAM_VERSION "0.1.19+"
+#else
+#define BAM_VERSION VERSION
+#endif
#include <stdint.h>
#include <stdlib.h>
// To prevent long stretches of N's to be mistaken for indels (sometimes thousands of bases),
// check the number of N's in the sequence and skip places where half or more reference bases are Ns.
int nN=0; for (i=pos; i-pos<max_rd_len && ref[i]; i++) if ( ref[i]=='N' ) nN++;
- if ( nN*2>i ) { free(aux); return -1; }
+ if ( nN*2>(i-pos) ) { free(aux); return -1; }
ks_introsort(uint32_t, m, aux);
// squeeze out identical types
#ifndef BCF_H
#define BCF_H
-#define BCF_VERSION "0.1.19-96b5f2294a"
+#ifndef VERSION
+#define BCF_VERSION "0.1.19+"
+#else
+#define BCF_VERSION VERSION
+#endif
#include <stdint.h>
#include <zlib.h>
printf("SN\treads QC failed:\t%ld\n", (long)stats->nreads_QCfailed);
printf("SN\tnon-primary alignments:\t%ld\n", (long)stats->nreads_secondary);
printf("SN\ttotal length:\t%ld\n", (long)stats->total_len);
- printf("SN\tbases mapped:\t%ld\n", (long)stats->nbases_mapped);
- printf("SN\tbases mapped (cigar):\t%ld\n", (long)stats->nbases_mapped_cigar);
+ printf("SN\tbases mapped:\t%ld\n", (long)stats->nbases_mapped); // the length of the whole read goes here, including soft-clips etc.
+ printf("SN\tbases mapped (cigar):\t%ld\n", (long)stats->nbases_mapped_cigar); // only matched and inserted bases are counted here
printf("SN\tbases trimmed:\t%ld\n", (long)stats->nbases_trimmed);
printf("SN\tbases duplicated:\t%ld\n", (long)stats->total_len_dup);
printf("SN\tmismatches:\t%ld\n", (long)stats->nmismatches);