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.
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 deletingrm(list=ls())
, runninggc()
usually suffices. A simple example: in the final part ofscib.pp.normalize
, detaching most R packages, includingscran
and its dependency packageS4Vector
, would result in errors such as "cannot coerce class 'integer' to a DataFrame" if a loop code block is set up. Even if you reloadscran
(which depends onS4Vector
) orS4Vector
, the error persists and can only be resolved by restarting your kernel. Next, I'll demonstrate this issue with a simple example.example.md