diff --git a/gga_run_workflow_phaeo_jbrowse.py b/gga_run_workflow_phaeo_jbrowse.py index f270f66927a06706840c523131a5188d934adcaf..0591da646f2667f31b3c1ebdce984761fb8cf499 100644 --- a/gga_run_workflow_phaeo_jbrowse.py +++ b/gga_run_workflow_phaeo_jbrowse.py @@ -68,7 +68,9 @@ class RunWorkflowJbrowse(runWorkflowPhaeo.RunWorkflow): self.common = self.name if not self.common_name is None and self.common_name != "": - self.common = 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 + ")" 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) @@ -156,7 +158,9 @@ class RunWorkflowJbrowse(runWorkflowPhaeo.RunWorkflow): tool_inputs={"abbr": self.abbreviation, "genus": self.genus_uppercase, "species": self.chado_species_name, - "common": self.common}) + "common": self.common}, + time_sleep=30 + ) 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 @@ -194,7 +198,8 @@ class RunWorkflowJbrowse(runWorkflowPhaeo.RunWorkflow): if len(prj_lib) == 1: library_id = prj_lib[0].id else: - logging.error("Multiple (or no one) libraries '%s' exist" % constants.GALAXY_LIBRARY_NAME) + logging.critical("Multiple (or no one) libraries '%s' exist" % constants.GALAXY_LIBRARY_NAME) + sys.exit() folder_dict_list = self.instance.libraries.get_folders(library_id=str(library_id)) folders_id_dict = {} diff --git a/runWorkflowPhaeo.py b/runWorkflowPhaeo.py index 286a3b8f34f0f9f675c75285902267ff43860b9f..2f6503fb40ba50a51413c55b4d0e6d885dcde2a3 100644 --- a/runWorkflowPhaeo.py +++ b/runWorkflowPhaeo.py @@ -78,7 +78,9 @@ class RunWorkflow(speciesData.SpeciesData): "program": constants_phaeo.ADD_ANALYSIS_TOOL_PARAM_PROGRAM, "programversion": programversion, "sourcename": sourcename, - "date_executed": constants_phaeo.ADD_ANALYSIS_TOOL_PARAM_DATE}) + "date_executed": constants_phaeo.ADD_ANALYSIS_TOOL_PARAM_DATE}, + time_sleep = 30 + ) analysis_dict = json.loads(add_analysis_tool_dataset) analysis_id = str(analysis_dict["analysis_id"]) diff --git a/speciesData.py b/speciesData.py index 410268064509f71039a8e86f9bfd875994780580..cbe2b852ebfcebb3725e444223255c1ac256ef72 100755 --- a/speciesData.py +++ b/speciesData.py @@ -106,7 +106,7 @@ class SpeciesData: self.genus_uppercase = self.genus[0].upper() + self.genus_lowercase[1:] self.genus_species = "{0}_{1}".format(self.genus_lowercase, self.species_lowercase) - self.strain_sex = "{0}_{1}".format(self.strain_lowercase, self.sex_lowercase) + self.strain_sex = '_'.join(utilities.filter_empty_not_empty_items([self.strain_lowercase, self.sex_lowercase])["not_empty"]) self.full_name = ' '.join(utilities.filter_empty_not_empty_items([self.genus_uppercase, self.species, self.strain, self.sex])["not_empty"]) self.full_name_lowercase = self.full_name.lower() @@ -115,11 +115,7 @@ class SpeciesData: [self.genus_lowercase, self.species_lowercase, self.strain.lower(), self.sex.lower()])["not_empty"]) - self.dataset_prefix = None - if self.sex is not None or self.sex != "": - self.dataset_prefix = self.genus[0].lower() + "_" + self.species_lowercase + "_" + self.sex[0].lower() - else: - self.dataset_prefix = self.genus[0].lower() + "_" + self.species_lowercase + self.dataset_prefix = self.strain_sex self.genome_filename = "{0}_v{1}.fasta".format(self.dataset_prefix, self.genome_version) self.gff_filename = "{0}_OGS{1}_{2}.gff".format(self.dataset_prefix, self.ogs_version, constants.DATA_DATE)