Git Product home page Git Product logo

django_rest_kegg's Introduction

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

django_rest_kegg's People

Contributors

roronoa-dong avatar suqingdong avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.