{"id":25002227,"url":"https://github.com/pprattis/sequence-global-alignment-with-unknown-nucleotides","last_synced_at":"2025-03-29T20:44:17.704Z","repository":{"id":194622014,"uuid":"223975750","full_name":"pprattis/sequence-global-alignment-with-unknown-nucleotides","owner":"pprattis","description":"A Python script that for a parameter k, calculates the universal alignment of 2 sequences, with limitation that the alignment contains at most k unknown nucleotides. Nucleotide sequences are sometimes written in a 5-character alphabet, A, T, G, C, and N where N stands for an undefined nucleotide.","archived":false,"fork":false,"pushed_at":"2019-11-25T15:19:18.000Z","size":11,"stargazers_count":0,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-04T21:44:19.231Z","etag":null,"topics":["bioinformatics","chromosomes","computer-science","fasta","global-alignment","nucleotides","program","python","sequence-alignment","student"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pprattis.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2019-11-25T15:04:36.000Z","updated_at":"2019-11-26T13:11:29.000Z","dependencies_parsed_at":"2023-09-14T10:27:49.447Z","dependency_job_id":null,"html_url":"https://github.com/pprattis/sequence-global-alignment-with-unknown-nucleotides","commit_stats":null,"previous_names":["peteprattis/sequence-global-alignment-with-unknown-nucleotides","pprattis/sequence-global-alignment-with-unknown-nucleotides"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pprattis%2Fsequence-global-alignment-with-unknown-nucleotides","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pprattis%2Fsequence-global-alignment-with-unknown-nucleotides/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pprattis%2Fsequence-global-alignment-with-unknown-nucleotides/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pprattis%2Fsequence-global-alignment-with-unknown-nucleotides/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pprattis","download_url":"https://codeload.github.com/pprattis/sequence-global-alignment-with-unknown-nucleotides/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246243567,"owners_count":20746307,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bioinformatics","chromosomes","computer-science","fasta","global-alignment","nucleotides","program","python","sequence-alignment","student"],"created_at":"2025-02-04T21:40:23.202Z","updated_at":"2025-03-29T20:44:17.684Z","avatar_url":"https://github.com/pprattis.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# A Python Program / Project\n\n**This is a Python project from my early days as a Computer Science student**\n\n_This programm was created for the sixth semester class Bioinformatics\nand is one of the final projects for the class_\n\n\u003e #### Description of project\n\u003e\n\u003e\u003eA Python script that for a parameter k, calculates the universal alignment of 2 sequences, with limitation that the alignment contains at most k unknown nucleotides. Nucleotide sequences are sometimes written in a 5-character alphabet, A, T, G, C, and N where N stands for an undefined nucleotide. A sequence with an N nucleotide is referred to as a degenerate sequence. Generally, a sequence with k unknown nucleotides has 4^k different interpretations.\n\n\u003e #### Implementation of project\n\u003e We first load 2 sequences from fasta files or create a 4 nucleotide array to randomly create 2 sequences. We create a matrix D to store the best dynamic programming scores for each pair of sequences, the matrix has dimensions of 1st sequence + 1 * 2nd sequence + 1. We create the sim_mat scaling matrix where we save values 2 for pair, 1 for purine and purine or pyrimidine with pyrimidine and -1 for purine with pyrimidine. These values will help us to replace and match. We also define a gap_score penalty of -2.\nThe first element of matrix D is zero or blank while the first row and column is filled in with gap_score adding it once more. To calculate matrix D we have 3 rules. If the highest score comes from the element D[i-1, j-1] and the scoring clause for each nucleotide means we have a pair, if it comes from the element D[i-1, j] and the scoring penalty then we have a gap in the first sequence while if it comes from element D[I, j-1] and the scoring penalty then we have a gap in the second sequence.\nThe next step is the traceback to create the alignment. We start from the last element D[m + 1, n + 1] to D[1,1]. To find the path that led to the optimal score, we first start with the matrix element D[m, n] and repeat the calculations backwards to find out where we came from. In other words, from box D[i, j] we recalculate the results at positions D[i-1, j-1], D[i-1, j] and D[i, j-1]. By doing this we can rebuild the path we came from. Our priority is to take the diagonal route first (if any). Adding a gap to the second priority and adding a gap to the third priority. Again, this choice of priority is completely arbitrary.\nBy reversing the nucleotides in the alignment we found we complete the universal alignment.\n\n\n\u003e #### About this project\n\u003e\n\u003e - The comments to make the code understandable, are within the .py archive\n\u003e - This project was written in IDLE, Python’s Integrated Development and Learning Environment.\n\u003e - Biological data used from https://www.ncbi.nlm.nih.gov/gene/ (genes 281894, 396218)\n\u003e - This program runs for Python version 2.7\n\u003e - This repository was created to show the variety of the work I did and experience I gained as a student\n\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpprattis%2Fsequence-global-alignment-with-unknown-nucleotides","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpprattis%2Fsequence-global-alignment-with-unknown-nucleotides","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpprattis%2Fsequence-global-alignment-with-unknown-nucleotides/lists"}