diff --git a/gga_init.py b/gga_init.py index 660fff5e87a8f75c9b40c50860ee080cef514257..18daf6e816231f95f199755f5b423319a6c960e0 100755 --- a/gga_init.py +++ b/gga_init.py @@ -63,7 +63,7 @@ class DeploySpeciesStack(speciesData.SpeciesData): if "banner_path" in self.config.keys(): if not config["banner_path"] == "" and os.path.isfile(os.path.abspath(config["banner_path"])): try: - logging.debug("Custom banner path: %s" % self.config["banner_path"]) + logging.info("Custom banner path: %s" % self.config["banner_path"]) shutil.copy(os.path.abspath(self.config["banner_path"]), "%s/banner.png" % self.species_dir) except FileNotFoundError: logging.warning("Could not copy specified banner (%s), using default banner instead" % self.config["banner_path"]) @@ -80,13 +80,13 @@ class DeploySpeciesStack(speciesData.SpeciesData): try: shutil.copy(os.path.join(self.script_dir, "files/nginx_download.conf"), os.path.abspath("./nginx/conf/default.conf")) except Exception as exc: - logging.critical("Could not copy nginx configuration file for %s" % self.full_name) + logging.critical("Could not copy nginx configuration file for %s %s", self.genus, self.species) logging.critical(exc) # Return to main directory os.chdir(self.main_dir) - logging.info("Directory tree generated for %s" % self.full_name) + logging.info("Directory tree generated for %s %s", self.genus, self.species) def make_compose_files(self): @@ -391,29 +391,16 @@ if __name__ == "__main__": # Parse the config yaml file deploy_stack_for_current_organism.config = config - # # Set the instance url attribute - # for env_variable, value in deploy_stack_for_current_organism.config.items(): - # if env_variable == "hostname": - # deploy_stack_for_current_organism.instance_url = value + \ - # deploy_stack_for_current_organism.genus_lowercase + \ - # "_" + deploy_stack_for_current_organism.species + \ - # "/galaxy/" - # break - # else: - # deploy_stack_for_current_organism.instance_url = "http://localhost:8888/sp/{0}_{1}/galaxy/".format( - # deploy_stack_for_current_organism.genus_lowercase, - # deploy_stack_for_current_organism.species) - # Starting - logging.info("gga_init.py called for %s" % deploy_stack_for_current_organism.full_name) + logging.info("gga_init.py called for %s %s", deploy_stack_for_current_organism.genus, deploy_stack_for_current_organism.species) # Make/update directory tree deploy_stack_for_current_organism.make_directory_tree() - logging.info("Successfully generated the directory tree for %s" % deploy_stack_for_current_organism.full_name) + logging.info("Successfully generated the directory tree for %s %s", deploy_stack_for_current_organism.genus, deploy_stack_for_current_organism.species) # Make compose files deploy_stack_for_current_organism.make_compose_files() - logging.info("Successfully generated the docker-compose files for %s" % deploy_stack_for_current_organism.full_name) + logging.info("Successfully generated the docker-compose files for %s %s", deploy_stack_for_current_organism.genus, deploy_stack_for_current_organism.species) logging.info("Deploying stacks") if args.force_traefik: diff --git a/templates/organisms.yml.j2 b/templates/organisms.yml.j2 index ff71547f2972b9271c085fea7b791c9c31556894..83ab58f9ab4bb3282af991df6ad0c50c952725f5 100644 --- a/templates/organisms.yml.j2 +++ b/templates/organisms.yml.j2 @@ -6,6 +6,9 @@ strain: {{ strain }} common_name: {{ common_name }} origin: {{ origin }} + {% if main_species is defined and main_species is sameas true %} + main_species: yes + {% endif %} data: genome_path: {{ genome_path }} transcripts_path: {{ transcripts_path }} diff --git a/utilities.py b/utilities.py index d6b8504c65a98749c311de30847f793a6c574d43..7145430649978020832bc302779390be7241ca78 100755 --- a/utilities.py +++ b/utilities.py @@ -166,7 +166,7 @@ def get_unique_species_dict_list(sp_dict_list): for sp in sp_dict_list: for gspecies in unique_species_genus_species: - if gspecies not in unique_species_dict.keys(): + if gspecies not in unique_species_dict.keys() or sp[0]["description"]["main_sp"] == "yes" : unique_species_dict[gspecies] = sp else: continue