Great Deal! Get Instant $10 FREE in Account on First Order + 10% Cashback on Every Order Order Now

Please find details forAssignment 4(Total of 2 data files + PDF with details about the assignment itself). The first file (PDF) details the question/s. Theupstream regions fileis bzipped so you will...

1 answer below »
Please find details forAssignment 4(Total of 2 data files + PDF with details about the assignment itself). The first file (PDF) details the question/s. Theupstream regions fileis bzipped so you will have to unzip it before using while thecounts matrix is being uploaded as a text file. These files are all in space/tab-delimited text format. As always I am expecting the scripts to be submitted so that when they are run with these files in the current directory with their names as such I have the desired output from your script/program.
Answered Same Day Mar 30, 2021

Solution

Yogesh answered on Apr 03 2021
148 Votes
import math as m
from collections import Counte
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 =...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here