proteins_df["Heavy/Medium"] = np.divide(proteins_df["Heavy/Light"], proteins_df["Medium/Light"]) peptides_df = pd.ExcelFile(peptides).parse("Sheet1") peptides_df = peptides_df[columns] peptides_df["Heavy/Medium"] = np.divide(peptides_df["Heavy/Light"], peptides_df["Medium/Light"]) peptides_df["isPhospho"] = pd.notnull(peptides_df["phosphoRS Isoform Probability"]) phospho_peptides = peptides_df[peptides_df["isPhospho"]==True].copy() regular_peptides = peptides_df[peptides_df["isPhospho"]==False].copy() # annotate sequence_window cutils.add_seq_window(phospho_peptides, FASTA_dic) #transform the ratios to log10 cutils.computelog(phospho_peptides) cutils.computelog(regular_peptides) cutils.computelog(proteins_df) #add phosphosite plus site information cutils.add_known_pssite(phospho_peptides, phosphositeDB, FASTA_dic) #delete non-existing columns del_columns = ['Medium/Light', 'Heavy/Medium', u'log10ML', u'log10HM'] for del_i, df_i in zip(del_columns, [peptides_df, phospho_peptides, regular_peptides]): try: del df_i[del_i] except: pass #==========================================================================
peptides_df["isPhospho"] = pd.notnull(peptides_df["phosphoRS Isoform Probability"]) phospho_peptides = peptides_df[peptides_df["isPhospho"]==True].copy() regular_peptides = peptides_df[peptides_df["isPhospho"]==False].copy() if invert: print "inverting ratios...." phospho_peptides["Heavy/Light"] = 1 / phospho_peptides["Heavy/Light"] regular_peptides["Heavy/Light"] = 1 / regular_peptides["Heavy/Light"] # annotate sequence_window cutils.add_seq_window(phospho_peptides, FASTA_dic) #transform the ratios to log10 cutils.computelog(phospho_peptides, ratio_columns=["Heavy/Light"]) cutils.computelog(regular_peptides, ratio_columns=["Heavy/Light"]) cutils.computelog(proteins_df, ratio_columns=["Heavy/Light"]) #add phosphosite plus site information cutils.add_known_pssite(phospho_peptides, phosphositeDB, FASTA_dic) #delete non-existing columns del_columns = ['Medium/Light', 'Heavy/Medium', u'log10ML', u'log10HM'] for del_i, df_i in zip(del_columns, [peptides_df, phospho_peptides, regular_peptides]): try: del df_i[del_i] except: pass #==========================================================================