comparison curve_fitting.py @ 5:e0af18405e37 draft

planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/curve_fitting/ commit cd63bc5e6eb7254111012209fac9154569355f20
author imgteam
date Tue, 19 Jul 2022 08:51:41 +0000
parents 8bf2c507af3a
children
comparison
equal deleted inserted replaced
4:004c57179c61 5:e0af18405e37
66 diff = np.array([], dtype=('float64')) 66 diff = np.array([], dtype=('float64'))
67 for i in range(nSpots): 67 for i in range(nSpots):
68 seq = data_all[i][:, -1] 68 seq = data_all[i][:, -1]
69 seq_fit = seq.copy() 69 seq_fit = seq.copy()
70 idx_valid = ~np.isnan(seq) 70 idx_valid = ~np.isnan(seq)
71 seq_fit[idx_valid] = curve_fitting(seq[idx_valid], degree=2, penalty='abs') 71 seq_fit[idx_valid] = curve_fitting(seq[idx_valid], degree=degree, penalty=penalty)
72 data_all[i] = np.concatenate((data_all[i], seq_fit.reshape(-1, 1)), axis=1) 72 data_all[i] = np.concatenate((data_all[i], seq_fit.reshape(-1, 1)), axis=1)
73 if alpha > 0: 73 if alpha > 0:
74 diff = np.concatenate((diff, seq_fit[idx_valid] - seq[idx_valid])) 74 diff = np.concatenate((diff, seq_fit[idx_valid] - seq[idx_valid]))
75 75
76 # add assistive curve 76 # add assistive curve