diff --git a/environment.yaml b/environment.yaml index 03446ea..02f93ca 100644 --- a/environment.yaml +++ b/environment.yaml @@ -16,7 +16,7 @@ dependencies: - scikit-image - matplotlib==3.9.3 - opencv_python==4.10.0.84 - - metrics==0.3.3 + - metrics==0.0.2 - imageio==2.9.0 - Pillow==11.0.0 - imageio-ffmpeg==0.4.2 @@ -31,4 +31,4 @@ dependencies: - seaborn==0.13.2 - shap==0.46.0 - timm==1.0.12 - - tqdm==4.66.5 \ No newline at end of file + - tqdm==4.66.5 diff --git a/test/SpaIM_imputation.py b/test/SpaIM_imputation.py index ba12c04..fc508de 100644 --- a/test/SpaIM_imputation.py +++ b/test/SpaIM_imputation.py @@ -62,13 +62,13 @@ 'scx': seq, 'st_style': st_style } - # print('SCX:', inputs['scx'].shape, len(st_style)) - model.set_input(inputs, istrain=0) - out = model.inference() - impute_result = out['st_fake'].detach().cpu().numpy() - print("impute_result",impute_result.shape) # (3482, 67798) torch.Size([3482, 67798]) - eval_result = impute_result if eval_result is None else np.concatenate((eval_result, impute_result), axis=0) - print("eval_result", eval_result.shape) # (3482, 77890) (3482, 77890) + # print('SCX:', inputs['scx'].shape, len(st_style)) + model.set_input(inputs, istrain=0) + out = model.inference() + impute_result = out['st_fake'].detach().cpu().numpy() + print("impute_result",impute_result.shape) # (3482, 67798) torch.Size([3482, 67798]) + eval_result = impute_result if eval_result is None else np.concatenate((eval_result, impute_result), axis=0) + print("eval_result", eval_result.shape) # (3482, 77890) (3482, 77890) eval_result = eval_result.T @@ -77,5 +77,5 @@ # print(gene_names.shape) # 检查 gene_names 的形状 # print(cell_names.shape) # 检查 cell_names 的形状 -df1 = pd.DataFrame(eval_result, index=cell_names, columns=gene_names) +df1 = pd.DataFrame(eval_result.T, index=cell_names, columns=gene_names) df1.to_pickle(os.path.join(opt.save_path, 'impute_sc_result_%d.pkl'%(opt.kfold)))