diff data_manager/resource_building.py @ 43:3febf3d1139a draft

planemo upload commit 9b701c1faf8be4835b4e7236780ee9ee26f9a373-dirty
author dchristiany
date Thu, 31 Jan 2019 08:40:52 -0500
parents 5a37a086c9a8
children 80fc0b28e227
line wrap: on
line diff
--- a/data_manager/resource_building.py	Tue Jan 29 11:08:07 2019 -0500
+++ b/data_manager/resource_building.py	Thu Jan 31 08:40:52 2019 -0500
@@ -59,14 +59,14 @@
 #######################################################################################################
 # 2. Peptide Atlas
 #######################################################################################################
-def peptide_atlas_sources(data_manager_dict, tissue, target_directory):
+def peptide_atlas_sources(data_manager_dict, tissue, date, target_directory):
     # 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(".")
     sample_category_id = tissue[0]
     tissue_name = tissue[1]
-    output_file = tissue_name+"_"+time.strftime("%d-%m-%Y") + ".tsv"
+    output_file = tissue_name+"_"+date + ".tsv"
 
     query="https://db.systemsbiology.net/sbeams/cgi/PeptideAtlas/GetProteins?&atlas_build_id="+ \
     sample_category_id+"&display_options=ShowAbundances&organism_id="+organism_id+ \
@@ -81,7 +81,6 @@
     uni_dict = build_dictionary(cr)
 
     #columns of data table peptide_atlas
-    date = time.strftime("%d-%m-%Y")
     tissue_id = tissue_name+"_"+date
     name = tissue_id.replace("-","/").replace("_"," ")
     path = os.path.join(target_directory,output_file)
@@ -418,6 +417,7 @@
     parser.add_argument("--id_mapping", metavar = ("ID_MAPPING_SPECIES"))
     parser.add_argument("--interactome", metavar = ("PPI"))
     parser.add_argument("--species")
+    parser.add_argument("--date")
     parser.add_argument("-o", "--output")
     args = parser.parse_args()
 
@@ -442,13 +442,14 @@
     ## Download source file from Peptide Atlas query
     try:
         peptide_atlas = args.peptideatlas
+        date = args.date
     except NameError:
         peptide_atlas = None
     if peptide_atlas is not None:
         #target_directory = "/projet/galaxydev/galaxy/tools/proteore/ProteoRE/tools/resources_building/test-data/"
         peptide_atlas = peptide_atlas.split(",")
         for pa_tissue in peptide_atlas:
-            peptide_atlas_sources(data_manager_dict, pa_tissue, target_directory)
+            peptide_atlas_sources(data_manager_dict, pa_tissue, date, target_directory)
 
     ## Download ID_mapping source file from Uniprot
     try: