def getBOWfeature(file,num): hydrophobicity =[] peptide_length = [] psmDescriptions, aaAlphabet = el.processTrainData(file) Index = rm.buildRetentionIndex(aaAlphabet,psmDescriptions,True) customIndex = dict(zip(aaAlphabet, Index)) for i, psmd in enumerate(psmDescriptions): aas = dm.getAminoAcidList(psmd.peptide) peptide_length.append(len(psmd.peptide)) hydrophobicity.append(bowindexSum(aas, customIndex)) peptide,rt = dg.extract(psmDescriptions,len(psmDescriptions)) bow_feature = BOW(peptide,hydrophobicity,peptide_length,aaAlphabet,num) return psmDescriptions ,bow_feature
def get_elude_model(self): aaAlphabet = self.amino_acid_list() normalizeRetentionTimes = True customIndex = rm.buildRetentionIndex(aaAlphabet, self.peptides, normalizeRetentionTimes) return elute_model(aaAlphabet, customIndex)
def trainRetentionModel(aaAlphabet, psmDescriptions): customIndex = rm.buildRetentionIndex(aaAlphabet, psmDescriptions, normalizeRetentionTimes) return dict(zip(aaAlphabet, customIndex))