def main(): args = parse_command_line_arguments() init_logging(args.debug) x0, y0 = get_data_from_fcs(args.original_file, args.x, args.y) x1, y1 = get_data_from_csv(args.converted_file, args.x, args.y) x2 = logicle(x0) fig = plt.figure() ax0 = fig.add_subplot(2, 2, 1) ax1 = fig.add_subplot(2, 2, 2) ax2 = fig.add_subplot(2, 2, 3) heatmap2d(ax0, x0, y0) heatmap2d(ax1, x2, y0) heatmap2d(ax2, x1, y1) ax0.set_xlabel(args.x) ax0.set_ylabel(args.y) ax0.set_title('Original FCS') ax1.set_xlabel(args.x) ax1.set_ylabel(args.y) ax1.set_title('Processed with our implementation') ax2.set_xlabel(args.x) ax2.set_ylabel(args.y) ax2.set_title('Processed by FCSTrans') logger_.info('Plot ready') plt.show()
def LogicleOp(data, indices, inputs): m = inputs['M'] * log(10) # convert from log10 to log for i in indices: d = data[:, i] r = quantile(d[d<0], inputs['r']) data[:, i] = logicle(data[:, i], inputs['T'], m, r)
w = (m-log(T/abs(r)))/2 pylab.clf() pylab.figtext(0.5, 0.94, 'Logicle transform with r=%.2f, d=%d and T=%d\nData is normal(0, 50, 50000) + lognormal(8, 1, 50000)' % (r, d, T), va='center', ha='center', fontsize=12) pylab.subplot(3,1,1) x = arange(0, m, 0.1) pylab.plot(x, S(x, 0, T, m, w)) locs, labs = pylab.xticks() pylab.xticks([]) pylab.yticks([]) pylab.ylabel('Inverse logicle') pylab.subplot(3,1,2) pylab.hist(d3, 1250) locs, labs = pylab.xticks() pylab.xticks([]) pylab.yticks([]) pylab.ylabel('Raw data') pylab.subplot(3,1,3) pylab.hist(logicle(d3, T, m, r), 1250) locs, labs = pylab.xticks() pylab.xticks([]) pylab.yticks([]) pylab.ylabel('Data after transform') # pylab.savefig('logicle.png') pylab.show()