Skip to content
Snippets Groups Projects
Commit 4ef6c899 authored by marco's avatar marco
Browse files

added BLOSUM62 matrix

git-svn-id: https://dng.biozentrum.unibas.ch/svn/openstructure/trunk@2325 5a81b35b-ba03-0410-adc8-b2c5c5119f08
parent d54523e0
Branches
Tags
No related merge requests found
......@@ -5,4 +5,4 @@ set(OST_SEQ_ALG_PYMOD_SOURCES
pymod(NAME seq_alg OUTPUT_DIR ost/seq/alg
CPP ${OST_SEQ_ALG_PYMOD_SOURCES}
PY __init__.py)
PY __init__.py mat.py)
from _seq_alg import *
\ No newline at end of file
from _seq_alg import *
from ost.seq.alg.mat import *
\ No newline at end of file
from ost.seq.alg import SubstWeightMatrix
def _InitMatrix(data):
"""
Initialise a new substitution weight matrix with the weights in data. data
must be a 24x24 array of ints.
"""
mat=SubstWeightMatrix()
# string of valid amino acid one letter codes
chars='ABCDEFGHIKLMNPQRSTVWXYZ'
for i, row in enumerate(data):
for j, weight in enumerate(row):
mat.SetWeight(chars[i], chars[j], weight)
return mat
_RAW_BLOSUM62_DATA=(
(4,-2,0,-2,-1,-2,0,-2,-1,-1,-1,-1,-2,-1,-1,-1,1,0,0,-3,-1,-2),
(-2,6,-3,6,2,-3,-1,-1,-3,-1,-4,-3,1,-1,0,-2,0,-1,-3,-4,-1,-3),
(0,-3,9,-3,-4,-2,-3,-3,-1,-3,-1,-1,-3,-3,-3,-3,-1,-1,-1,-2,-1,-2),
(-2,6,-3,6,2,-3,-1,-1,-3,-1,-4,-3,1,-1,0,-2,0,-1,-3,-4,-1,-3),
(-1,2,-4,2,5,-3,-2,0,-3,1,-3,-2,0,-1,2,0,0,-1,-2,-3,-1,-2),
(-2,-3,-2,-3,-3,6,-3,-1,0,-3,0,0,-3,-4,-3,-3,-2,-2,-1,1,-1,3),
(0,-1,-3,-1,-2,-3,6,-2,-4,-2,-4,-3,0,-2,-2,-2,0,-2,-3,-2,-1,-3),
(-2,-1,-3,-1,0,-1,-2,8,-3,-1,-3,-2,1,-2,0,0,-1,-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to the discussion. Proceed with caution.
Please register or to comment