# HG changeset patch # User dchristiany # Date 1547564402 18000 # Node ID d2af5a5053fd02d7f14fca80b7ce363799198f03 # Parent 85532a48e4e400c6fbc4bfa71ea19598a27e83ce planemo upload commit 8040003119a3d54866ec6ee9b9f659f2af554817-dirty diff -r 85532a48e4e4 -r d2af5a5053fd data_manager/resource_building.py --- a/data_manager/resource_building.py Tue Jan 15 07:13:52 2019 -0500 +++ b/data_manager/resource_building.py Tue Jan 15 10:00:02 2019 -0500 @@ -3,7 +3,7 @@ The purpose of this script is to create source files from different databases to be used in other proteore tools """ -import os, sys, argparse, requests, time, csv, re, json, zipfile, shutil +import os, sys, argparse, requests, time, csv, re, json, shutil from io import BytesIO from zipfile import ZipFile from galaxy.util.json import from_json_string, to_json_string @@ -308,9 +308,9 @@ shutil.rmtree("tmp_BioGRID", ignore_errors=True) #download NCBI2Reactome.txt file and build dictionary - download = requests.get('https://www.reactome.org/download/current/NCBI2Reactome.txt') - decoded_content = download.content.decode('utf-8') - tab_file = csv.reader(decoded_content.splitlines(), delimiter='\t') + r = requests.get('https://www.reactome.org/download/current/NCBI2Reactome.txt') + r.encoding ="utf-8" + tab_file = csv.reader(r.content.splitlines(), delimiter='\t') dico_nodes = {} GeneID_index=0 pathway_description_index=3 @@ -329,9 +329,9 @@ ##Bioplex elif interactome=="bioplex": - download = requests.get("http://bioplex.hms.harvard.edu/data/BioPlex_interactionList_v4a.tsv") - decoded_content = download.content.decode('utf-8') - bioplex = csv.reader(decoded_content.splitlines(), delimiter='\t') + r = requests.get("http://bioplex.hms.harvard.edu/data/BioPlex_interactionList_v4a.tsv") + r.encoding ="utf-8" + bioplex = csv.reader(r.content.splitlines(), delimiter='\t') dico_network = {} dico_network["GeneID"]={} network_geneid_cols=[0,1,4,5,8] @@ -344,9 +344,9 @@ dico_network["UniProt-AC"][line[2]]=[line[i] for i in network_uniprot_cols] dico_GeneID_to_UniProt[line[0]]=line[2] - download = requests.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 = requests.get("https://reactome.org/download/current/UniProt2Reactome.txt") + r.encoding ="utf-8" + tab_file = csv.reader(r.content.splitlines(), delimiter='\t') dico_nodes = {} uniProt_index=0 pathway_description_index=3 diff -r 85532a48e4e4 -r d2af5a5053fd data_manager/resource_building.xml --- a/data_manager/resource_building.xml Tue Jan 15 07:13:52 2019 -0500 +++ b/data_manager/resource_building.xml Tue Jan 15 10:00:02 2019 -0500 @@ -1,4 +1,4 @@ - + to create or update reference files for proteore tools