Entering edit mode
17 months ago
camillab.
▴
160
Hi,
I would like to use the Leiden algorithm on my scRNAseq to identify the clusters but I cannot run the algorithm. If I use the default one I have no problem. I tried :
FindClusters(immune.combined, resolution = 0.3, algorithm = 4)
but it gives me this error:
Error: Cannot find Leiden algorithm, please install through pip (e.g. pip install leidenalg).
In addition: Warning message:
In system2(command = python, args = shQuote(script), stdout = TRUE, :
running command ''/Users/camilla/.virtualenvs/r-reticulate/bin/python' '/Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/library/reticulate/config/config.py' 2>/dev/null' had status 1
I have reticulate
package but when I try to install leidenAlg
it install it in a folder I have never seen
The downloaded binary packages are in
/var/folders/w2/826prqh14cq_pjljhh87q2lh0000gq/T//RtmpkPBi5K/downloaded_packages
and when I try to load it :
library(reticulate)
library('leidenAlg')
library(Matrix)
it gives me this error:
Loading required package: Matrix
Error in value[[3L]](cond) :
Package ‘Matrix’ version 1.5.4.1 cannot be unloaded:
Error in unloadNamespace(package) : namespace ‘Matrix’ is imported by ‘SummarizedExperiment’, ‘SeuratObject’, ‘uwot’, ‘S4Arrays’, ‘spatstat.data’, ‘survival’, ‘spatstat.explore’, ‘DelayedArray’, ‘leiden’, ‘TFisher’, ‘irlba’, ‘reticulate’, ‘spatstat.sparse’, ‘sctransform’, ‘Seurat’ so cannot be unloaded
Why it gives me so many errors? How can I solve it? How can I install pip install leidenalg on R studio?
Thank you
Camilla
thank you! but now it gives me this error :
Maybe a compiler error, impossible to know without more info. Make sure
gcc
andg++
are installed on your system.I'd probably just make a new environment and install it with conda. Read more here.
leidenalg
is available via conda in conda-forge.