Mercurial > repos > shellac > sam_consensus_v3
comparison env/lib/python3.9/site-packages/bioblend/galaxy/genomes/__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 Histories | |
3 """ | |
4 from bioblend.galaxy.client import Client | |
5 | |
6 | |
7 class GenomeClient(Client): | |
8 | |
9 def __init__(self, galaxy_instance): | |
10 self.module = 'genomes' | |
11 super().__init__(galaxy_instance) | |
12 | |
13 def get_genomes(self): | |
14 """ | |
15 Returns a list of installed genomes | |
16 | |
17 :rtype: list | |
18 :return: List of installed genomes | |
19 """ | |
20 genomes = self._get() | |
21 return genomes | |
22 | |
23 def show_genome(self, id, num=None, chrom=None, low=None, high=None): | |
24 """ | |
25 Returns information about build <id> | |
26 | |
27 :type id: str | |
28 :param id: Genome build ID to use | |
29 | |
30 :type num: str | |
31 :param num: num | |
32 | |
33 :type chrom: str | |
34 :param chrom: chrom | |
35 | |
36 :type low: str | |
37 :param low: low | |
38 | |
39 :type high: str | |
40 :param high: high | |
41 | |
42 :rtype: dict | |
43 :return: Information about the genome build | |
44 """ | |
45 params = {} | |
46 if num: | |
47 params['num'] = num | |
48 if chrom: | |
49 params['chrom'] = chrom | |
50 if low: | |
51 params['low'] = low | |
52 if high: | |
53 params['high'] = high | |
54 return self._get(id, params) | |
55 | |
56 def install_genome(self, func='download', source=None, dbkey=None, | |
57 ncbi_name=None, ensembl_dbkey=None, url_dbkey=None, | |
58 indexers=None): | |
59 """ | |
60 Download and/or index a genome. | |
61 | |
62 | |
63 :type dbkey: str | |
64 :param dbkey: DB key of the build to download, ignored unless 'UCSC' is specified as the source | |
65 | |
66 :type ncbi_name: str | |
67 :param ncbi_name: NCBI's genome identifier, ignored unless NCBI is specified as the source | |
68 | |
69 :type ensembl_dbkey: str | |
70 :param ensembl_dbkey: Ensembl's genome identifier, ignored unless Ensembl is specified as the source | |
71 | |
72 :type url_dbkey: str | |
73 :param url_dbkey: DB key to use for this build, ignored unless URL is specified as the source | |
74 | |
75 :type source: str | |
76 :param source: Data source for this build. Can be: UCSC, Ensembl, NCBI, URL | |
77 | |
78 :type indexers: list | |
79 :param indexers: POST array of indexers to run after downloading (indexers[] = first, indexers[] = second, ...) | |
80 | |
81 :type func: str | |
82 :param func: Allowed values: 'download', Download and index; 'index', Index only | |
83 | |
84 :rtype: dict | |
85 :return: dict( status: 'ok', job: <job ID> ) | |
86 If error: | |
87 dict( status: 'error', error: <error message> ) | |
88 """ | |
89 payload = {} | |
90 if source: | |
91 payload['source'] = source | |
92 if func: | |
93 payload['func'] = func | |
94 if dbkey: | |
95 payload['dbkey'] = dbkey | |
96 if ncbi_name: | |
97 payload['ncbi_name'] = ncbi_name | |
98 if ensembl_dbkey: | |
99 payload['ensembl_dbkey'] = ensembl_dbkey | |
100 if url_dbkey: | |
101 payload['url_dbkey'] = url_dbkey | |
102 if indexers: | |
103 payload['indexers'] = indexers | |
104 return self._post(payload) |