broadinstitute / infercnv

Inferring CNV from Single-Cell RNA-Seq
Other
557 stars 164 forks source link

Error: Python module igraph was not found. #512

Closed AntoniaChroni closed 1 year ago

AntoniaChroni commented 1 year ago

Hey,

I am having this error:

Error: Python module igraph was not found. Detected Python configuration: Execution halted

When I look at the output the issue arises in Step 15. Any insights on what might be happening?

STEP 15: computing tumor subclusters via leiden

INFO [2023-02-22 15:56:57] define_signif_tumor_subclusters(p_val=0.1 INFO [2023-02-22 15:56:57] define_signif_tumor_subclusters(), tumor: all_observations List of 20 $ python : chr "./.conda/envs/myenv/bin/python3" $ libpython : chr "./.conda/envs/myenv/lib/libpython3.10.so" $ pythonhome : chr "./.conda/envs/myenv:/gpfs/home/chrona01/.conda/envs/myenv" $ pythonpath : chr "/gpfs/share/apps/R/4.1.2/lib64/R/library/reticulate/config:./.conda/envs/myenv/lib/python310."| truncated $ prefix : chr "./.conda/envs/myenv" $ exec_prefix : chr "./.conda/envs/myenv" $ base_exec_prefix : chr "./.conda/envs/myenv" $ virtualenv : chr "" $ virtualenv_activate : chr "" $ version_string : chr "3.10.6 | packaged by conda-forge | (main, Aug 22 2022, 20:36:39) [GCC 10.4.0]" $ version : chr "3.10" $ architecture : chr "64bit" $ anaconda : logi FALSE $ conda : logi TRUE $ numpy :List of 2 ..$ path : chr "./.conda/envs/myenv/lib/python3.10/site-packages/numpy" ..$ version:Class 'numeric_version' hidden list of 1 .. ..$ : int [1:3] 1 23 5 $ required_module : chr "numpy" $ required_module_path: chr "./.conda/envs/myenv/lib/python3.10/site-packages/numpy" $ available : logi TRUE $ python_versions : chr [1:4] "./.conda/envs/myenv/bin/python3" "/gpfs/home/chrona01/.conda/envs/myenv/bin/python" "/gpfs/share/apps/miniconda3/cpu/4.9.2/bin/python" "./.virtualenvs/r-reticulate-gotcha/bin/python" $ forced : NULL

Thank you! Tonia

GeorgescuC commented 1 year ago

Hi @AntoniaChroni ,

You seem to be using an older version of infercnv that still uses the Python implementation of the Leiden algorithm that is not properly supported anymore. If you update infercnv (you might also need to update R since it looks like you are on version 4.1.2 while the current is 4.2.2) this should not be an issue anymore since we now use the R version of igraph.

Regards, Christophe.

AntoniaChroni commented 1 year ago

Is this a conflict between a newer version of r/4.2.2 vs r/4.1.2?

GeorgescuC commented 1 year ago

Hi @AntoniaChroni ,

The older version of infercnv used an R library 'leiden" that relied on the Python library "leidenalg" that itself relied on "igraph", but the first one is not maintained anymore as "igraph" now has support for the Leiden algorithm directly in its R version. Because of this, we shifted to using exclusively the R version as it removes a lot of potential (and common) issues with setting up the Python environment that R would use. The reason why I said you might need to update to R 4.2.2 is that packages are maintained for the current version of R, so you might be limited to older versions if your R version is not up to date. Infercnv itself should still work on any R above version 4.0 if you install from source, but versions are in sync with BioConductor releases which are themselves in sync with R releases. Being on an older R version might limit which versions you are able to install through the automated methods.

Regards, Christophe.

AntoniaChroni commented 1 year ago

Creating a new conda environment and installing infercnv via bioconductor in there, fixed this issue.