From f0d735cefbbb42c9b1fda6e0df5f80b64a27b1c9 Mon Sep 17 00:00:00 2001 From: Devon Ryan Date: Fri, 22 May 2020 21:53:14 +0200 Subject: [PATCH 1/3] Bump version --- MBias.c | 1 + Makefile | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/MBias.c b/MBias.c index 05f08b6..e6f8cad 100644 --- a/MBias.c +++ b/MBias.c @@ -301,6 +301,7 @@ int mbias_main(int argc, char *argv[]) { config.keepCpG = 1; config.keepCHG = 0; config.keepCHH = 0; config.minMapq = 10; config.minPhred = 5; config.keepDupes = 0; config.keepSingleton = 0, config.keepDiscordant = 0; + config.filterMappability = 0; config.fp = NULL; config.bai = NULL; diff --git a/Makefile b/Makefile index 1fc8815..8d884a8 100644 --- a/Makefile +++ b/Makefile @@ -11,7 +11,7 @@ CFLAGS ?= -Wall -g -O3 -pthread all: MethylDackel OBJS = common.o bed.o svg.o pileup.o extract.o MBias.o mergeContext.o perRead.o -VERSION = 0.5.0 +VERSION = 0.5.1 version.h: echo '#define VERSION "$(VERSION)"' > $@ From ba5eb8e9317498aa8de929224e175e4c260bbebc Mon Sep 17 00:00:00 2001 From: Devon Ryan Date: Fri, 22 May 2020 21:54:27 +0200 Subject: [PATCH 2/3] Fix #93 and bump to 0.5.1 --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1a95f1e..d2cb819 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +Version 0.5.1: + + * Fixed an issue in `MethylDackel mbias` due to an uninitialized value (issue #93). + Version 0.5.0: * Fixed an issue with the `--cytosine_report` option where the reported chromosome name could be wrong IF the input BAM files were very sparse and multiple threads were used. (issue #88) From dfa5206333594df00f6c6d87e68510b090166b9a Mon Sep 17 00:00:00 2001 From: Devon Ryan Date: Sat, 23 May 2020 09:42:02 +0200 Subject: [PATCH 3/3] Prevent out of bounds memory usage --- MBias.c | 2 +- common.c | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/MBias.c b/MBias.c index e6f8cad..c062e8d 100644 --- a/MBias.c +++ b/MBias.c @@ -58,7 +58,7 @@ void *extractMBias(void *foo) { Config *config = (Config*) foo; bam_hdr_t *hdr; bam_mplp_t iter; - int ret, tid, pos, i, seqlen, rv, o = 0; + int ret, tid, pos = 0, i, seqlen, rv, o = 0; int32_t bedIdx = 0; int strand; int n_plp; //This will need to be modified for multiple input files diff --git a/common.c b/common.c index 6ab7c9c..740ce95 100644 --- a/common.c +++ b/common.c @@ -47,6 +47,7 @@ void print_version() { } inline int isCpG(char *seq, int pos, int seqlen) { + if(pos >= seqlen) return 0; if(*(seq+pos) == 'C' || *(seq+pos) == 'c') { if(pos+1 == seqlen) return 0; if(*(seq+pos+1) == 'G' || *(seq+pos+1) == 'g') return 1; @@ -60,6 +61,7 @@ inline int isCpG(char *seq, int pos, int seqlen) { } inline int isCHG(char *seq, int pos, int seqlen) { + if(pos >= seqlen) return 0; if(*(seq+pos) == 'C' || *(seq+pos) == 'c') { if(pos+2 >= seqlen) return 0; if(*(seq+pos+2) == 'G' || *(seq+pos+2) == 'g') return 1; @@ -73,6 +75,7 @@ inline int isCHG(char *seq, int pos, int seqlen) { } inline int isCHH(char *seq, int pos, int seqlen) { + if(pos >= seqlen) return 0; if(*(seq+pos) == 'C' || *(seq+pos) == 'c') return 1; else if(*(seq+pos) == 'G' || *(seq+pos) == 'g') return -1; return 0;