Skip to main content

pykegg

Analyze and visualize KEGG information using network approach.

Using biopython, igraph and plotnine, parse the KGML into igraph and easily plot the relevant information contained in KEGG Pathway in Python environment.

import requests_cache
import numpy as np
from PIL import Image
import pykegg
import matplotlib as mpl

## Be sure to cache all the downloaded files to avoid recursive querying
requests_cache.install_cache('pykegg_cache')
g = pykegg.KGML_graph(pid="hsa03460")

## Export as igraph
gra = g.get_graph()
print(gra)

## Overlay to raw image
nds = g.get_nodes()
nds = nds[nds.original_type=="gene"]
nds["lfc"] = np.arange(-2,2,0.01)[0:nds.shape[0]]
cmap_grad = mpl.colors.LinearSegmentedColormap.from_list("cmap_grad", ["yellow","green"])
norm = mpl.colors.Normalize(vmin=min(nds.lfc), vmax=max(nds.lfc))
nds["color"] = [
        mpl.colors.to_hex(cmap_grad(norm(x))) if x is not None else None
        for x in nds.lfc
    ]
Image.fromarray(pykegg.overlay_opencv_image(nds, pid="hsa03460"))

Documentation

https://noriakis.github.io/pykegg-docs

TODO

  • The function for converting identifiers (especially for ENTREZID <-> SYMBOL) without connection to servers, like using genomic-features.
  • Parallel edge support by nudging x and y position
  • Better error handling

Metadata

Release files for pykegg 0.1.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pykegg 0.1.7
File Size Uploaded Provenance Actions
pykegg-0.1.7.tar.gz 12.5 kB Without provenance Details for pykegg-0.1.7.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pykegg 0.1.7
File Interpreter ABI Platform Actions
pykegg-0.1.7-py3-none-any.whl Python 3 none any Details for pykegg-0.1.7-py3-none-any.whl

Total release size: 24.6 kB

Release files / pykegg-0.1.7.tar.gz

Download URL pykegg-0.1.7.tar.gz
Size 12.5 kB
Tags Source
SHA-256 checksum
How to use checksums
1464cae18ae21b65ff6a48c3a7808129d7d303e6c4b64b038334d82f67c82214
BLAKE2b-256 checksum
How to use checksums
e69674493acd8f535745edecc0127efd29c32755b4e15f0425ad14c3ba33694a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.10.13

Release files / pykegg-0.1.7-py3-none-any.whl

Download URL pykegg-0.1.7-py3-none-any.whl
Size 12.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8068677d66e9a35afc95180050c96ea6428a114610f7defc422fbedd67d998b8
BLAKE2b-256 checksum
How to use checksums
b77f62e08c6bf3cd3439df85651bd14e57ca4010ad68c837d9d8eaab15c8cdde
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.10.13

Security for pykegg 0.1.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page