Skip to content

Commit

Permalink
Bump version
Browse files Browse the repository at this point in the history
  • Loading branch information
heathsc committed Jun 3, 2019
1 parent d942713 commit 4e8df52
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 16 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ Documentation can be found at
Changelog:
----------

3.3.0 Make new release for IHEC
3.3.0 Fix bug where conversion parameters could be ignored
3.2.13 Fix formatting bug in mextr with multiple samples (not triggered in normal gemBS use)
3.2.12 Ensure that conversion statistics are correctly calculated for non-stranded or reverse conversion protocols
3.2.11 Introduce reverse_conversion option for mapping where read 1 is G2A converted and read 2 is C2T converted
Expand Down
9 changes: 4 additions & 5 deletions gemBS/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -838,11 +838,10 @@ def prepare(self, sample, input_bam, chrom_list, output_bcf, report_file, contig
if self.haploid:
parameters_bscall.append('-1')
if self.conversion != None:
if self.conversion.lower() == "auto":
if sample in self.sample_conversion:
parameters_bscall.extend(['--conversion', self.sample_conversion[sample]])
else:
parameters_bscall.extend(['--conversion', self.conversion])
if self.conversion.lower() == "auto" and sample in self.sample_conversion:
parameters_bscall.extend(['--conversion', self.sample_conversion[sample]])
else:
parameters_bscall.extend(['--conversion', self.conversion])
if self.ref_bias != None:
parameters_bscall.extend(['--reference-bias', self.ref_bias])
#Thresholds
Expand Down
1 change: 1 addition & 0 deletions gemBS/production.py
Original file line number Diff line number Diff line change
Expand Up @@ -1106,6 +1106,7 @@ def run(self,args):
if args.qual_threshold != None: com2.extend(['-Q',str(args.mapq_threshold)])
if args.right_trim != None: com2.extend(['--right-trim',str(args.right_trim)])
if args.left_trim != None: com2.extend(['--left-trim',str(args.left_trim)])
if args.conversion != None: com2.extend(['--conversion',str(args.conversion)])
if args.keep_duplicates != None: com2.append('-u')
if args.ignore_duplicates != None: com2.append('-U')
if args.keep_unmatched != None: com2.append('-k')
Expand Down
4 changes: 2 additions & 2 deletions gemBS/version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__VERSION_MAJOR = "3"
__VERSION_MINOR = "2"
__VERSION_SUBMINOR = "13"
__VERSION_MINOR = "3"
__VERSION_SUBMINOR = "0"
__VERSION__ = "%s.%s.%s" % (__VERSION_MAJOR, __VERSION_MINOR,__VERSION_SUBMINOR)
2 changes: 1 addition & 1 deletion tools/gemBS_plugins/compress.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ static void init_compress(void) {
path = DEFAULT_PATH;
for (i = 0; i < COMPRESS_NONE; i++) {
compress_data.compress_suffix[i] = strdup(suff[i]);
compress_data.comp_path[i][0] = compress_data.comp_path[i][0] = NULL;
compress_data.comp_path[i][0] = compress_data.comp_path[i][1] = NULL;
}
int ix = 0;
while(pnames[ix][0] != NULL) {
Expand Down
6 changes: 1 addition & 5 deletions tools/gemBS_plugins/mextr.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <stddef.h>
#include <locale.h>
#include <unistd.h>
#include <string.h>
#include <inttypes.h>
Expand Down Expand Up @@ -463,11 +462,10 @@ static fmt_field_t tags[] = {
bcf1_t *process(bcf1_t *rec)
{
static int idx;
static int32_t curr_rid = -1, prev_pos, mq[2];
static int32_t curr_rid = -1, prev_pos;
static bool valid[2] = {false, false};
static bcf1_t prev_rec;

(void)setlocale(LC_NUMERIC, "C");
int ns = bcf_hdr_nsamples(args.hdr);
stats_t *st = args.stats;
if(st != NULL) st->n_sites++;
Expand Down Expand Up @@ -563,8 +561,6 @@ bcf1_t *process(bcf1_t *rec)
}
}
}
mq[idx] = -1;
if(mq_p != NULL) mq[idx] = (int32_t)(0.5 + sqrt(ms_mq / (double)tot_n));
valid[idx] = true;
// Here is the logic for deciding what we print
if(rec->rid != curr_rid) curr_rid = rec->rid;
Expand Down
7 changes: 4 additions & 3 deletions tools/gemBS_plugins/output.c
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,6 @@ void output_cpg(args_t *args, bcf1_t *rec, fmt_field_t *tags, gt_meth *sample_gt
double z = 0.0;
gt_meth *g = sample_gt[idx ^ pos] + ix;
if(!g->skip) {
double m = get_meth(g, pos);
if(!pos) {
if(g->counts[5] >= args->min_nc && (g->counts[5] + g->counts[7] >= args->min_inform)) {
if(args->sel_mode == SELECT_HOM) z = exp(g->gt_prob[4]);
Expand Down Expand Up @@ -260,8 +259,9 @@ static char *rgb_tab[11] = { "0,255,0", "55,255,0", "105,255,0", "155,255,0", "2

void output_bedmethyl(args_t *args, bcf1_t *rec, fmt_field_t *tags, gt_meth *sample_gt[], int idx) {
static char *cx;
static int32_t cx_n,old_rid = 0xffffffff;
static int32_t cx_n,old_rid = 0xffffffff, old_pos = -1;

if(rec->rid == old_rid && rec->pos <= old_pos) return;
int ns = bcf_hdr_nsamples(args->hdr);
if(ns > 1) return;
gt_meth *g = sample_gt[idx];
Expand Down Expand Up @@ -310,7 +310,6 @@ void output_bedmethyl(args_t *args, bcf1_t *rec, fmt_field_t *tags, gt_meth *sam
FILE *fp = args->wigfile;
if(fp != NULL) {
if(rec->rid != old_rid) {
old_rid = rec->rid;
fprintf(fp, "variableStep chrom=%s\n", args->hdr->id[BCF_DT_CTG][rec->rid].key);
}
fprintf(fp, "%u\t%.4g\n", rec->pos + 1, 100.0 * m);
Expand All @@ -323,5 +322,7 @@ void output_bedmethyl(args_t *args, bcf1_t *rec, fmt_field_t *tags, gt_meth *sam
args->hdr->id[BCF_DT_CTG][rec->rid].key, rec->pos, rec->pos + 1, args->bedmethyl_desc, cov > 1000 ? 1000 : cov, strand,
rec->pos, rec->pos + 1, rgb_tab[(int)(m * 10.0 + 0.5)], cov, (int)(100.0 * m), rtmp, rtmp + 4, gq);
}
old_rid = rec->rid;
old_pos = rec->pos;
}
}

0 comments on commit 4e8df52

Please sign in to comment.