diff data_manager/resource_building.py @ 34:0c0586ac3e29 draft

planemo upload commit c89c5deac442c0c2aa52b24f2c5af4b290773fc0-dirty
author dchristiany
date Mon, 28 Jan 2019 09:21:28 -0500
parents cdeffb3670c3
children b312ea6438a2
line wrap: on
line diff
--- a/data_manager/resource_building.py	Mon Jan 28 08:44:47 2019 -0500
+++ b/data_manager/resource_building.py	Mon Jan 28 09:21:28 2019 -0500
@@ -63,10 +63,10 @@
     # Define organism_id (here Human) - to be upraded when other organism added to the project
     organism_id = "2"
     # Extract sample_category_id and output filename
-    tissue=tissue.split("-")
+    tissue=tissue.split(".")
     sample_category_id = tissue[0]
-    name = tissue[1]
-    output_file = name+"_"+time.strftime("%d-%m-%Y") + ".tsv"
+    tissue_name = tissue[1]
+    output_file = tissue_name+"_"+time.strftime("%d-%m-%Y") + ".tsv"
 
     query="https://db.systemsbiology.net/sbeams/cgi/PeptideAtlas/GetProteins?&atlas_build_id="+ \
     sample_category_id+"&display_options=ShowAbundances&organism_id="+organism_id+ \
@@ -84,8 +84,8 @@
 
     #columns of data table peptide_atlas
     date = time.strftime("%d-%m-%Y")
-    tissue_id = name+"_"+date
-    tissue_name = tissue_id.replace("-","/").replace("_"," ")
+    tissue_id = tissue_name+"_"+date
+    name = tissue_id.replace("-","/").replace("_"," ")
     path = os.path.join(output_file)
 
     with open(path,"w") as out :
@@ -93,7 +93,7 @@
         w.writerow(["Uniprot_AC","nb_obs"])
         w.writerows(uni_dict.items())
         
-    data_table_entry = dict(id=tissue_id, name=tissue_name, value = path, tissue = tissue)
+    data_table_entry = dict(id=tissue_id, name=name, value = path, tissue = tissue_name)
     _add_data_table_entry(data_manager_dict, data_table_entry, "proteore_peptide_atlas")
 
 #function to count the number of observations by uniprot id