Mercurial > repos > proteore > proteore_data_manager
comparison data_manager/resource_building.py @ 21:026177e4ff4b draft
planemo upload commit e05ccbf13c33b97ab441e2f8bc4b5bc746a378df-dirty
| author | proteore |
|---|---|
| date | Tue, 07 May 2019 10:17:48 -0400 |
| parents | 29cf75c83618 |
| children | 4296fb613d9d |
comparison
equal
deleted
inserted
replaced
| 20:29cf75c83618 | 21:026177e4ff4b |
|---|---|
| 240 w = csv.writer(out,delimiter='\t') | 240 w = csv.writer(out,delimiter='\t') |
| 241 w.writerows(tab) | 241 w.writerows(tab) |
| 242 | 242 |
| 243 name_dict={"Human" : "Homo sapiens", "Mouse" : "Mus musculus", "Rat" : "Rattus norvegicus"} | 243 name_dict={"Human" : "Homo sapiens", "Mouse" : "Mus musculus", "Rat" : "Rattus norvegicus"} |
| 244 name = species +" (" + name_dict[species]+" "+time.strftime("%d/%m/%Y")+")" | 244 name = species +" (" + name_dict[species]+" "+time.strftime("%d/%m/%Y")+")" |
| 245 id = str(10000000000 - int(time.strftime("%d%m%Y"))) | 245 release = species+"_id_mapping_"+ time.strftime("%d-%m-%Y") |
| 246 | 246 id = str(10000000000 - int(time.strftime("%d%m%Y"))) #new ids must be inferior to previous id -> sort by <filter> in xml only in descending order |
| 247 data_table_entry = dict(id=id, name = name, species = species, value = path) | 247 |
| 248 data_table_entry = dict(id=id, release=release , name = name, species = species, value = path) | |
| 248 _add_data_table_entry(data_manager_dict, data_table_entry, "proteore_id_mapping_"+species) | 249 _add_data_table_entry(data_manager_dict, data_table_entry, "proteore_id_mapping_"+species) |
| 249 | 250 |
| 250 def download_from_uniprot_ftp(file,target_directory) : | 251 def download_from_uniprot_ftp(file,target_directory) : |
| 251 ftp_dir = "pub/databases/uniprot/current_release/knowledgebase/idmapping/by_organism/" | 252 ftp_dir = "pub/databases/uniprot/current_release/knowledgebase/idmapping/by_organism/" |
| 252 path = os.path.join(target_directory, file) | 253 path = os.path.join(target_directory, file) |
