Skip to content

mohmmedfathi/Alignment-Api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 - mohmmedfathi.123@gmail.com

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