comparison env/lib/python3.9/site-packages/bioblend/galaxy/tool_data/__init__.py @ 0:4f3585e2f14b draft default tip

"planemo upload commit 60cee0fc7c0cda8592644e1aad72851dec82c959"
author shellac
date Mon, 22 Mar 2021 18:12:50 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:4f3585e2f14b
1 """
2 Contains possible interactions with the Galaxy Tool data tables
3 """
4 from bioblend.galaxy.client import Client
5
6
7 class ToolDataClient(Client):
8
9 def __init__(self, galaxy_instance):
10 self.module = 'tool_data'
11 super().__init__(galaxy_instance)
12
13 def get_data_tables(self):
14 """
15 Get the list of all data tables.
16
17 :rtype: list
18 :return: A list of dicts with details on individual data tables.
19 For example::
20
21 [{"model_class": "TabularToolDataTable", "name": "fasta_indexes"},
22 {"model_class": "TabularToolDataTable", "name": "bwa_indexes"}]
23 """
24 return self._get()
25
26 def show_data_table(self, data_table_id):
27 """
28 Get details of a given data table.
29
30 :type data_table_id: str
31 :param data_table_id: ID of the data table
32
33 :rtype: dict
34 :return: A description of the given data table and its content.
35 For example::
36
37 {'columns': ['value', 'dbkey', 'name', 'path'],
38 'fields': [['test id',
39 'test',
40 'test name',
41 '/opt/galaxy-dist/tool-data/test/seq/test id.fa']],
42 'model_class': 'TabularToolDataTable',
43 'name': 'all_fasta'}
44
45 """
46 return self._get(id=data_table_id)
47
48 def reload_data_table(self, data_table_id):
49 """
50 Reload a data table.
51
52 :type data_table_id: str
53 :param data_table_id: ID of the data table
54
55 :rtype: dict
56 :return: A description of the given data table and its content.
57 For example::
58
59 {'columns': ['value', 'dbkey', 'name', 'path'],
60 'fields': [['test id',
61 'test',
62 'test name',
63 '/opt/galaxy-dist/tool-data/test/seq/test id.fa']],
64 'model_class': 'TabularToolDataTable',
65 'name': 'all_fasta'}
66 """
67 url = self._make_url(data_table_id) + '/reload'
68 return self._get(url=url)
69
70 def delete_data_table(self, data_table_id, values):
71 """
72 Delete an item from a data table.
73
74 :type data_table_id: str
75 :param data_table_id: ID of the data table
76
77 :type values: str
78 :param values: a "|" separated list of column contents, there must be a
79 value for all the columns of the data table
80
81 :rtype: dict
82 :return: Remaining contents of the given data table
83 """
84 payload = {'values': values}
85 return self._delete(payload=payload, id=data_table_id)