diff data_manager/resource_building.py @ 40:fddf4a3847f4 draft

planemo upload commit 43e2a01d7519104c2c16510e4dbdc023e65c49c7-dirty
author dchristiany
date Tue, 29 Jan 2019 10:50:31 -0500
parents ec6252ad1a8e
children 4062484f2cee
line wrap: on
line diff
--- a/data_manager/resource_building.py	Tue Jan 29 10:25:49 2019 -0500
+++ b/data_manager/resource_building.py	Tue Jan 29 10:50:31 2019 -0500
@@ -312,8 +312,8 @@
         #download NCBI2Reactome.txt file and build dictionary
         with requests.Session() as s:
             r = s.get('https://www.reactome.org/download/current/NCBI2Reactome.txt')
-            r.encoding = r.apparent_encoding
-            tab_file = csv.reader(r.text.splitlines(), delimiter='\t')
+            r.encoding ="utf-8"
+            tab_file = csv.reader(r.content.splitlines(), delimiter='\t')
 
         dico_nodes = {}
         uniProt_index=0
@@ -356,9 +356,9 @@
             dico_GeneID_to_UniProt[line[0]]=line[2]
 
         with requests.Session() as s:
-            download = s.get('https://reactome.org/download/current/UniProt2Reactome.txt')
-            decoded_content = download.content.decode('utf-8')
-            tab_file = csv.reader(decoded_content.splitlines(), delimiter='\t')
+            r = s.get('https://reactome.org/download/current/UniProt2Reactome.txt')
+            r.encoding ="utf-8"
+            tab_file = csv.reader(r.content.splitlines(), delimiter='\t')
 
         dico_nodes_uniprot = {}
         uniProt_index=0
@@ -373,8 +373,8 @@
 
         with requests.Session() as s:
             r = s.get('https://www.reactome.org/download/current/NCBI2Reactome.txt')
-            r.encoding = r.apparent_encoding
-            tab_file = csv.reader(r.text.splitlines(), delimiter='\t')
+            r.encoding ="utf-8"
+            tab_file = csv.reader(r.content.splitlines(), delimiter='\t')
 
         dico_nodes_geneid = {}
         uniProt_index=0