comparison data_manager/resource_building.py @ 26:bf6940ff60a8 draft

planemo upload commit 0290724216a2c445b4e28842153b84a1b28f4e9a-dirty
author proteore
date Thu, 16 May 2019 07:29:01 -0400
parents 6cbb76823b7b
children 9a400ce8e4e6
comparison
equal deleted inserted replaced
25:6e36dd9abcb5 26:bf6940ff60a8
51 51
52 output_file = tissue +"_"+ time.strftime("%d-%m-%Y") + ".tsv" 52 output_file = tissue +"_"+ time.strftime("%d-%m-%Y") + ".tsv"
53 path = os.path.join(target_directory, output_file) 53 path = os.path.join(target_directory, output_file)
54 unzip(url, path) #download and save file 54 unzip(url, path) #download and save file
55 tissue_name = tissue_name + " " + time.strftime("%d/%m/%Y") 55 tissue_name = tissue_name + " " + time.strftime("%d/%m/%Y")
56 tissue_id = tissue_name.replace(" ","_").replace("/","-") 56 release = tissue_name.replace(" ","_").replace("/","-")
57 57 id = str(10000000000 - int(time.strftime("%Y%m%d")))
58 58
59 data_table_entry = dict(id=tissue_id, name = tissue_name, tissue = tissue, value = path) 59
60 data_table_entry = dict(id=id, release=release, name = tissue_name, tissue = tissue, value = path)
60 _add_data_table_entry(data_manager_dict, data_table_entry, table) 61 _add_data_table_entry(data_manager_dict, data_table_entry, table)
61 62
62 63
63 ####################################################################################################### 64 #######################################################################################################
64 # 2. Peptide Atlas 65 # 2. Peptide Atlas
499 500
500 #writing output 501 #writing output
501 output_file = species+'_'+interactome+'_'+ time.strftime("%d-%m-%Y") + ".json" 502 output_file = species+'_'+interactome+'_'+ time.strftime("%d-%m-%Y") + ".json"
502 path = os.path.join(target_directory,output_file) 503 path = os.path.join(target_directory,output_file)
503 name = species+" ("+species_dict[species]+") "+time.strftime("%d/%m/%Y") 504 name = species+" ("+species_dict[species]+") "+time.strftime("%d/%m/%Y")
504 id = species+"_"+interactome+"_"+ time.strftime("%d-%m-%Y") 505 release = species+"_"+interactome+"_"+ time.strftime("%d-%m-%Y")
506 id = str(10000000000 - int(time.strftime("%Y%m%d")))
505 507
506 with open(path, 'w') as handle: 508 with open(path, 'w') as handle:
507 json.dump(dico, handle, sort_keys=True) 509 json.dump(dico, handle, sort_keys=True)
508 510
509 data_table_entry = dict(id=id, name = name, species = species, value = path) 511 data_table_entry = dict(id=id, release=release, name = name, species = species, value = path)
510 _add_data_table_entry(data_manager_dict, data_table_entry, "proteore_"+interactome+"_dictionaries") 512 _add_data_table_entry(data_manager_dict, data_table_entry, "proteore_"+interactome+"_dictionaries")
511 513
512 ####################################################################################################### 514 #######################################################################################################
513 # 5. nextprot (add protein features) 515 # 5. nextprot (add protein features)
514 ####################################################################################################### 516 #######################################################################################################