Mercurial > repos > proteore > proteore_data_manager
comparison data_manager/resource_building.py @ 14:3f9ba522bfe8 draft
planemo upload commit 272d182247f4fa55a928ec8cdcb83eab50c7f6ef
| author | proteore |
|---|---|
| date | Wed, 17 Apr 2019 10:23:25 -0400 |
| parents | 098693479a9d |
| children | 5f39d3ef5fe3 |
comparison
equal
deleted
inserted
replaced
| 13:098693479a9d | 14:3f9ba522bfe8 |
|---|---|
| 512 writer = csv.writer(output,delimiter="\t") | 512 writer = csv.writer(output,delimiter="\t") |
| 513 | 513 |
| 514 | 514 |
| 515 | 515 |
| 516 nextprot_file=[["NextprotID","MW","SeqLength","IsoPoint","Chr","SubcellLocations","Diseases","TMDomains","ProteinExistence"]] | 516 nextprot_file=[["NextprotID","MW","SeqLength","IsoPoint","Chr","SubcellLocations","Diseases","TMDomains","ProteinExistence"]] |
| 517 writer.writerows(nextprot_file) | |
| 518 | |
| 517 for id in ids : | 519 for id in ids : |
| 518 #print (id) | 520 #print (id) |
| 519 query="https://api.nextprot.org/entry/"+id+".json" | 521 query="https://api.nextprot.org/entry/"+id+".json" |
| 520 resp = requests.get(url=query) | 522 resp = requests.get(url=query) |
| 521 data = resp.json() | 523 data = resp.json() |
| 558 for tm in tm_domains : | 560 for tm in tm_domains : |
| 559 all_tm_domains.add(tm['cvTermName']) | 561 all_tm_domains.add(tm['cvTermName']) |
| 560 nb_domains+=1 | 562 nb_domains+=1 |
| 561 # print "nb domains ++" | 563 # print "nb domains ++" |
| 562 # print (nb_domains) | 564 # print (nb_domains) |
| 563 | 565 nextprot_file.clear() |
| 564 nextprot_file.append([id,mass_mol,str(seq_length),iso_elec_point,chr_loc,all_subcell_locs,all_diseases,str(nb_domains),protein_existence]) | 566 nextprot_file.append([id,mass_mol,str(seq_length),iso_elec_point,chr_loc,all_subcell_locs,all_diseases,str(nb_domains),protein_existence]) |
| 565 writer.writerows(nextprot_file) | 567 writer.writerows(nextprot_file) |
| 566 | 568 |
| 567 data_table_entry = dict(id=id, name = name, value = path) | 569 data_table_entry = dict(id=id, name = name, value = path) |
| 568 _add_data_table_entry(data_manager_dict, data_table_entry, "proteore_nextprot_ref") | 570 _add_data_table_entry(data_manager_dict, data_table_entry, "proteore_nextprot_ref") |
