diff --git a/gga_load_data.py b/gga_load_data.py index f4e08189d1572252f33a00ebb5e2117a053fefe7..726b4e907594cfefccca98f1a5edc846b5aa27e8 100755 --- a/gga_load_data.py +++ b/gga_load_data.py @@ -86,8 +86,8 @@ class LoadData(speciesData.SpeciesData): logging.info("Creating new %s library" % constants.GALAXY_LIBRARY_NAME) prj_lib = gio.libraries.create(constants.GALAXY_LIBRARY_NAME, constants.GALAXY_LIBRARY_DESC) - self.library_id = prj_lib.id # project data folder/library - logging.info("Library for {0}: {1}".format(self.full_name, self.library_id)) + library_id = prj_lib.id # project data folder/library + logging.info("Library for {0}: {1}".format(self.full_name, library_id)) for fname, files in folders.items(): if fname and files: diff --git a/gga_run_workflow_phaeo_jbrowse.py b/gga_run_workflow_phaeo_jbrowse.py index e6eada5c8c400269852bffa4d0df1ad83ea58998..b7a9a24e91385c3bda8532ff7045e166d0a366ba 100644 --- a/gga_run_workflow_phaeo_jbrowse.py +++ b/gga_run_workflow_phaeo_jbrowse.py @@ -8,6 +8,7 @@ import logging import sys import json import time +from bioblend.galaxy.objects import GalaxyInstance import utilities import utilities_bioblend @@ -185,7 +186,16 @@ class RunWorkflowJbrowse(runWorkflowPhaeo.RunWorkflow): transcripts_hda_id = None proteins_hda_id = None - folder_dict_list = self.instance.libraries.get_folders(library_id=str(self.library_id)) + gio = GalaxyInstance(url=self.instance_url, + email=self.config[constants.CONF_GALAXY_DEFAULT_ADMIN_EMAIL], + password=self.config[constants.CONF_GALAXY_DEFAULT_ADMIN_PASSWORD] + ) + prj_lib = gio.libraries.get_previews(constants.GALAXY_LIBRARY_NAME) + 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) + folder_dict_list = self.instance.libraries.get_folders(library_id=str(library_id)) folders_id_dict = {} diff --git a/speciesData.py b/speciesData.py index 3d41670c502a329fce16e62670c3ad78752a32de..410268064509f71039a8e86f9bfd875994780580 100755 --- a/speciesData.py +++ b/speciesData.py @@ -140,4 +140,3 @@ class SpeciesData: self.instance = None self.history_id = None self.history_name = str(self.genus_species) - self.library_id = None