From c137dff7107ccefa336cd6f0c7189a1fd61d3c1f Mon Sep 17 00:00:00 2001 From: miguelpmachado Date: Mon, 25 Nov 2019 14:07:50 +0000 Subject: [PATCH] Python2 compatibility --- ReMatCh/modules/rematch_module.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ReMatCh/modules/rematch_module.py b/ReMatCh/modules/rematch_module.py index e17743d..3991266 100644 --- a/ReMatCh/modules/rematch_module.py +++ b/ReMatCh/modules/rematch_module.py @@ -318,7 +318,10 @@ def create_vcf(bam_file, sequence_to_analyse, outdir, counter, reference_file): # Read vcf file class Vcf: def __init__(self, vcf_file, encoding=None, newline=None): - self.vcf = open(vcf_file, 'rt', encoding=encoding, newline=newline) + try: + self.vcf = open(vcf_file, 'rt', encoding=encoding, newline=newline) + except TypeError: + self.vcf = open(vcf_file, 'rt') self.line_read = self.vcf.readline() self.contigs_info_dict = {} while self.line_read.startswith('#'):