Giter Site home page Giter Site logo

mohmmedfathi / alignment-api Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 66 KB

Local and Global Alignment API

Python 100.00%
alignment django django-project django-rest-framework drf global-alignment local-alignment bioinformatics bioinformatics-services

alignment-api's Introduction

LinkedIn MIT License


Alignment API

Local and Global Alignment in python

About The Project

The objective of this sequence alignment technique is to place a query sequence end-to-end with the known sequence so as to find out some relationship like structural, functional, or evolutionary between them.
I implemented in this project local and global in python then deliver as API using django rest freamework

Built With

  • Python
  • Django
  • Django Rest Framework
  • sqlite

Getting Started

Prerequisites

  • Python <= 3.10.6
  • Pip <= 22.0.2
  • Python virtual environment
  1. Clone the repo

    git clone https://github.com/mohmmedfathi/Alignment-Api && cd Alignment-Api
  2. Create virtual environment

    python3 -m venv venv
  3. Activate virtual environment

    source venv/bin/activate
  4. Install requirements

    pip install -r requirements.txt
  5. Migrate models

    python manage.py migrate
  6. Run server

    python manage.py runserver 

Usage

We have two endpoint :

Global endpoint


Screenshot from 2023-01-04 00-27-25

you have to enter 5 value :

  • first sequence is seq1

  • second sequence is seq2

  • gap is gap

  • match is match

  • mismatch is mismatch

sample input :

{ 
"seq1":"aaac",
"seq2":"agc", 
"gap" : -2,
"match":1, 
"mismatch" : -1 
}

output for previous input :

HTTP 201 Created
Allow: OPTIONS, GET, POST

{
    "id": 1,
    "seq1": "aaac",
    "seq2": "agc",
    "aligned1": "aaac",
    "aligned2": "ag-c",
    "score_matrix": "[0, -2, -4, -6],[-2, 1, -1, -3],[-4, -1, 0, -2],[-6, -3, -2, -1],[-8, -5, -4, -1]",
    "traceback_matrix": "['done', 'left', 'left', 'left'],['up', 'diag', 'left', 'left'],['up', 'up', 'diag', 'left'],['up', 'up', 'up', 'diag'],['up', 'up', 'up', 'diag']"
}



Local endpoint


Screenshot from 2023-01-04 00-41-14

you have to enter 5 value :

  • first sequence is seq1

  • second sequence is seq2

  • gap is gap

  • match is match

  • mismatch is mismatch

sample input :

{
"seq1": "ATGCT",
"seq2": "AGCT",
"gap": -2,
"match": 1,
"mismatch":-1
}

output for previous input :

HTTP 201 Created
Allow: POST, GET, OPTIONS

{
    "id": 1,
    "seq1": "ATGCT",
    "seq2": "AGCT",
    "score_matrix": "[0, 0, 0, 0, 0, 0],[0, 1, 0, 0, 0, 0],[0, 0, 0, 1, 0, 0],[0, 0, 0, 0, 2, 0],[0, 0, 1, 0, 0, 3]",
    "best_score": 3,
    "alignment1": "ATGCT",
    "alignment2": "A-GCT"
}


To create a superuser

python manage.py createsuperuser

Contact

Mohammed Fathi - [email protected]

Project Link: https://github.com/mohmmedfathi/Alignment-Api/

alignment-api's People

Contributors

mohmmedfathi avatar

Stargazers

 avatar

Watchers

 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.