On the Role of Stop Codons in the Genetic Code |
John Cole |
randoCode.py, switch.py, eigEx3.py |
randoCode.py simply shuffles the wild type code some integer number of times.
switch.py takes as arguments a genetic code, and an integer i. The script chooses from a uniform distribution an integer j between 0 and 63 inclusive, and swaps the amino acid specified as element i and the amino acid specified as element j in the genetic code.
eigEx3.py does essentially what eigEx2 does in terms of calculating the matrix M based on a genetic code and the relation table passed as arguments, but instead of solving the approximate eigenvalue problem outlined earlier, eigEx3.py simply returns the cleaved column from M associated with the stop codons. This is later used in finding D and D2. |
Three short codes vital to the program. |
randoCode.py:
import random
def randoCode(n):
# [[1,phe],[2,leu],[3,iso],[4,met],[5,val],[6,ser],[7,pro],[8,thr],[9,ala],[10,tyr],[11,his],[12,glutamine],[13,asparagine],[14,lys],[15,aspartic],[16,glutamic],[17,cys],[18,trp],[19,arg],[20,gly]]
code=[1,1,2,2,2,2,2,2,3,3,3,4,5,5,5,5,6,6,6,6,7,7,7,7,8,8,8,8,9,9,9,9,10,10,0,0,11,11,12,12,13,13,14,14,15,15,16,16,17,17,0,18,19,19,19,19,6,6,19,19,20,20,20,20]
for i in range(n): random.shuffle(code)
return code |
switch.py:
import random import numpy def switch(code,i): j=numpy.copy(i) while i==j: j=random.randint(0,63)
new=numpy.copy(code) new[i]=code[j] new[j]=code[i]
return new |
eigEx3.py:
import numpy from numpy import linalg as LA
def eigEx(code,rel):
# NRG=[302.0,-486.8,-520.6,-412.1,-466.1,-567.8,-373.3,-603.7,-415.9,-481.9,-221.8,-611.2,-590.5,-443.4,-786.7,-807.4,-378.1,-215.0,0.0,-390.0]
M=numpy.zeros([21,21]) for i in range(64): for j in range(9): M[code[int(rel[0][i][j])]][code[i]]+=rel[1][i][j]
vs=numpy.vsplit(M,[1,21])
return vs[0] |