Skip to main content

A Python wrapper for accessing KEGG REST API, inspired by KEGGREST in Bioconductor

Project description

KEGGRESTpy

KEGGRESTpy is a Python package providing a simple interface to access the KEGG (Kyoto Encyclopedia of Genes and Genomes) REST API. This package allows users to fetch and interact with data from KEGG databases, enabling bioinformatics research on genomic and pathway data.

Note: This package was modified based on the KEGGREST package from Bioconductor.

Installation

Clone the repository and install with:

git clone https://github.com/guokai8/KEGGRESTpy.git
cd KEGGRESTpy
pip install -e .

Overview KEGGRESTpy offers several key functions for querying the KEGG REST API:

kegg_info(): Retrieve information about KEGG databases. kegg_list(): List entries in a KEGG database. kegg_get(): Retrieve specific entries from KEGG databases. kegg_find(): Search by keywords within KEGG databases. kegg_conv(): Convert identifiers between KEGG and external databases. kegg_link(): Link entries across KEGG databases. Each of these functions interacts directly with the KEGG API, handling data parsing and returning structured results.

Usage

1. Exploring KEGG Resources with kegg_list()

To list all available databases:

from KEGGRESTpy import list_databases

print(list_databases())

To list all organisms in KEGG:

from KEGGRESTpy import kegg_list

pathway = kegg_list("pathway")
print(pathway)

2. Retrieving Specific Entries with kegg_get()

To retrieve detailed information about specific entries in KEGG, such as genes:

from KEGGRESTpy import kegg_get

data = kegg_get(["hsa:10458", "ece:Z5100"])
print(data)

You can also retrieve amino acid or nucleotide sequences:

sequences = kegg_get(["hsa:10458", "ece:Z5100"], option="aaseq")
print(sequences)

3. Searching by Keywords with kegg_find()

To search for entries related to a keyword:

from KEGGRESTpy import kegg_find

results = kegg_find("genes", "shiga toxin")
print(results)

4. Converting Identifiers with kegg_conv()

To convert identifiers between KEGG and other databases:

from KEGGRESTpy import kegg_conv

conversion = kegg_conv("ncbi-proteinid", ["hsa:10458", "ece:Z5100"])
print(conversion)

5. Linking Across Databases with kegg_link()

To find relationships between different entities in KEGG:

from KEGGRESTpy import kegg_link

pathways = kegg_link("pathway", "hsa")
print(pathways)

Contributing

Contributions to KEGGRESTpy are welcome! Please submit pull requests or open issues to discuss features, bugs, or improvements.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Citation and Restrictions

The KEGG API is provided for academic use by researchers affiliated with academic institutions. Please refer to the official KEGG REST API documentation for more information.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

KEGGRESTpy-0.1.0.tar.gz (8.5 kB view details)

Uploaded Source

File details

Details for the file KEGGRESTpy-0.1.0.tar.gz.

File metadata

  • Download URL: KEGGRESTpy-0.1.0.tar.gz
  • Upload date:
  • Size: 8.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.3

File hashes

Hashes for KEGGRESTpy-0.1.0.tar.gz
Algorithm Hash digest
SHA256 dfe921573a127da0c0f17038e15d10c6af78a13336dce61764f30bb63a533b16
MD5 883d1dbd06b5b1fdacd626c4df51001c
BLAKE2b-256 142fb50d0d8159af50cc075b3fbae6869ccc4c84acd256ef7b5519825d3370db

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page