comparison CSP2/CSP2_env/env-d9b9114564458d9d-741b3de822f2aaca6c6caa4325c4afce/lib/python3.8/site-packages/mygene-3.2.2.dist-info/METADATA @ 69:33d812a61356

planemo upload commit 2e9511a184a1ca667c7be0c6321a36dc4e3d116d
author jpayne
date Tue, 18 Mar 2025 17:55:14 -0400
parents
children
comparison
equal deleted inserted replaced
67:0e9998148a16 69:33d812a61356
1 Metadata-Version: 2.1
2 Name: mygene
3 Version: 3.2.2
4 Summary: Python Client for MyGene.Info services.
5 Home-page: https://github.com/biothings/mygene.py
6 Author: Chunlei Wu, Cyrus Afrasiabi, Sebastien Lelong
7 Author-email: cwu@scripps.edu
8 License: BSD
9 Keywords: biology gene annotation web service client api
10 Platform: UNKNOWN
11 Classifier: Programming Language :: Python
12 Classifier: Programming Language :: Python :: 2
13 Classifier: Programming Language :: Python :: 2.7
14 Classifier: Programming Language :: Python :: 3
15 Classifier: Programming Language :: Python :: 3.4
16 Classifier: Programming Language :: Python :: 3.5
17 Classifier: Programming Language :: Python :: 3.6
18 Classifier: Programming Language :: Python :: 3.7
19 Classifier: Programming Language :: Python :: 3.8
20 Classifier: Programming Language :: Python :: 3.9
21 Classifier: Development Status :: 5 - Production/Stable
22 Classifier: License :: OSI Approved :: BSD License
23 Classifier: Operating System :: POSIX
24 Classifier: Operating System :: MacOS :: MacOS X
25 Classifier: Operating System :: Microsoft :: Windows
26 Classifier: Operating System :: OS Independent
27 Classifier: Intended Audience :: Science/Research
28 Classifier: Intended Audience :: Developers
29 Classifier: Topic :: Utilities
30 Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
31 Requires-Dist: biothings-client (>=0.2.6)
32
33 .. image:: https://pepy.tech/badge/mygene
34 :target: https://pepy.tech/project/mygene
35
36 .. image:: https://img.shields.io/pypi/dm/mygene.svg
37 :target: https://pypistats.org/packages/mygene
38
39 .. image:: https://badge.fury.io/py/mygene.svg
40 :target: https://pypi.org/project/mygene/
41
42 .. image:: https://img.shields.io/pypi/pyversions/mygene.svg
43 :target: https://pypi.org/project/mygene/
44
45 .. image:: https://img.shields.io/pypi/format/mygene.svg
46 :target: https://pypi.org/project/mygene/
47
48 .. image:: https://img.shields.io/pypi/status/mygene.svg
49 :target: https://pypi.org/project/mygene/
50
51 Intro
52 =====
53
54 MyGene.Info_ provides simple-to-use REST web services to query/retrieve gene annotation data.
55 It's designed with simplicity and performance emphasized. ``mygene``, is an easy-to-use Python
56 wrapper to access MyGene.Info_ services.
57
58 .. _MyGene.Info: http://mygene.info
59 .. _biothings_client: https://pypi.org/project/biothings-client/
60 .. _mygene: https://pypi.org/project/mygene/
61
62 Since v3.1.0, mygene_ Python package has become a thin wrapper of underlying biothings_client_ package,
63 a universal Python client for all `BioThings APIs <http://biothings.io>`_, including MyGene.info_.
64 The installation of mygene_ will install biothings_client_ automatically. The following code snippets
65 are essentially equivalent:
66
67
68 * Continue using mygene_ package
69
70 .. code-block:: python
71
72 In [1]: import mygene
73 In [2]: mg = mygene.MyGeneInfo()
74
75 * Use biothings_client_ package directly
76
77 .. code-block:: python
78
79 In [1]: from biothings_client import get_client
80 In [2]: mg = get_client('gene')
81
82 After that, the use of ``mg`` instance is exactly the same, e.g. the usage examples below.
83
84 Requirements
85 ============
86 python >=2.7 (including python3)
87
88 (Python 2.6 might still work, but it's not supported any more since v3.1.0.)
89
90 biothings_client_ (>=0.2.0, install using "pip install biothings_client")
91
92 Optional dependencies
93 ======================
94 `pandas <http://pandas.pydata.org>`_ (install using "pip install pandas") is required for
95 returning a list of gene objects as `DataFrame <http://pandas.pydata.org/pandas-docs/stable/dsintro.html#dataframe>`_.
96
97 Installation
98 =============
99
100 Option 1
101 pip install mygene
102
103 Option 2
104 download/extract the source code and run::
105
106 python setup.py install
107
108 Option 3
109 install the latest code directly from the repository::
110
111 pip install -e git+https://github.com/biothings/mygene.py#egg=mygene
112
113 Version history
114 ===============
115
116 `CHANGES.txt <https://raw.githubusercontent.com/SuLab/mygene.py/master/CHANGES.txt>`_
117
118 Tutorial
119 =========
120
121 * `ID mapping using mygene module in Python <http://nbviewer.ipython.org/6771106>`_
122
123 Documentation
124 =============
125
126 http://mygene-py.readthedocs.org/
127
128 Usage
129 =====
130
131 .. code-block:: python
132
133 In [1]: import mygene
134
135 In [2]: mg = mygene.MyGeneInfo()
136
137 In [3]: mg.getgene(1017)
138 Out[3]:
139 {'_id': '1017',
140 'entrezgene': 1017,
141 'name': 'cyclin-dependent kinase 2',
142 'symbol': 'CDK2',
143 'taxid': 9606,
144 ...
145 }
146
147 # use "fields" parameter to return a subset of fields
148 In [4]: mg.getgene(1017, fields='name,symbol,refseq')
149 Out[4]:
150 {'_id': '1017',
151 'name': 'cyclin-dependent kinase 2',
152 'refseq': {'genomic': ['AC_000144.1',
153 'NC_000012.11',
154 'NG_028086.1',
155 'NT_029419.12',
156 'NW_001838059.1'],
157 'protein': ['NP_001789.2', 'NP_439892.2'],
158 'rna': ['NM_001798.3', 'NM_052827.2']},
159 'symbol': 'CDK2'}
160
161 In [5]: mg.getgene(1017, fields=['name', 'symbol', 'refseq.rna'])
162 Out[5]:
163 {'_id': '1017',
164 'name': 'cyclin-dependent kinase 2',
165 'refseq': {'rna': ['NM_001798.5', 'NM_052827.3']},
166 'symbol': 'CDK2'}
167
168
169 In [6]: mg.getgenes([1017,1018,'ENSG00000148795'], fields='name,symbol,entrezgene,taxid')
170 Out[6]:
171 [{'_id': '1017',
172 'entrezgene': 1017,
173 'name': 'cyclin-dependent kinase 2',
174 'query': '1017',
175 'symbol': 'CDK2',
176 'taxid': 9606},
177 {'_id': '1018',
178 'entrezgene': 1018,
179 'name': 'cyclin-dependent kinase 3',
180 'query': '1018',
181 'symbol': 'CDK3',
182 'taxid': 9606},
183 {'_id': '1586',
184 'entrezgene': 1586,
185 'name': 'cytochrome P450, family 17, subfamily A, polypeptide 1',
186 'query': 'ENSG00000148795',
187 'symbol': 'CYP17A1',
188 'taxid': 9606}]
189
190 # return results in Pandas DataFrame
191 In [7]: mg.getgenes([1017,1018,'ENSG00000148795'], fields='name,symbol,entrezgene,taxid', as_dataframe=True)
192 Out[7]:
193 _id entrezgene \
194 query
195 1017 1017 1017
196 1018 1018 1018
197 ENSG00000148795 1586 1586
198
199 name symbol \
200 query
201 1017 cyclin-dependent kinase 2 CDK2
202 1018 cyclin-dependent kinase 3 CDK3
203 ENSG00000148795 cytochrome P450, family 17, subfamily A, polyp... CYP17A1
204
205 taxid
206 query
207 1017 9606
208 1018 9606
209 ENSG00000148795 9606
210
211 [3 rows x 5 columns]
212
213 In [8]: mg.query('cdk2', size=5)
214 Out[8]:
215 {'hits': [{'_id': '1017',
216 '_score': 373.24667,
217 'entrezgene': 1017,
218 'name': 'cyclin-dependent kinase 2',
219 'symbol': 'CDK2',
220 'taxid': 9606},
221 {'_id': '12566',
222 '_score': 353.90176,
223 'entrezgene': 12566,
224 'name': 'cyclin-dependent kinase 2',
225 'symbol': 'Cdk2',
226 'taxid': 10090},
227 {'_id': '362817',
228 '_score': 264.88477,
229 'entrezgene': 362817,
230 'name': 'cyclin dependent kinase 2',
231 'symbol': 'Cdk2',
232 'taxid': 10116},
233 {'_id': '52004',
234 '_score': 21.221401,
235 'entrezgene': 52004,
236 'name': 'CDK2-associated protein 2',
237 'symbol': 'Cdk2ap2',
238 'taxid': 10090},
239 {'_id': '143384',
240 '_score': 18.617256,
241 'entrezgene': 143384,
242 'name': 'CDK2-associated, cullin domain 1',
243 'symbol': 'CACUL1',
244 'taxid': 9606}],
245 'max_score': 373.24667,
246 'took': 10,
247 'total': 28}
248
249 In [9]: mg.query('reporter:1000_at')
250 Out[9]:
251 {'hits': [{'_id': '5595',
252 '_score': 11.163337,
253 'entrezgene': 5595,
254 'name': 'mitogen-activated protein kinase 3',
255 'symbol': 'MAPK3',
256 'taxid': 9606}],
257 'max_score': 11.163337,
258 'took': 6,
259 'total': 1}
260
261 In [10]: mg.query('symbol:cdk2', species='human')
262 Out[10]:
263 {'hits': [{'_id': '1017',
264 '_score': 84.17707,
265 'entrezgene': 1017,
266 'name': 'cyclin-dependent kinase 2',
267 'symbol': 'CDK2',
268 'taxid': 9606}],
269 'max_score': 84.17707,
270 'took': 27,
271 'total': 1}
272
273 In [11]: mg.querymany([1017, '695'], scopes='entrezgene', species='human')
274 Finished.
275 Out[11]:
276 [{'_id': '1017',
277 'entrezgene': 1017,
278 'name': 'cyclin-dependent kinase 2',
279 'query': '1017',
280 'symbol': 'CDK2',
281 'taxid': 9606},
282 {'_id': '695',
283 'entrezgene': 695,
284 'name': 'Bruton agammaglobulinemia tyrosine kinase',
285 'query': '695',
286 'symbol': 'BTK',
287 'taxid': 9606}]
288
289 In [12]: mg.querymany([1017, '695'], scopes='entrezgene', species=9606)
290 Finished.
291 Out[12]:
292 [{'_id': '1017',
293 'entrezgene': 1017,
294 'name': 'cyclin-dependent kinase 2',
295 'query': '1017',
296 'symbol': 'CDK2',
297 'taxid': 9606},
298 {'_id': '695',
299 'entrezgene': 695,
300 'name': 'Bruton agammaglobulinemia tyrosine kinase',
301 'query': '695',
302 'symbol': 'BTK',
303 'taxid': 9606}]
304
305 In [13]: mg.querymany([1017, '695'], scopes='entrezgene', species=9606, as_dataframe=True)
306 Finished.
307 Out[13]:
308 _id entrezgene name symbol \
309 query
310 1017 1017 1017 cyclin-dependent kinase 2 CDK2
311 695 695 695 Bruton agammaglobulinemia tyrosine kinase BTK
312
313 taxid
314 query
315 1017 9606
316 695 9606
317
318 [2 rows x 5 columns]
319
320 In [14]: mg.querymany([1017, '695', 'NA_TEST'], scopes='entrezgene', species='human')
321 Finished.
322 Out[14]:
323 [{'_id': '1017',
324 'entrezgene': 1017,
325 'name': 'cyclin-dependent kinase 2',
326 'query': '1017',
327 'symbol': 'CDK2',
328 'taxid': 9606},
329 {'_id': '695',
330 'entrezgene': 695,
331 'name': 'Bruton agammaglobulinemia tyrosine kinase',
332 'query': '695',
333 'symbol': 'BTK',
334 'taxid': 9606},
335 {'notfound': True, 'query': 'NA_TEST'}]
336
337 # query all human kinases using fetch_all parameter:
338 In [15]: kinases = mg.query('name:kinase', species='human', fetch_all=True)
339 In [16]: kinases
340 Out [16]" <generator object _fetch_all at 0x7fec027d2eb0>
341
342 # kinases is a Python generator, now you can loop through it to get all 1073 hits:
343 In [16]: for gene in kinases:
344 ....: print gene['_id'], gene['symbol']
345 Out [16]: <output omitted here>
346
347
348 Contact
349 ========
350 Drop us any question or feedback:
351 * biothings@googlegroups.com (public discussion)
352 * help@mygene.info (reach devs privately)
353 * `Github issues <https://github.com/biothings/mygene.info/issues>`_
354 * on twitter `@mygeneinfo <https://twitter.com/mygeneinfo>`_
355 * Post a question on `BioStars.org <https://www.biostars.org/p/new/post/?tag_val=mygene>`_ with tag #mygene.
356
357
358