From 451b855060ce8e5c20eb2f0770d535d92fa0b087 Mon Sep 17 00:00:00 2001 From: Arthur Le Bars <arthur.le-bars@sb-roscoff.fr> Date: Mon, 22 Mar 2021 10:38:23 +0100 Subject: [PATCH] localhost instance access --- gga_load_data.py | 9 +-------- run_workflow_phaeoexplorer.py | 10 ++++++---- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/gga_load_data.py b/gga_load_data.py index 2d83b83..6eac2bc 100644 --- a/gga_load_data.py +++ b/gga_load_data.py @@ -125,8 +125,6 @@ class LoadData(speciesData.SpeciesData): Create a "Project Data" library in galaxy, mirroring the "src_data" folder of the current organism directory tree - TODO - What about the interproscan, orthofinder and blast results ? - :return: """ @@ -327,10 +325,6 @@ if __name__ == "__main__": type=str, help="Where the stack containers will be located, defaults to working directory") - parser.add_argument("--load-history", - help="Load the found files into history, will ask for confirmation if a file with the same name is already found in an history", - action="store_false") - args = parser.parse_args() if args.verbose: @@ -370,8 +364,7 @@ if __name__ == "__main__": load_data_for_current_species.config = utilities.parse_config(args.config) # Set the instance url attribute -- Does not work with localhost on scratch (ALB) print(load_data_for_current_species.config["http_port"]) - load_data_for_current_species.instance_url = "http://scratchgmodv1:{0}/sp/{1}_{2}/galaxy/".format( - load_data_for_current_species.config["http_port"], + load_data_for_current_species.instance_url = "http://localhost/sp/{1}_{2}/galaxy/".format( load_data_for_current_species.genus_lowercase, load_data_for_current_species.species) diff --git a/run_workflow_phaeoexplorer.py b/run_workflow_phaeoexplorer.py index 4f73193..4125f52 100644 --- a/run_workflow_phaeoexplorer.py +++ b/run_workflow_phaeoexplorer.py @@ -157,7 +157,8 @@ class RunWorkflow(speciesData.SpeciesData): # (If it's not installed, the show_tool version returned will be a default version with the suffix "XXXX+0") if show_tool["version"] != v["tool_version"]: # If it doesn't match, proceed to install of the correct changeset revision - logging.warning("Tool versions don't match for {0} (changeset installed: {1} | changeset required: {2}). Installing changeset revision {3}...".format(v["tool_shed_repository"]["name"], show_tool["changeset_revision"], v["tool_shed_repository"]["changeset_revision"], v["tool_shed_repository"]["changeset_revision"])) + print(show_tool) + # logging.warning("Tool versions don't match for {0} (changeset installed: {1} | changeset required: {2}). Installing changeset revision {3}...".format(v["tool_shed_repository"]["name"], show_tool["changeset_revision"], v["tool_shed_repository"]["changeset_revision"], v["tool_shed_repository"]["changeset_revision"])) toolshed = "https://" + v["tool_shed_repository"]["tool_shed"] name = v["tool_shed_repository"]["name"] owner = v["tool_shed_repository"]["owner"] @@ -488,7 +489,7 @@ class RunWorkflow(speciesData.SpeciesData): # In case of the Jbrowse workflow, we unfortunately have to manually edit the parameters instead of setting them # as runtime values, using runtime parameters makes the tool throw an internal critical error ("replace not found" error) if workflow_name == "Jbrowse": - workflow_dict["steps"]["2"]["tool_state"] = workflow_dict["steps"]["2"]["tool_state"].replace("__MENU_URL__", "https://{host}:{port}/sp/{genus_sp}/feature/{Genus}/{species}/{id}".format(host=self.config["host"], port=self.config["https_port"], genus_sp=self.genus_species, Genus=self.genus_uppercase, species=self.species, id="{id}")) + workflow_dict["steps"]["2"]["tool_state"] = workflow_dict["steps"]["2"]["tool_state"].replace("__MENU_URL__", "https://{hostname}:{port}/sp/{genus_sp}/feature/{Genus}/{species}/{id}".format(hostname=self.config["hostname"], port=self.config["https_port"], genus_sp=self.genus_species, Genus=self.genus_uppercase, species=self.species, id="{id}")) # The UNIQUE_ID is specific to a combination genus_species_strain_sex so every combination should have its unique workflow # in galaxy --> define a naming method for these workflows workflow_dict["steps"]["3"]["tool_state"] = workflow_dict["steps"]["3"]["tool_state"].replace("__FULL_NAME__", self.full_name).replace("__UNIQUE_ID__", self.abbreviation) @@ -846,8 +847,7 @@ if __name__ == "__main__": # Parse the config yaml file run_workflow_for_current_organism.config = utilities.parse_config(args.config) # Set the instance url attribute --> TODO: the localhost rule in the docker-compose still doesn't work on scratchgmodv1 - run_workflow_for_current_organism.instance_url = "http://scratchgmodv1:{0}/sp/{1}_{2}/galaxy/".format( - run_workflow_for_current_organism.config["http_port"], + run_workflow_for_current_organism.instance_url = "http://localhost/sp/{1}_{2}/galaxy/".format( run_workflow_for_current_organism.genus_lowercase, run_workflow_for_current_organism.species) @@ -977,6 +977,7 @@ if __name__ == "__main__": run_workflow_for_current_organism.connect_to_instance() run_workflow_for_current_organism.set_get_history() + run_workflow_for_current_organism.install_changesets_revisions_from_workflow(workflow_path=workflow) # run_workflow_for_current_organism.get_species_history_id() # Get the attributes of the instance and project data files @@ -1017,6 +1018,7 @@ if __name__ == "__main__": run_workflow_for_current_organism.connect_to_instance() run_workflow_for_current_organism.set_get_history() + run_workflow_for_current_organism.install_changesets_revisions_from_workflow(workflow_path=workflow) # run_workflow_for_current_organism.get_species_history_id() # Get the attributes of the instance and project data files -- GitLab