Mercurial > repos > proteore > proteore_data_manager
comparison data_manager/resource_building.py @ 9:cdd29444e0af draft
planemo upload commit 71363136045353f422ff98219c1eb84f6fc6193a-dirty
| author | proteore |
|---|---|
| date | Tue, 12 Mar 2019 06:40:37 -0400 |
| parents | d5badf9de1b0 |
| children | ac2cd728c40e |
comparison
equal
deleted
inserted
replaced
| 8:d5badf9de1b0 | 9:cdd29444e0af |
|---|---|
| 426 r = s.get('http://proteincomplexes.org/static/downloads/nodeTable.txt') | 426 r = s.get('http://proteincomplexes.org/static/downloads/nodeTable.txt') |
| 427 r = r.content.decode('utf-8') | 427 r = r.content.decode('utf-8') |
| 428 humap_nodes = csv.reader(r.splitlines(), delimiter=',') | 428 humap_nodes = csv.reader(r.splitlines(), delimiter=',') |
| 429 | 429 |
| 430 dico_geneid_to_gene_name={} | 430 dico_geneid_to_gene_name={} |
| 431 dico_protein_name={} | |
| 431 for line in humap_nodes : | 432 for line in humap_nodes : |
| 432 if check_entrez_geneid(line[4]): | 433 if check_entrez_geneid(line[4]): |
| 433 if line[4] not in dico_geneid_to_gene_name: | 434 if line[4] not in dico_geneid_to_gene_name: |
| 434 dico_geneid_to_gene_name[line[4]]=line[3] | 435 dico_geneid_to_gene_name[line[4]]=line[3] |
| 435 | 436 if line[4] not in dico_protein_name: |
| 437 dico_protein_name[line[4]]=line[5] | |
| 438 | |
| 436 with requests.Session() as s: | 439 with requests.Session() as s: |
| 437 r = s.get('http://proteincomplexes.org/static/downloads/pairsWprob.txt') | 440 r = s.get('http://proteincomplexes.org/static/downloads/pairsWprob.txt') |
| 438 r = r.content.decode('utf-8') | 441 r = r.content.decode('utf-8') |
| 439 humap = csv.reader(r.splitlines(), delimiter='\t') | 442 humap = csv.reader(r.splitlines(), delimiter='\t') |
| 440 | 443 |
| 475 | 478 |
| 476 dico={} | 479 dico={} |
| 477 dico['network']=dico_network | 480 dico['network']=dico_network |
| 478 dico['nodes']=dico_nodes | 481 dico['nodes']=dico_nodes |
| 479 dico['gene_name']=dico_geneid_to_gene_name | 482 dico['gene_name']=dico_geneid_to_gene_name |
| 483 dico['protein_name']=dico_protein_name | |
| 480 | 484 |
| 481 #writing output | 485 #writing output |
| 482 output_file = species+'_'+interactome+'_'+ time.strftime("%d-%m-%Y") + ".json" | 486 output_file = species+'_'+interactome+'_'+ time.strftime("%d-%m-%Y") + ".json" |
| 483 path = os.path.join(target_directory,output_file) | 487 path = os.path.join(target_directory,output_file) |
| 484 name = species+" ("+species_dict[species]+") "+time.strftime("%d/%m/%Y") | 488 name = species+" ("+species_dict[species]+") "+time.strftime("%d/%m/%Y") |
