diff --git a/formats.py b/formats.py index 50d5b2a..0995dcd 100755 --- a/formats.py +++ b/formats.py @@ -9,6 +9,7 @@ import time import re import multiprocessing as mp +import gzip # Internal from GAPI import log @@ -851,7 +852,10 @@ def read(self, filePath): ''' Read VCF file ''' - vcfFile = open(filePath) + if str(filePath).endswith('.gz'): + vcfFile = gzip.open(filePath, 'rt') + else: + vcfFile = open(filePath) ## 1. Read VCF and differenciate between header and variant entries header = []