dynamo-release
dynamo-release copied to clipboard
ss estimate refactor
-
optimized the multiprocessing by switching from ThreadPool to a process pool that utilizes cores instead of threads. This change significantly improved the operating time:
- Previous operating time: 5.573467457999996
- After optimization time : 2.393449375000003
-
removed some duplicated code and simplified the existing code.
this is excellent, Ukyeon! Can you please show me some benchmark on this? Let us also confirm the resulting parameters are the same after your updates?
The resulting parameters are the same after the updates..
est = ss_estimation() # After est2 = ss_estimation_prev() # Before
np.array_equal(est.parameters["gamma"], est2.parameters["gamma"]) True np.array_equal(est.aux_param["gamma_intercept"], est2.aux_param["gamma_intercept"]) True np.array_equal(est.aux_param["gamma_r2"], est2.aux_param["gamma_r2"]) True np.array_equal(est.aux_param["gamma_logLL"], est2.aux_param["gamma_logLL"]) True np.array_equal(est.aux_param["bs"], est2.aux_param["bs"]) True np.array_equal(est.aux_param["bf"], est2.aux_param["bf"]) True
// After adata.uns["dynamics"] {'filter_gene_mode': 'final', 't': None, 'group': None, 'X_data': None, 'X_fit_data': None, 'asspt_mRNA': 'ss', 'experiment_type': 'conventional', 'normalized': True, 'model': 'stochastic', 'est_method': 'gmm', 'has_splicing': True, 'has_labeling': False, 'splicing_labeling': False, 'has_protein': False, 'use_smoothed': True, 'NTR_vel': False, 'log_unnormalized': True, 'fraction_for_deg': False}
// Before adata.uns["dynamics"] {'filter_gene_mode': 'final', 't': None, 'group': None, 'X_data': None, 'X_fit_data': None, 'asspt_mRNA': 'ss', 'experiment_type': 'conventional', 'normalized': True, 'model': 'stochastic', 'est_method': 'gmm', 'has_splicing': True, 'has_labeling': False, 'splicing_labeling': False, 'has_protein': False, 'use_smoothed': True, 'NTR_vel': False, 'log_unnormalized': True, 'fraction_for_deg': False}