Пример #1
0
        #snag the RSA values
        RSA = natural_data[0]

        #get a list of char amino acid codes
        AA = resdict.values()
        #print "Dimensions of array {}".format(natural_data.ndim)

        n,m = natural_data.shape
        n_d, m_d = designed_data.shape 
        #print "Natural Protein Length", m
        #print "Designed Protein Length", m_d
        designed_protein_lengths.append(m_d)
        #Open .dat files that you will write the results to.
        natural_fpW = open("align_natural_data_array_" + pdb_id + "_" + chain_id + ".dat","w")
        natural_fpW.write(af.dump_csv_line2(rows))
        designed_fpW = open("align_data_array_" + pdb_id + "_" + chain_id + "_" + method + ".dat","w")
        designed_fpW.write(af.dump_csv_line2(rows))

        counter = 0
        natural_aaSum = 0
        designed_aaSum = 0
        aaCutOff = 0 #This is cut-off. If a site has less than this percent of amino acids left after taking out the gaps do not use that site in the analysis. 			  
        for i in range(0,m): #This blocks calculates the site frequency data 
            natural_aaCount = [] 
            designed_aaCount = []
            #covert back to list so we can use the "count" method
            try:
                natural_aaList = list(natural_data[1:,i])
                designed_aaList = list(designed_data[1:,i])
            except IndexError:
Пример #2
0
    natural_sample2_data = np.array(natural_sample2_data, dtype=object)

    #snag the RSA values
    RSA = natural_data[0]

    #get a list of char amino acid codes
    AA = resdict.values()
    #print "Dimensions of array {}".format(natural_data.ndim)

    n, m = natural_data.shape
    n_sample1, m_sample = natural_sample1_data.shape
    #Open .dat files that you will write the results to.
    natural_sample1_fpW = open(
        "align_natural_sample1_data_array_" + pdb_id + "_" + chain_id + ".dat",
        "w")
    natural_sample1_fpW.write(af.dump_csv_line2(rows))
    natural_sample2_fpW = open(
        "align_natural_sample2_data_array_" + pdb_id + "_" + chain_id + ".dat",
        "w")
    natural_sample2_fpW.write(af.dump_csv_line2(rows))

    counter = 0
    natural_sample1_aaSum = 0
    natural_sample2_aaSum = 0

    for i in range(0, m):  #Calculates the site frequency data
        natural_aaCount = []
        designed_aaCount = []
        natural_sample1_aaCount = []
        natural_sample2_aaCount = []
        #covert back to list so we can use the "count" method
    if(debug):
        print len(natural_sample2_data[i])
    natural_sample2_data = np.array(natural_sample2_data, dtype = object)

    #snag the RSA values
    RSA = natural_data[0]

    #get a list of char amino acid codes
    AA = resdict.values()
    #print "Dimensions of array {}".format(natural_data.ndim)

    n,m = natural_data.shape
    n_sample1, m_sample = natural_sample1_data.shape
    #Open .dat files that you will write the results to.
    natural_sample1_fpW = open("align_natural_sample1_data_array_ordered_" + pdb_id + "_" + chain_id + ".dat","w")
    natural_sample1_fpW.write(af.dump_csv_line2(rows))
    natural_sample2_fpW = open("align_natural_sample2_data_array_ordered_" + pdb_id + "_" + chain_id + ".dat","w")
    natural_sample2_fpW.write(af.dump_csv_line2(rows))

    counter = 0
    natural_aaSum = 0
    designed_aaSum = 0
    natural_sample1_aaSum = 0
    natural_sample2_aaSum = 0
		  
    for i in range(0,m):
        natural_aaCount = []
        designed_aaCount = []
        natural_sample1_aaCount = []
        natural_sample2_aaCount = []
        #covert back to list so we can use the "count" method
    #if(debug):
    #    print len(designed_data[i])
    designed_data = np.array(designed_data, dtype = object)

    #snag the RSA values
    RSA = natural_data[0]

    #get a list of char amino acid codes
    AA = resdict.values()
    #print "Dimensions of array {}".format(natural_data.ndim)
    n,m = natural_data.shape

    #Open .dat files that you will write the results to.
    natural_fpW = open("align_natural_data_array_ordered_" + pdb_id + "_" + chain_id + ".dat","w")
    natural_fpW.write(af.dump_csv_line2(rows))
    designed_fpW = open("align_data_array_ordered_" + pdb_id + "_" + chain_id + "_" + "soft" + ".dat","w")
    designed_fpW.write(af.dump_csv_line2(rows))

    counter = 0
    natural_aaSum = 0
    designed_aaSum = 0
    aaCutOff = 0 #This is cut-off. If a site has less than this percent of amino acids left after taking out the gaps do not use that site in the analysis. 			  
    for i in range(0,m): #This blocks calculates the site frequency data 
        natural_aaCount = [] 
        designed_aaCount = []
        #covert back to list so we can use the "count" method
        try:
            natural_aaList = list(natural_data[1:,i])
            designed_aaList = list(designed_data[1:,i])
        except IndexError:
        RSA = natural_data[0]

        #get a list of char amino acid codes
        AA = resdict.values()
        #print "Dimensions of array {}".format(natural_data.ndim)

        n, m = natural_data.shape
        n_d, m_d = designed_data.shape
        #print "Natural Protein Length", m
        #print "Designed Protein Length", m_d
        designed_protein_lengths.append(m_d)
        #Open .dat files that you will write the results to.
        natural_fpW = open(
            "align_natural_data_array_" + pdb_id + "_" + chain_id + ".dat",
            "w")
        natural_fpW.write(af.dump_csv_line2(rows))
        designed_fpW = open(
            "align_data_array_" + pdb_id + "_" + chain_id + "_" + method +
            ".dat", "w")
        designed_fpW.write(af.dump_csv_line2(rows))

        counter = 0
        natural_aaSum = 0
        designed_aaSum = 0
        aaCutOff = 0  #This is cut-off. If a site has less than this percent of amino acids left after taking out the gaps do not use that site in the analysis.
        for i in range(0, m):  #This blocks calculates the site frequency data
            natural_aaCount = []
            designed_aaCount = []
            #covert back to list so we can use the "count" method
            try:
                natural_aaList = list(natural_data[1:, i])