def importCherryPickingTaq(self): """Taq""" title = "Choose cherrypicking file..." cherryFile, f = QtGui.QFileDialog.getOpenFileName(self, title, self.path) title = "Choose lightcycler files..." filter_mask = "Lightcycler text files (*.txt)" lightFileNames, f = QtGui.QFileDialog.getOpenFileNames(self, title, self.path, filter_mask) fileDataLists, ok = LCDialog.importLC(lightFileNames) lc = pd.read_excel(cherryFile, sheetname="All") lc = lc[["Source plate", "Dest plate", "Source Well", "Destination Well"]] lc.columns = ["Plate ID", "CP Plate", "Well", "CP Well"] lc["LC Well"] = "" lc["Result"] = "" lc["Experiment"] = "" lc = lc.set_index(["CP Plate", "CP Well"]) for fDL in fileDataLists: name, plate, exp, robot, pos = fDL lcFrame = pd.read_table(name, sep="\t", header=1) lcFrame = lcFrame.drop(["Include", "Color", "Name", "Status", "465-510", "533-580", "Score"], 1) lcFrame["Experiment"] = exp lcFrame["CP Plate"] = plate lcFrame["CP Well"] = lcFrame["Pos"].map(lambda x: convert[robot][pos].get(x, "")) lcFrame["Call"] = lcFrame["Call"].astype(str) lcFrame.columns = ["LC Well", "Result", "Experiment", "CP Plate", "CP Well"] lcFrame = lcFrame[lcFrame["CP Well"] != ""] lcFrame = lcFrame.set_index(["CP Plate", "CP Well"]) lc.update(lcFrame) lc = lc.set_index(["Plate ID", "Well"]) lc = lc[lc["Result"] != ""] self.resultsTable.table = self.resultsTable.table.set_index(["Plate ID", "Well"]) self.resultsTable.table.update(lc) self.resultsTable.table = self.resultsTable.table.reset_index() self.__updateView()
def importTaqmanFile(self): """Imports Taqman .txt files and adds the results, locating samples by plate name (taken from filename) and well.""" title = "Import Taqman file(s)..." filter_mask = "Taqman text files (*.txt)" lightFileNames, f = QtGui.QFileDialog.getOpenFileNames(self, title, self.path, filter_mask) fileDataLists, ok = LCDialog.importLC(lightFileNames) if ok: self.resultsTable.addTaqFiles(fileDataLists) self.__updateView()