Skip to content

Commit

Permalink
Merge pull request #96 from dpryan79/issue83
Browse files Browse the repository at this point in the history
  • Loading branch information
dpryan79 authored May 23, 2020
2 parents f331162 + dfa5206 commit 59df03c
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
3 changes: 2 additions & 1 deletion MBias.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)"' > $@
Expand Down
3 changes: 3 additions & 0 deletions common.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand All @@ -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;
Expand Down

0 comments on commit 59df03c

Please sign in to comment.