Skip to main content

an application of kegg pathway for django rest framework

Project description

Application of KEGG REST API with DRF(DjangoRestFramework)

Installation

python3 -m pip install django_rest_kegg

Install App to Your Djanog Rest Project

1 edit proj/settings.py

INSTALL_APPS += [
    'rest_framework',
    'django_rest_kegg'
]

# the path to store image and conf files
KEGG_DB_PATH = './keggdb'

2 edit proj/urls.py

urlpatterns += [
    path('kegg/', include('django_rest_kegg.urls')),
]

Initialize KEGG Database

# migarate database
python3 manage.py makemigrations django_rest_kegg
python3 manage.py migrate

# download image and conf files for all pathways
# and build table
python3 manage.py build [--dbpath PATH] [--drop]

# everything is ok, enjoy it!
python3 manage.py runserver

Endpoints

/kegg/pathway list all pathways

/kegg/pathway?path=<PATH>&type=<TYPE>&gene=<GENE>&color=<COLOR>

  • path: a map number, eg. map00010
  • type: conf, svg or png [default: png]
  • color: default color [default: green]
  • gene: genes to be highlighted, example formats:
    • gene={"red":"K00886,K01222,K01223"}
    • gene={"FF00FF":"K00886,K01222,K01223"}
    • gene={"red":"K00886,K01222","blue":"K01610,K00918"}
    • gene=["K00886,K01222,K01223"]
    • gene=["K00886,K01222,K01223"]&color=pink

Demo Project

git clone https://www.github.com/suqingdong/django_rest_kegg.git

cd django_rest_kegg/demo

python3 manage.py makemigrations django_rest_kegg

python3 manage.py migrate
# Operations to perform:
#   Apply all migrations: admin, auth, contenttypes, django_rest_kegg, sessions
# Running migrations:
#   Applying contenttypes.0001_initial... OK
#   Applying auth.0001_initial... OK
#   Applying admin.0001_initial... OK
#   ...
#   Applying django_rest_kegg.0001_initial... OK
#   Applying sessions.0001_initial... OK

python3 manage.py build

python3 manage.py runserver

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

django_rest_kegg-1.0.5.tar.gz (7.6 kB view details)

Uploaded Source

Built Distribution

django_rest_kegg-1.0.5-py3-none-any.whl (8.4 kB view details)

Uploaded Python 3

File details

Details for the file django_rest_kegg-1.0.5.tar.gz.

File metadata

  • Download URL: django_rest_kegg-1.0.5.tar.gz
  • Upload date:
  • Size: 7.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.8.3

File hashes

Hashes for django_rest_kegg-1.0.5.tar.gz
Algorithm Hash digest
SHA256 f5c0c1071e1b3b6907053d647da4386a14d041e5ff970b3a00b86217952f1564
MD5 b057f27d7682619a62d04a0366878569
BLAKE2b-256 70dc0e0686d120be5d7136a622af699182fcb1d63b6ffee29974ddbe1692ba4c

See more details on using hashes here.

File details

Details for the file django_rest_kegg-1.0.5-py3-none-any.whl.

File metadata

  • Download URL: django_rest_kegg-1.0.5-py3-none-any.whl
  • Upload date:
  • Size: 8.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.8.3

File hashes

Hashes for django_rest_kegg-1.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 29929843d8f56838e3b6a03206fa4bef8f7c12ceaeaf83601fe6a1b2c4bcc225
MD5 f72129331c2be5cecbd8dd33709d8062
BLAKE2b-256 c1ffdda28074f69e7b111bf2db6680020bcb8bac4721636a5ebac5924772efe3

See more details on using hashes here.

Supported by

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