lb.append(x) del buf return lb outputs = ['ex1', 'ex1a', 'ex2', 'ex3', 'ex4', 'ex5', 'ex6'] # load data fnms = ['neg.csv', 'pos.csv'] for dirnm in outputs: read = [] path = "./" + dirnm + "/" for x in fnms: read.append( lcsv(path + x, delim = ',', quote = '"', blank_str = 'Blank', qc_str = None, sample_str = 'Sample') ) neg = read[0] pos = read[1] lab = load_labels(path + 'labels.dat') np.savez_compressed(path+dirnm, negmz = neg[0], posmz = pos[0], negrt = neg[1], posrt = pos[1], negbl = neg[2], posbl = pos[2], negsp = neg[4], possp = pos[4], label = lab) exit() # construct appropriate input mza = 100.
rootdir = "./data/peak_tables/" dirnms = [x[0] for x in os.walk(rootdir)] dirnms = filter(lambda x: "batch" in x, dirnms) dirnms.sort() read = [] for curdir in dirnms: fnms = os.listdir(curdir) fnms.sort() fnms = filter(lambda x: x.endswith(".csv"), fnms) fnms = filter(lambda x: x != "sample_batch.csv", fnms) part_read = [] for x in fnms: part_read.append(lcsv(curdir + "/" + x)) print x read.append(part_read) # construct appropriate input exp_file = "./data/sample_batch.csv" # meaningful_interval = # 1 26 # 1 26 # blank, flav, trial = loadpar(exp_file) # exit()