def create_frequency_matrix (corrected_pfm, seqs_list, sd_mat):
ss = sd_mat
# corrected N
N = (len(seqs_list)) + 4
freq_matrix0= corrected_pfm
freq_matrix0 = freq_matrix0.div(N)
freq_matrix1 = corrected_pfm
for row1 in range(freq_matrix0.shape[0]):
for col1 in range(freq_matrix0.shape[1]):
num1 = freq_matrix0.iloc[row1,col1]
num2 = ss.iloc[row1,col1]
freq_matrix1.iloc[row1,col1] = num1 - num2
return (freq_matrix1)