theislab / scib

Benchmarking analysis of data integration tools
MIT License
283 stars 62 forks source link

Ensure essential packages are not detached! #402

Open zhongzheng1999 opened 4 months ago

zhongzheng1999 commented 4 months ago

In this branch, I removed the part detaching packages in scib.pp.normalize because it would lead to unpredictable errors when using rpy2 to run R code. After learning from my own experience, I want to advise against detaching R packages casually. Instead, after deleting rm(list=ls()), running gc() usually suffices. A simple example: in the final part ofscib.pp.normalize, detaching most R packages, including scran and its dependency package S4Vector, would result in errors such as "cannot coerce class 'integer' to a DataFrame" if a loop code block is set up. Even if you reload scran (which depends on S4Vector) or S4Vector, the error persists and can only be resolved by restarting your kernel. Next, I'll demonstrate this issue with a simple example.

example.md