Answer To: Please find details forAssignment 4(Total of 2 data files + PDF with details about the assignment...
Yogesh answered on Apr 03 2021
import math as m
from collections import Counter
def freq_mat_gen(a_cMat, c_cMat, g_cMat, t_cMat, a_fMat, c_fMat, g_fMat, t_fMat):
div_fac = a_cMat[0] + c_cMat[0] + g_cMat[0] + t_cMat[0]
#print(div_fac)
for i in a_cMat:
j = i/div_fac
j = round(j, 3)
a_fMat.append(j)
#print(a_fMat)
for i in c_cMat:
j = i/div_fac
j = round(j, 3)
c_fMat.append(j)
#print(c_fMat)
for i in g_cMat:
j = i/div_fac
j = round(j, 3)
g_fMat.append(j)
#print(g_fMat)
for i in t_cMat:
j = i/div_fac
j = round(j, 3)
t_fMat.append(j)
#print(t_fMat)
matrix = []
matrix.append(a_fMat)
matrix.append(c_fMat)
matrix.append(g_fMat)
matrix.append(t_fMat)
### For printing the matrix
for i in range(4):
for j in range(18):
print(matrix[i][j], end = "\t")
print('\n')
print('')
def Freq_Mat_1():
global a_fMat1, c_fMat1, g_fMat1, t_fMat1
a_fMat1 = []
c_fMat1 = []
g_fMat1 = []
t_fMat1 = []
print("\tFreq. Matrix - F(b, j)")
freq_mat_gen(a_cMat1, c_cMat1, g_cMat1, t_cMat1, a_fMat1, c_fMat1, g_fMat1, t_fMat1)
def pseudocount(a_cMat, c_cMat, g_cMat, t_cMat):
global a_cMat2, c_cMat2, g_cMat2, t_cMat2
a_cMat2 = []
c_cMat2 = []
g_cMat2 = []
t_cMat2 = []
for i in a_cMat:
j = i +1
a_cMat2.append(j)
for i in c_cMat:
j = i +1
c_cMat2.append(j)
for i in g_cMat:
j = i +1
g_cMat2.append(j)
for i in t_cMat:
j = i +1
t_cMat2.append(j)
def Freq_Mat_2():
global a_fMat2, c_fMat2, g_fMat2, t_fMat2
a_fMat2 = []
c_fMat2 = []
g_fMat2 = []
t_fMat2 =...