start = []
    end = []
    for index, row in Pepfrags.iterrows():
        start.append(int(row['Start']))
        end.append(int(row['End']))
    start = np.array(start)
    end = np.array(end)
    return start, end


#b2m test data
ex_indata = pd.read_excel(args.excelin)
Protein_name = ex_indata['Protein'].unique()
b2m_kint = get_kint(B2m_seq, args.temp, args.pD)
b2m_Pepfrags = PepFrag_find(Protein_name[2], args.state, time, args.excelin) #selects b2m as input name for subset, 1 is nan
b2m_Pepfrags_uptake = PepFrag_uptake(Protein_name[2], args.state, time, args.excelin)
b2m_Pepfrags_uptake = b2m_Pepfrags_uptake.to_numpy()
b2m_Pval = get_expPval(b2m_Pepfrags, b2m_Pepfrags_uptake, b2m_kint, Protein_name[2])
b2m_start, b2m_end = get_pepstartend(b2m_Pepfrags)

#Input training Peptide DU data
ex_indata = pd.read_excel(args.excelin)
Protein_name = ex_indata['Protein'].unique()
kint = get_kint(Seq, args.temp, args.pD)
Pepfrags = PepFrag_find(Protein_name[0], args.state, time, args.excelin)
Pepfrags_uptake = PepFrag_uptake(Protein_name[0], args.state, time, args.excelin)
Pepfrags_uptake = Pepfrags_uptake.to_numpy()
Pval = get_expPval(Pepfrags, Pepfrags_uptake, kint, Protein_name[0])
Start, End = get_pepstartend(Pepfrags)

#Input Histogram Data
Exemple #2
0
    def __init__(self, inputdata):
        #Set custom parameters for specific model
        self.time = 0.5
        self.HM8_modelparams = [
            3.28979445e-08, 1.98441207e+00, 8.96847944e+00, -2.58808757e-01
        ]

        #Create empty result objects
        self.Pval_exp = []
        self.Pval_pred = []

        #load simulation histogram data
        self.SASA = np.load('dist_sasa_20bins/SASA_hist.npy',
                            allow_pickle=True)
        self.DIST = np.load('dist_sasa_20bins/DIST_hist.npy',
                            allow_pickle=True)

        #Load experimental peptide fragment data
        ex_indata = pd.read_excel(inputdata)
        Protein_name = ex_indata['Protein'].unique()
        Pepfrags = PepFrag_find(Protein_name[0], args.state, self.time,
                                args.excelin)
        Pepfrags_uptake = PepFrag_uptake(Protein_name[0], args.state,
                                         self.time, args.excelin)
        self.fitting_data = Pepfrags_uptake.to_numpy()

        #Calculate intrinsic protection factors
        self.Seq = 'MGSHSMRYFFTSVSRPGRGEPRFIAVGYVDDTQFVRFDSDAASQRMEPRAPWIEQEGPEYWDGETRKVKAHSQTHRVDLGTLRGYYNQSEAGSHTVQRMYGCDVGSDWR' \
              'FLRGYHQYAYDGKDYIALKEDLRSWTAADMAAQTTKHKWEAAHVAEQLRAYLEGTCVEWLRRYLENGKETLQRTDAPKTHMTHHAVSDHEATLRCWALSFYPAEITLT' \
              'WQRDGEDQTQDTELVETRPAGDGTFQKWAAVVVPSGQEQRYTCHVQHEGLPKPLTLRWE'
        self.kint = []
        for counter, aminoacid in enumerate(self.Seq[0:len(self.Seq)]):
            self.kint.append(
                calc_kint_Alt(self.Seq[counter], self.Seq[counter - 1],
                              int(args.temp), int(args.pD), counter,
                              len(self.Seq)))

        #Calculate P-factors for experimental peptide fragments
        count = 0
        Pval = []
        for index, row in Pepfrags.iterrows():
            print(row)
            kintval = []
            if row['End'] > len(self.kint):
                continue
            for j in range(int(row['Start']), int(row['End'])):
                kintval.append(self.kint[j])
            kintval_avg = np.array(kintval).mean()
            v1 = (self.fitting_data[count])
            v2 = -1 * (v1 - 1)
            v3 = log(v2) / self.time
            P_factor = -1 * (kintval_avg) / v3
            lnPF = log(P_factor)
            Pval.append(lnPF)
            count += 1
        self.count = count
        self.Pval_exp = Pval

        start = []
        end = []
        for index, row in Pepfrags.iterrows():
            start.append(int(row['Start']))
            end.append(int(row['End']))
        self.start = np.array(start)
        self.end = np.array(end)