Skip to content
Snippets Groups Projects
Commit 1b13e75c authored by Loraine Gueguen's avatar Loraine Gueguen
Browse files

fix time_sleep and chado_species_name. Change common_name for org

parent eae273b9
No related branches found
No related tags found
2 merge requests!24Run wf,!18Release v2.1.0
This commit is part of merge request !18. Comments created here will be created in the context of that merge request.
...@@ -7,7 +7,6 @@ import os ...@@ -7,7 +7,6 @@ import os
import logging import logging
import sys import sys
import json import json
import time
from bioblend.galaxy.objects import GalaxyInstance from bioblend.galaxy.objects import GalaxyInstance
import utilities import utilities
...@@ -66,11 +65,11 @@ class RunWorkflowJbrowse(runWorkflowPhaeo.RunWorkflow): ...@@ -66,11 +65,11 @@ class RunWorkflowJbrowse(runWorkflowPhaeo.RunWorkflow):
self.abbreviation = self.genus_uppercase[0] + ". " + self.chado_species_name 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 != "": 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 # 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" # galaxy will throw error "OrgWorkflowParam"
self.common = self.common_name + "(" + self.name + ")" 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_name = "genome v{0} of {1}".format(self.genome_version, self.full_name)
self.genome_analysis_programversion = "genome v{0}".format(self.genome_version) self.genome_analysis_programversion = "genome v{0}".format(self.genome_version)
...@@ -159,14 +158,13 @@ class RunWorkflowJbrowse(runWorkflowPhaeo.RunWorkflow): ...@@ -159,14 +158,13 @@ class RunWorkflowJbrowse(runWorkflowPhaeo.RunWorkflow):
"genus": self.genus_uppercase, "genus": self.genus_uppercase,
"species": self.chado_species_name, "species": self.chado_species_name,
"common": self.common}, "common": self.common},
time_sleep=30 time_sleep=10
) )
organism_dict = json.loads(add_organism_tool_dataset) 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 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 # Synchronize newly added organism in Tripal
logging.info("Synchronizing organism %s in Tripal" % self.full_name) logging.info("Synchronizing organism %s in Tripal" % self.full_name)
time.sleep(60)
utilities_bioblend.run_tool( utilities_bioblend.run_tool(
instance=self.instance, instance=self.instance,
tool_id=constants_phaeo.ORGANISM_SYNC_TOOL_ID, tool_id=constants_phaeo.ORGANISM_SYNC_TOOL_ID,
......
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
import logging import logging
import json import json
import time
import utilities_bioblend import utilities_bioblend
import speciesData import speciesData
...@@ -15,7 +14,7 @@ class OrgWorkflowParam: ...@@ -15,7 +14,7 @@ class OrgWorkflowParam:
def __init__(self, genus_uppercase, chado_species_name, full_name, species_folder_name, def __init__(self, genus_uppercase, chado_species_name, full_name, species_folder_name,
org_id, history_id, instance): org_id, history_id, instance):
self.genus_uppercase = genus_uppercase 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.full_name = full_name
self.species_folder_name = species_folder_name self.species_folder_name = species_folder_name
self.org_id = org_id self.org_id = org_id
...@@ -79,7 +78,7 @@ class RunWorkflow(speciesData.SpeciesData): ...@@ -79,7 +78,7 @@ class RunWorkflow(speciesData.SpeciesData):
"programversion": programversion, "programversion": programversion,
"sourcename": sourcename, "sourcename": sourcename,
"date_executed": constants_phaeo.ADD_ANALYSIS_TOOL_PARAM_DATE}, "date_executed": constants_phaeo.ADD_ANALYSIS_TOOL_PARAM_DATE},
time_sleep = 30 time_sleep = 10
) )
analysis_dict = json.loads(add_analysis_tool_dataset) analysis_dict = json.loads(add_analysis_tool_dataset)
analysis_id = str(analysis_dict["analysis_id"]) analysis_id = str(analysis_dict["analysis_id"])
...@@ -88,7 +87,6 @@ class RunWorkflow(speciesData.SpeciesData): ...@@ -88,7 +87,6 @@ class RunWorkflow(speciesData.SpeciesData):
def sync_analysis(self, analysis_id): def sync_analysis(self, analysis_id):
time.sleep(60)
utilities_bioblend.run_tool( utilities_bioblend.run_tool(
instance=self.instance, instance=self.instance,
tool_id=constants_phaeo.ANALYSIS_SYNC_TOOL_ID, tool_id=constants_phaeo.ANALYSIS_SYNC_TOOL_ID,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment