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
- Python <= 3.10.6
- Pip <= 22.0.2
- Python virtual environment
-
Clone the repo
git clone https://github.com/mohmmedfathi/Alignment-Api && cd Alignment-Api
-
Create virtual environment
python3 -m venv venv
-
Activate virtual environment
source venv/bin/activate
-
Install requirements
pip install -r requirements.txt
-
Migrate models
python manage.py migrate
-
Run server
python manage.py runserver
We have two endpoint :
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']"
}
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"
}
-
you can see the models in Admin Panel
To create a superuser
python manage.py createsuperuser
Mohammed Fathi - mohmmedfathi.123@gmail.com
Project Link: https://github.com/mohmmedfathi/Alignment-Api/