welch-lab / liger

R package for integrating and analyzing multiple single-cell datasets
GNU General Public License v3.0
392 stars 78 forks source link

fix setting defaultDimRed #321

Open samuel-marsh opened 2 months ago

samuel-marsh commented 2 months ago

Hi LIGER team,

Just quick PR here to fix issue. Right now runTSNE and runUMAP don't appropriately update the default dim reduc when a dimreduc is already present in object (for instance if seurat object with reductions is converted to liger object). This PR just adds single line to each of the functions to explicitly update the dim reduc after being run.

Thanks! Sam

mvfki commented 2 months ago

Hi Sam,

Thank you for being our active user! Indeed I have found this a problem a while ago and have already got a fix in my dev branch. Would you mind have a look in my forked repo "mvfki/liger" in master branch and see if that looks like working fine?

Best, Yichen

mvfki commented 2 months ago

So basically I got one more step before setting. If the defaultDimRed is set, don't update it by default unless explicitly asked with asDefault. If defaultDimRed is NULL, just set the result as defaultDimRed.