Name | kegg-cli JSON |
Version |
0.0.1
JSON |
| download |
home_page | None |
Summary | a CLI tool for KEGG. It can use all conventional KEGG REST API commands and a custom command get-seq to get nt/aa seq from given gene IDs/pathway/module |
upload_time | 2025-01-15 22:02:31 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.8 |
license | None |
keywords |
kegg
cli
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# kegg-cli
[![PyPI - Version](https://img.shields.io/pypi/v/kegg-cli.svg)](https://pypi.org/project/kegg-cli)
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/kegg-cli.svg)](https://pypi.org/project/kegg-cli)
-----
> [!NOTE]
> You MUST make absolutely sure to comply with the conditions of using KEGG and its API: http://www.kegg.jp/kegg/legal.html and http://www.kegg.jp/kegg/rest/.
## Table of Contents
- [Installation](#installation)
- [Features](#Features)
- [Commands](#commands)
- [info](#info)
- [get](#get)
- [list](#list)
- [find](#find)
- [conv](#conv)
- [link](#link)
- [get_seq](#get_seq)
- [License](#license)
- [Contributing](#Contributing)
## Features
- Query KEGG database information
- Retrieve entries from KEGG databases
- List database entries
- Search by keywords
- Convert between KEGG and external database IDs
- Find related entries between KEGG databases
- Download gene sequences (nucleotide or amino acid)
## Installation
### Via pip
```console
pip install kegg-cli
```
### From source
```bash
git clone https://www.github.com/vidyasagar0405/kegg-cli
cd kegg-cli
pip install .
```
## Commands
you can use conventional KEGG API commands such as info, get, list, find, conv, link, see below for example usage
check KEGG REST API documentation for more info: https://www.kegg.jp/kegg/rest/keggapi.html
### info
```bash
kegg-cli info kegg
```
### get
- Retrives gene entry
```bash
kegg-cli get eco:b0002
```
- Enclose ids in "double quotes", use -op/--option for options for available options check KEGG REST API
```bash
kegg-cli get "hsa:10458 ece:Z5100" -op aaseq
```
### list
- Returns the list of KEGG organisms with taxonomic classification
```bash
kegg-cli list organism
```
- Returns the list of the genes
```bash
kegg-cli list "rsz:19816419 rsz:19816420"
```
- Returns the list of human pathways
```bash
kegg-cli list pathway -org hsa
```
### find
- Returns compound ids with the said formula
```bash
kegg-cli find C7H10O5 -db compound -op formula
```
- Returns genes involved in cancer in humans
```bash
kegg-cli find "cancer hsa"
```
- Returns Pathways with RNA in their name
```bash
kegg-cli find "rna" -db pathway
```
### conv
- Converts KEGG geneIDS to NCBI proteinIDs
```bash
kegg-cli conv ncbi-proteinid "rsz:19816419 rsz:19816420 rsz:19816421 rsz:19816422"
```
- Converts KEGG geneIDS to NCBI geneIDs
```bash
kegg-cli conv ncbi-geneid "rsz:19816419 rsz:19816420 rsz:19816421 rsz:19816422"
```
- Converts NCBI geneIDs to KEGG geneIDS
```bash
kegg-cli conv genes "ncbi-geneid:19816419 ncbi-geneid:19816420 ncbi-geneid:19816421 ncbi-geneid:19816422"
```
- Converts NCBI proteinIDs to KEGG geneIDS
```bash
kegg-cli conv genes "ncbi-proteinid:YP_009046967 ncbi-proteinid:YP_009046968 ncbi-proteinid:YP_009046969 ncbi-proteinid:YP_009046970"
```
### link
- Returns genes linked to the rsz00966 pathway
```bash
kegg-cli link rsz rsz00966
```
- Returns compounds linked to the rsz00966 pathway
```bash
kegg-cli link cpd map00010
```
- Returns pathways linked to the given genes
```bash
kegg-cli link pathway "hsa:10458 ece:Z5100"
```
### get-seq
It is not a part of KEGG REST API, but uses link and get API calls to get the nucleotide sequence (ntseq) or amino acid sequence (aaseq).
get-seq can be used in four different ways:
- Fetches the ntseq (default) of the given genes and saves it to a file named with time_date.fasta
```bash
kegg-cli get-seq "rsz:108806876 rsz:108839148"
```
- Fetches the aaseq of the given genes and saves it to a file named with time_date.fasta
```bash
kegg-cli get-seq "rsz:108806876 rsz:108839148" --seq-type aaseq
```
- Fetches the aaseq of the given genes and saves it to a file named path/to/file.fasta
```bash
kegg-cli get-seq "rsz:108806876 rsz:108839148" --seq-type aaseq -o path/to/file.fasta
```
- Fetches the aaseq of the genes in the file (one per line) and saves it to a file named path/to/file.fasta
```bash
kegg-cli get-seq /home/vs/Documents/bioinfo/practise/kegg/rsz_rsz_M00005_genes.tsv --seq-type aaseq -o expected_aaseq.fasta
```
- Fetches the aaseq of the genes in the second column (0 based indexing) of the file (one per line) and saves it to a file named path/to/file.fasta (delimiter can also be changed with --delimiter, defaults to '\t')
```bash
kegg-cli get-seq /home/vs/Documents/bioinfo/practise/kegg/rsz_rsz_M00005_genes.tsv --field 1 --seq-type aaseq -o expected_aaseq.fasta
```
- Fetches the ntseq of all the genes in the given pathway (make sure to add 'path:' prefix, to the pathway ID. One pathway at a time)
```bash
kegg-cli get-seq path:minc00966 --seq-type ntseq -o tests/data/expected_pathway_ntseq.fasta
```
- Fetches the ntseq of all the genes in the given module (make sure to add 'md:' prefix, to the module ID. One module at a time)
```bash
kegg-cli get-seq md:rsz_M00005 --seq-type ntseq -o tests/data/expected_module_ntseq.fasta
```
## License
`kegg-cli` is distributed under the terms of the [MIT](https://spdx.org/licenses/MIT.html) license.
## Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Raw data
{
"_id": null,
"home_page": null,
"name": "kegg-cli",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": "KEGG, cli",
"author": null,
"author_email": "vidyasagar0405 <vidyasagar0405@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/91/8a/d7fd8634e15d493439c4131573b9a97f3fa33b25ccaee0eeb753d11bad11/kegg_cli-0.0.1.tar.gz",
"platform": null,
"description": "# kegg-cli\n\n[![PyPI - Version](https://img.shields.io/pypi/v/kegg-cli.svg)](https://pypi.org/project/kegg-cli)\n[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/kegg-cli.svg)](https://pypi.org/project/kegg-cli)\n\n-----\n\n\n> [!NOTE]\n> You MUST make absolutely sure to comply with the conditions of using KEGG and its API: http://www.kegg.jp/kegg/legal.html and http://www.kegg.jp/kegg/rest/.\n\n\n## Table of Contents\n\n- [Installation](#installation)\n- [Features](#Features)\n- [Commands](#commands)\n - [info](#info)\n - [get](#get)\n - [list](#list)\n - [find](#find)\n - [conv](#conv)\n - [link](#link)\n - [get_seq](#get_seq)\n- [License](#license)\n- [Contributing](#Contributing)\n\n## Features\n\n- Query KEGG database information\n- Retrieve entries from KEGG databases\n- List database entries\n- Search by keywords\n- Convert between KEGG and external database IDs\n- Find related entries between KEGG databases\n- Download gene sequences (nucleotide or amino acid)\n\n## Installation\n\n### Via pip\n\n```console\npip install kegg-cli\n```\n\n### From source\n\n```bash\ngit clone https://www.github.com/vidyasagar0405/kegg-cli\ncd kegg-cli\npip install .\n```\n\n## Commands\n\nyou can use conventional KEGG API commands such as info, get, list, find, conv, link, see below for example usage\ncheck KEGG REST API documentation for more info: https://www.kegg.jp/kegg/rest/keggapi.html\n\n### info\n\n```bash\nkegg-cli info kegg\n```\n\n### get\n\n- Retrives gene entry\n```bash\nkegg-cli get eco:b0002\n```\n- Enclose ids in \"double quotes\", use -op/--option for options for available options check KEGG REST API\n```bash\nkegg-cli get \"hsa:10458 ece:Z5100\" -op aaseq\n```\n\n### list\n\n- Returns the list of KEGG organisms with taxonomic classification\n```bash\nkegg-cli list organism\n```\n- Returns the list of the genes\n```bash\nkegg-cli list \"rsz:19816419 rsz:19816420\" \n```\n\n- Returns the list of human pathways\n```bash\nkegg-cli list pathway -org hsa\n```\n\n### find\n\n- Returns compound ids with the said formula\n```bash\nkegg-cli find C7H10O5 -db compound -op formula\n```\n- Returns genes involved in cancer in humans\n```bash\nkegg-cli find \"cancer hsa\"\n```\n- Returns Pathways with RNA in their name\n```bash\nkegg-cli find \"rna\" -db pathway\n```\n\n### conv\n\n- Converts KEGG geneIDS to NCBI proteinIDs\n```bash\nkegg-cli conv ncbi-proteinid \"rsz:19816419 rsz:19816420 rsz:19816421 rsz:19816422\"\n```\n\n- Converts KEGG geneIDS to NCBI geneIDs\n```bash\nkegg-cli conv ncbi-geneid \"rsz:19816419 rsz:19816420 rsz:19816421 rsz:19816422\" \n```\n\n- Converts NCBI geneIDs to KEGG geneIDS\n```bash\nkegg-cli conv genes \"ncbi-geneid:19816419 ncbi-geneid:19816420 ncbi-geneid:19816421 ncbi-geneid:19816422\" \n```\n\n- Converts NCBI proteinIDs to KEGG geneIDS\n```bash\nkegg-cli conv genes \"ncbi-proteinid:YP_009046967 ncbi-proteinid:YP_009046968 ncbi-proteinid:YP_009046969 ncbi-proteinid:YP_009046970\" \n```\n\n### link\n\n\n- Returns genes linked to the rsz00966 pathway\n```bash\nkegg-cli link rsz rsz00966 \n```\n\n- Returns compounds linked to the rsz00966 pathway\n```bash\nkegg-cli link cpd map00010 \n```\n\n- Returns pathways linked to the given genes\n```bash\nkegg-cli link pathway \"hsa:10458 ece:Z5100\"\n```\n\n### get-seq\n\nIt is not a part of KEGG REST API, but uses link and get API calls to get the nucleotide sequence (ntseq) or amino acid sequence (aaseq).\n\nget-seq can be used in four different ways:\n\n- Fetches the ntseq (default) of the given genes and saves it to a file named with time_date.fasta\n```bash\nkegg-cli get-seq \"rsz:108806876 rsz:108839148\" \n```\n\n- Fetches the aaseq of the given genes and saves it to a file named with time_date.fasta\n```bash\nkegg-cli get-seq \"rsz:108806876 rsz:108839148\" --seq-type aaseq \n```\n\n- Fetches the aaseq of the given genes and saves it to a file named path/to/file.fasta\n```bash\nkegg-cli get-seq \"rsz:108806876 rsz:108839148\" --seq-type aaseq -o path/to/file.fasta \n```\n\n- Fetches the aaseq of the genes in the file (one per line) and saves it to a file named path/to/file.fasta\n```bash\nkegg-cli get-seq /home/vs/Documents/bioinfo/practise/kegg/rsz_rsz_M00005_genes.tsv --seq-type aaseq -o expected_aaseq.fasta \n```\n\n- Fetches the aaseq of the genes in the second column (0 based indexing) of the file (one per line) and saves it to a file named path/to/file.fasta (delimiter can also be changed with --delimiter, defaults to '\\t')\n```bash\nkegg-cli get-seq /home/vs/Documents/bioinfo/practise/kegg/rsz_rsz_M00005_genes.tsv --field 1 --seq-type aaseq -o expected_aaseq.fasta\n```\n\n- Fetches the ntseq of all the genes in the given pathway (make sure to add 'path:' prefix, to the pathway ID. One pathway at a time)\n```bash\nkegg-cli get-seq path:minc00966 --seq-type ntseq -o tests/data/expected_pathway_ntseq.fasta \n```\n\n- Fetches the ntseq of all the genes in the given module (make sure to add 'md:' prefix, to the module ID. One module at a time)\n```bash\nkegg-cli get-seq md:rsz_M00005 --seq-type ntseq -o tests/data/expected_module_ntseq.fasta \n```\n\n## License\n\n`kegg-cli` is distributed under the terms of the [MIT](https://spdx.org/licenses/MIT.html) license.\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n",
"bugtrack_url": null,
"license": null,
"summary": "a CLI tool for KEGG. It can use all conventional KEGG REST API commands and a custom command get-seq to get nt/aa seq from given gene IDs/pathway/module",
"version": "0.0.1",
"project_urls": {
"Documentation": "https://github.com/vidyasagar0405/kegg-cli#readme",
"Issues": "https://github.com/vidyasagar0405/kegg-cli/issues",
"Source": "https://github.com/vidyasagar0405/kegg-cli"
},
"split_keywords": [
"kegg",
" cli"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "5d179b78a7567921b9132c82158477f502863d2d1f49e88aaa416d365a3c9276",
"md5": "5ab0c2edc1fa8c2f6cd91ce40a45f381",
"sha256": "5894e7adc7d227b10f6043b982f06488a315e9cd5297e7434db0259f454995da"
},
"downloads": -1,
"filename": "kegg_cli-0.0.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "5ab0c2edc1fa8c2f6cd91ce40a45f381",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 10579,
"upload_time": "2025-01-15T22:02:28",
"upload_time_iso_8601": "2025-01-15T22:02:28.716606Z",
"url": "https://files.pythonhosted.org/packages/5d/17/9b78a7567921b9132c82158477f502863d2d1f49e88aaa416d365a3c9276/kegg_cli-0.0.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "918ad7fd8634e15d493439c4131573b9a97f3fa33b25ccaee0eeb753d11bad11",
"md5": "9a6765a7f68c1d5725ea11cf6e4f585d",
"sha256": "52e941644d5bcdd5e41b30e08c53c9e734988e4cd291097944e6466de4eb2063"
},
"downloads": -1,
"filename": "kegg_cli-0.0.1.tar.gz",
"has_sig": false,
"md5_digest": "9a6765a7f68c1d5725ea11cf6e4f585d",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 24773,
"upload_time": "2025-01-15T22:02:31",
"upload_time_iso_8601": "2025-01-15T22:02:31.512741Z",
"url": "https://files.pythonhosted.org/packages/91/8a/d7fd8634e15d493439c4131573b9a97f3fa33b25ccaee0eeb753d11bad11/kegg_cli-0.0.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-01-15 22:02:31",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "vidyasagar0405",
"github_project": "kegg-cli#readme",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "kegg-cli"
}