From bf26a66571b4b615cd0539755c21344987ed24ba Mon Sep 17 00:00:00 2001 From: johnbraisted Date: Thu, 7 Mar 2024 15:19:12 -0500 Subject: [PATCH] tweak to RheaParser.py for uniprot TrEMBL gzip during file fetch --- src/parse/RheaParser.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/parse/RheaParser.py b/src/parse/RheaParser.py index be4f9e2..89f9959 100644 --- a/src/parse/RheaParser.py +++ b/src/parse/RheaParser.py @@ -182,7 +182,12 @@ def getRheaFiles(self): rhea2UniprotUrl = uniprotToRheaConf.sourceURL rhea2UniprotRemoteFile = uniprotToRheaConf.sourceFileName - self.download_files(rhea2UniprotUrl, self.relDir + localDir + rhea2UniprotRemoteFile) + self.download_files(rhea2UniprotUrl, self.relDir + localDir + rhea2UniprotRemoteFile) + swissProtLocalFileName = uniprotToRheaConf.extractFileName + # now gunzip + with gzip.open(self.relDir + localDir + rhea2UniprotRemoteFile, 'rb') as f_in: + with open(self.relDir + localDir + swissProtLocalFileName, 'wb') as f_out: + shutil.copyfileobj(f_in, f_out) else: print("Using cached Rhea Uniprot-to-Rhea file.")