From a74523a68d77cf0d1b76b3de0a05b90af43eea10 Mon Sep 17 00:00:00 2001 From: Heng Li Date: Thu, 9 Jun 2011 17:17:13 -0400 Subject: [PATCH] increase maximum barcode length limit to 63bp --- bwaseqio.c | 4 ++-- bwtaln.h | 4 +++- main.c | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/bwaseqio.c b/bwaseqio.c index 94271b9..12ac765 100644 --- a/bwaseqio.c +++ b/bwaseqio.c @@ -149,8 +149,8 @@ bwa_seq_t *bwa_read_seq(bwa_seqio_t *bs, int n_needed, int *n, int mode, int tri int n_seqs, l, i, is_comp = mode&BWA_MODE_COMPREAD, is_64 = mode&BWA_MODE_IL13, l_bc = mode>>24; long n_trimmed = 0, n_tot = 0; - if (l_bc > 15) { - fprintf(stderr, "[%s] the maximum barcode length is 15.\n", __func__); + if (l_bc > BWA_MAX_BCLEN) { + fprintf(stderr, "[%s] the maximum barcode length is %d.\n", __func__, BWA_MAX_BCLEN); return 0; } if (bs->is_bam) return bwa_read_bam(bs, n_needed, n, is_comp, trim_qual); // l_bc has no effect for BAM input diff --git a/bwtaln.h b/bwtaln.h index f659ac8..02f54f7 100644 --- a/bwtaln.h +++ b/bwtaln.h @@ -22,6 +22,8 @@ #define BWA_AVG_ERR 0.02 #define BWA_MIN_RDLEN 35 // for read trimming +#define BWA_MAX_BCLEN 63 // maximum barcode length; 127 is the maximum + #ifndef bns_pac #define bns_pac(pac, k) ((pac)[(k)>>2] >> ((~(k)&3)<<1) & 3) #endif @@ -75,7 +77,7 @@ typedef struct { // for multi-threading only int tid; // barcode - char bc[16]; // null terminated; up to 15 bases + char bc[BWA_MAX_BCLEN+1]; // null terminated; up to BWA_MAX_BCLEN bases // NM and MD tags uint32_t full_len:20, nm:12; char *md; diff --git a/main.c b/main.c index 4f70bb5..b22552e 100644 --- a/main.c +++ b/main.c @@ -4,7 +4,7 @@ #include "utils.h" #ifndef PACKAGE_VERSION -#define PACKAGE_VERSION "0.5.9-r18-dev" +#define PACKAGE_VERSION "0.5.9-r19-dev" #endif static int usage()