From 1b13e75caf667c131cffbe27ed2148ad6b8a0f5d Mon Sep 17 00:00:00 2001 From: Loraine Gueguen <loraine.gueguen@sb-roscoff.fr> Date: Mon, 31 May 2021 00:26:21 +0200 Subject: [PATCH] fix time_sleep and chado_species_name. Change common_name for org --- gga_run_workflow_phaeo_jbrowse.py | 10 ++++------ runWorkflowPhaeo.py | 6 ++---- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/gga_run_workflow_phaeo_jbrowse.py b/gga_run_workflow_phaeo_jbrowse.py index 0591da6..d3e47e1 100644 --- a/gga_run_workflow_phaeo_jbrowse.py +++ b/gga_run_workflow_phaeo_jbrowse.py @@ -7,7 +7,6 @@ import os import logging import sys import json -import time from bioblend.galaxy.objects import GalaxyInstance import utilities @@ -66,11 +65,11 @@ class RunWorkflowJbrowse(runWorkflowPhaeo.RunWorkflow): self.abbreviation = self.genus_uppercase[0] + ". " + self.chado_species_name - self.common = self.name + self.common = self.genus_uppercase + " " + self.chado_species_name if not self.common_name is None and self.common_name != "": # common_name only is not sufficient as may not be unique between the different strains of the species and - # galaxy will throw error "Found a preexisting organism with the same attributes in the database" - self.common = self.common_name + "(" + self.name + ")" + # galaxy will throw error "OrgWorkflowParam" + self.common = self.common + " (" + self.common_name + ")" self.genome_analysis_name = "genome v{0} of {1}".format(self.genome_version, self.full_name) self.genome_analysis_programversion = "genome v{0}".format(self.genome_version) @@ -159,14 +158,13 @@ class RunWorkflowJbrowse(runWorkflowPhaeo.RunWorkflow): "genus": self.genus_uppercase, "species": self.chado_species_name, "common": self.common}, - time_sleep=30 + time_sleep=10 ) organism_dict = json.loads(add_organism_tool_dataset) org_id = str(organism_dict["organism_id"]) # id needs to be a str to be recognized by chado tools # Synchronize newly added organism in Tripal logging.info("Synchronizing organism %s in Tripal" % self.full_name) - time.sleep(60) utilities_bioblend.run_tool( instance=self.instance, tool_id=constants_phaeo.ORGANISM_SYNC_TOOL_ID, diff --git a/runWorkflowPhaeo.py b/runWorkflowPhaeo.py index 2f6503f..615df0a 100644 --- a/runWorkflowPhaeo.py +++ b/runWorkflowPhaeo.py @@ -3,7 +3,6 @@ import logging import json -import time import utilities_bioblend import speciesData @@ -15,7 +14,7 @@ class OrgWorkflowParam: def __init__(self, genus_uppercase, chado_species_name, full_name, species_folder_name, org_id, history_id, instance): self.genus_uppercase = genus_uppercase - self.chado_species_name = chado_species_name, + self.chado_species_name = chado_species_name self.full_name = full_name self.species_folder_name = species_folder_name self.org_id = org_id @@ -79,7 +78,7 @@ class RunWorkflow(speciesData.SpeciesData): "programversion": programversion, "sourcename": sourcename, "date_executed": constants_phaeo.ADD_ANALYSIS_TOOL_PARAM_DATE}, - time_sleep = 30 + time_sleep = 10 ) analysis_dict = json.loads(add_analysis_tool_dataset) analysis_id = str(analysis_dict["analysis_id"]) @@ -88,7 +87,6 @@ class RunWorkflow(speciesData.SpeciesData): def sync_analysis(self, analysis_id): - time.sleep(60) utilities_bioblend.run_tool( instance=self.instance, tool_id=constants_phaeo.ANALYSIS_SYNC_TOOL_ID, -- GitLab