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