def cpLstExtdFiles(listfn, pathfrom, pathto, extds): """ get a list of names, copy the corresponding files with a certain extd name to another dir """ from suffix import getAbsPaths_multi_extd, checkPaths import shutil lst = getLst(listfn) for fn in lst: rootdir = os.path.join(pathfrom, fn) fullnames = getAbsPaths_multi_extd(rootdir, extds) checkPaths(fullnames) for fullname in fullnames: shutil.copy(fullname, pathto)
def collectSvrData(self): """ construct the data chart for SVR, use the -all-DecoyRepEner.txt only """ raw_data_paths = suffix.getAbsPaths_multi_extd(self.raw_data_dir, self.extds[-1:]) suffix.checkPaths(raw_data_paths) tmp_data = [] for file in raw_data_paths: tmp_data.append(pd.read_csv(file)) self.svr_sheet = pd.concat(tmp_data, ignore_index=True) self.svr_sheet.headers = self.rep_ener_columns self.svr_sheet = self.svr_sheet.drop(['Unnamed: 0'], axis=1) # rule out trash columns self.svr_sheet = self.svr_sheet.sort(columns='mcc', ascending=False) self.svr_sheet.index = range(len(data.index)) ofn = self.svr
def collectSvcData(self): """ construct the data chart for SVC, only the -high-DecoyRepEner.txt and -low-DecoyRepEner.txt used """ raw_data_paths = suffix.getAbsPaths_multi_extd(self.raw_data_dir, self.extds[0:2]) # high and low #raw_data_paths = suffix.getAbsPaths_multi_extd(self.raw_data_dir, self.extds[0:1]) # only high, for testing suffix.checkPaths(raw_data_paths) tmp_data = [] for file in raw_data_paths: tmp_data.append(pd.read_csv(file)) self.svc_sheet = pd.concat(tmp_data, ignore_index=True) self.svc_sheet.headers = self.rep_ener_columns self.svc_sheet = self.svc_sheet.drop(['Unnamed: 0'], axis=1) # rule out trash columns self.svc_sheet = self.svc_sheet.sort(columns='mcc', ascending=False) self.svc_sheet.index = range(len(self.svc_sheet.index)) ofn = self.svc