def _index(self, dirPath): for file in os.listdir(dirPath): if not file.endswith(".plp"): continue id = Uniprot.strip(file) if id : self.index[id] = dirPath + "/" + file
def get(self, string = None, header=None, aminoAcidSeq=None): id = Uniprot.strip(string) try : if not id: raise noIdError() if not self.index[id]: raise noIndexError(id) except noIdError: print "No protein identifier found to search tmhmm index from string " + string return None except noIndexError as e: print "No file found in index for protein identifier " + e.id + " striped from string " + string return None stateList = self.parse(self.index[id], id) return stateList