Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Genomics/local_align.py
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
33 lines (21 sloc)
515 Bytes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from fasta import readFASTA | |
from scores import * | |
import numpy as np | |
import cython_local_align | |
s=readFASTA("rosalind_smgb.txt") | |
def pam250_penalty(x,y): | |
return -pam250_score(x,y) | |
def blosum62_penalty(x,y): | |
return -blosum62_score(x,y) | |
def edit_distance(x,y): | |
if x==y: | |
return -1 | |
else: | |
return 1 | |
def lgap(j): | |
return j | |
def agap(j): | |
return 10+j | |
A=s.values()[0] | |
B=s.values()[1] | |
cython_local_align.build_dp_array(A,B,0,1,edit_distance) | |