labomics / midas

MIT License
41 stars 5 forks source link

How to choose the --act for missing modality imputation task? #7

Closed XiHuYan closed 5 months ago

XiHuYan commented 5 months ago

Hi, I have two questions: 1) I noticed that using --act predict_all_latent_bc can output x_bc folder which contains the imputed missing modality features. But It seems MIDAS has a mode named translate which can also impute missing modality features. If I have one batch that's only measured with RNA modality and I wanna impute its ATAC features. Which --act should I use? Can i directly use the x_bc output? 2) If I wanna evaluate the imputed features with ground truth, can i use the outputs in x_bc folder?

Thanks.

zhen-he commented 5 months ago

Hello,

If your goal is solely imputation without the need for batch correction, I recommend using the translate function. The x_bc folder holds data that has been both imputed and batch-corrected.

It's important to note that when MIDAS generates batch-corrected data from the latent variables $c$ and $u$, it standardizes $u$ across all cells to a common value (specifically, the mean). This standardization occurs even if there is only one batch present. As a result, the modified $u$ can cause the generated data to significantly diverge from the original ground truth. Consequently, this alteration can markedly degrade the quality of the imputation.

XiHuYan commented 5 months ago

But it seems that MIDAS can only perform 'translate' action for three-modalities case, according to code in the module.utils.py. My dataset only has two modalities.

XiHuYan commented 5 months ago

Ah, I see. If I comment out the "double-to-single translate" operation in utils.py and run.py, I can run MIDAS correctly.