Mercurial > repos > guerler > springsuite
comparison planemo/lib/python3.7/site-packages/bioblend/galaxy/__init__.py @ 0:d30785e31577 draft
"planemo upload commit 6eee67778febed82ddd413c3ca40b3183a3898f1"
author | guerler |
---|---|
date | Fri, 31 Jul 2020 00:18:57 -0400 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:d30785e31577 |
---|---|
1 """ | |
2 A base representation of an instance of Galaxy | |
3 """ | |
4 from bioblend.galaxy import (config, datasets, datatypes, folders, forms, | |
5 ftpfiles, genomes, groups, histories, | |
6 invocations, jobs, libraries, quotas, roles, | |
7 tool_data, tools, toolshed, users, visual, | |
8 workflows) | |
9 from bioblend.galaxy.client import Client | |
10 from bioblend.galaxyclient import GalaxyClient | |
11 | |
12 | |
13 class GalaxyInstance(GalaxyClient): | |
14 def __init__(self, url, key=None, email=None, password=None, verify=True): | |
15 """ | |
16 A base representation of a connection to a Galaxy instance, identified | |
17 by the server URL and user credentials. | |
18 | |
19 After you have created a ``GalaxyInstance`` object, access various | |
20 modules via the class fields. For example, to work with histories and | |
21 get a list of all the user's histories, the following should be done:: | |
22 | |
23 from bioblend import galaxy | |
24 | |
25 gi = galaxy.GalaxyInstance(url='http://127.0.0.1:8000', key='your_api_key') | |
26 | |
27 hl = gi.histories.get_histories() | |
28 | |
29 :type url: str | |
30 :param url: A FQDN or IP for a given instance of Galaxy. For example: | |
31 http://127.0.0.1:8080 . If a Galaxy instance is served under | |
32 a prefix (e.g., http://127.0.0.1:8080/galaxy/), supply the | |
33 entire URL including the prefix (note that the prefix must | |
34 end with a slash). If a Galaxy instance has HTTP Basic | |
35 authentication with username and password, then the | |
36 credentials should be included in the URL, e.g. | |
37 http://user:pass@host:port/galaxy/ | |
38 | |
39 :type key: str | |
40 :param key: User's API key for the given instance of Galaxy, obtained | |
41 from the user preferences. If a key is not supplied, an | |
42 email address and password must be and the key will | |
43 automatically be created for the user. | |
44 | |
45 :type email: str | |
46 :param email: Galaxy e-mail address corresponding to the user. | |
47 Ignored if key is supplied directly. | |
48 | |
49 :type password: str | |
50 :param password: Password of Galaxy account corresponding to the above | |
51 e-mail address. Ignored if key is supplied directly. | |
52 | |
53 :param verify: Whether to verify the server's TLS certificate | |
54 :type verify: bool | |
55 """ | |
56 super().__init__(url, key, email, password, verify=verify) | |
57 self.libraries = libraries.LibraryClient(self) | |
58 self.histories = histories.HistoryClient(self) | |
59 self.workflows = workflows.WorkflowClient(self) | |
60 self.invocations = invocations.InvocationClient(self) | |
61 self.datasets = datasets.DatasetClient(self) | |
62 self.users = users.UserClient(self) | |
63 self.genomes = genomes.GenomeClient(self) | |
64 self.tools = tools.ToolClient(self) | |
65 self.toolshed = toolshed.ToolShedClient(self) | |
66 self.toolShed = self.toolshed # historical alias | |
67 self.config = config.ConfigClient(self) | |
68 self.visual = visual.VisualClient(self) | |
69 self.quotas = quotas.QuotaClient(self) | |
70 self.groups = groups.GroupsClient(self) | |
71 self.roles = roles.RolesClient(self) | |
72 self.datatypes = datatypes.DatatypesClient(self) | |
73 self.jobs = jobs.JobsClient(self) | |
74 self.forms = forms.FormsClient(self) | |
75 self.ftpfiles = ftpfiles.FTPFilesClient(self) | |
76 self.tool_data = tool_data.ToolDataClient(self) | |
77 self.folders = folders.FoldersClient(self) | |
78 | |
79 @property | |
80 def max_get_attempts(self): | |
81 return Client.max_get_retries() | |
82 | |
83 @max_get_attempts.setter | |
84 def max_get_attempts(self, v): | |
85 Client.set_max_get_retries(v) | |
86 | |
87 @property | |
88 def get_retry_delay(self): | |
89 return Client.get_retry_delay() | |
90 | |
91 @get_retry_delay.setter | |
92 def get_retry_delay(self, v): | |
93 Client.set_get_retry_delay(v) | |
94 | |
95 def __repr__(self): | |
96 """ | |
97 A nicer representation of this GalaxyInstance object | |
98 """ | |
99 return "GalaxyInstance object for Galaxy at {0}".format(self.base_url) |