Exemplo n.º 1
0
def gi(port, key=None):
    """Return a bioblend ``GalaxyInstance`` for Galaxy on this port."""
    ensure_module()
    if key is None:
        key = DEFAULT_MASTER_API_KEY
    return galaxy.GalaxyInstance(url="http://localhost:%d" % int(port),
                                 key=key)
Exemplo n.º 2
0
 def export_workflow_file(self):
     """Copy or extract workflow file and add it to the tutorial directory."""
     if not os.path.exists(self.wf_dir):
         os.makedirs(self.wf_dir)
     if self.init_wf_fp:
         shutil.copy(self.init_wf_fp, self.wf_fp)
     elif self.init_wf_id:
         gi = galaxy.GalaxyInstance(self.training.galaxy_url,
                                    key=self.training.galaxy_api_key)
         gi.workflows.export_workflow_to_local_path(
             self.init_wf_id, self.wf_fp, use_default_filename=False)
Exemplo n.º 3
0
def gi(port=None, url=None, key=None):
    """Return a bioblend ``GalaxyInstance`` for Galaxy on this port."""
    ensure_module()
    if key is None:
        key = DEFAULT_ADMIN_API_KEY
    if port is None:
        url = url
    else:
        url = "http://localhost:%d" % int(port)

    return galaxy.GalaxyInstance(url=url, key=key)
Exemplo n.º 4
0
 def export_workflow_file(self):
     """Copy or extract workflow file and add it to the tutorial directory."""
     if not os.path.exists(self.wf_dir):
         os.makedirs(self.wf_dir)
     if not os.path.exists(os.path.join(self.wf_dir, 'index.md')):
         with open(os.path.join(self.wf_dir, 'index.md'), 'w') as handle:
             handle.write('---\nlayout: workflow-list\n---\n')
     if self.init_wf_fp:
         shutil.copy(self.init_wf_fp, self.wf_fp)
     elif self.init_wf_id:
         gi = galaxy.GalaxyInstance(self.training.galaxy_url,
                                    key=self.training.galaxy_api_key)
         gi.workflows.export_workflow_to_local_path(
             self.init_wf_id, self.wf_fp, use_default_filename=False)
Exemplo n.º 5
0
def get_hands_on_boxes_from_running_galaxy(wf_id, galaxy_url, galaxy_api_key):
    """Get the workflow dictionary from a running Galaxy instance with the workflow installed on it."""
    gi = galaxy.GalaxyInstance(galaxy_url, key=galaxy_api_key)
    wf = gi.workflows.export_workflow_dict(wf_id)
    tuto_body = format_wf_steps(wf, gi)
    return tuto_body
Exemplo n.º 6
0
 def gi(self):
     ensure_module(galaxy)
     return galaxy.GalaxyInstance(url="http://localhost:%d" % self.port,
                                  key=self.master_api_key)