Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

orderCells function fails due to deprecated nei() call** #738

Open
weissnichtwo opened this issue Oct 20, 2024 · 7 comments
Open

orderCells function fails due to deprecated nei() call** #738

weissnichtwo opened this issue Oct 20, 2024 · 7 comments
Labels
bug Something isn't working

Comments

@weissnichtwo
Copy link

Description:
When I run the orderCells function, I encounter an error because it is trying to call the nei() function, which has been deprecated in igraph version 2.1.0 and is now defunct.

Steps to reproduce:

  1. Load the monocle and igraph libraries.
  2. Create a CDS object (e.g., mycds).
  3. Run mycds <- orderCells(mycds).

Error message:
! nei() was deprecated in igraph 2.1.0 and is now defunct.
ℹ Please use .nei() instead.
Run rlang::last_trace() to see where the error occurred.

Expected behavior:
The orderCells function should run without errors and return the ordered cells.

Actual behavior:
The function fails with the above-mentioned error message.

Session info:

  • R version: 4.4.1
  • monocle version: 2.32.0
  • igraph version: 2.1.1

Reproducible example:

library(igraph)
library(monocle)

# Assuming mycds is a valid CDS object
mycds <- orderCells(mycds)
Thank you for your help!
@weissnichtwo weissnichtwo added the bug Something isn't working label Oct 20, 2024
@szhaoaf
Copy link

szhaoaf commented Oct 21, 2024

As the error said, ! nei() was deprecated in igraph 2.1.0 and is now defunct. The igraph version: 2.1.1 version accounts for the error.

To solve this issue, simply downgrading igraph can work.

https://cran.rstudio.com/bin/macosx/big-sur-arm64/contrib/4.2/igraph_2.0.3.tgz

Go to above link and install the 2.0.3 version, restart the R session. Then it solved for me.

> gbm_cds <- orderCells(gbm_cds)
Warning messages:
1: In dfs(graph = graph, root = root, mode = mode, unreachable = unreachable,  :
  Argument `neimode' is deprecated; use `mode' instead
2: In dfs(graph = graph, root = root, mode = mode, unreachable = unreachable,  :
  Argument `neimode' is deprecated; use `mode' instead

Session info:

sessionInfo()
R version 4.4.1 (2024-06-14)
monocle_2.32.0
igraph_2.0.3

Bests

@maelle
Copy link

maelle commented Oct 22, 2024

In which package is nei() used? In that package, it can simply be replaced by .nei() which is the name of the function in igraph. Happy to make a PR to the relevant repository if you give me the link. 😸

@Hunkhuyu
Copy link

cds<- orderCells(cds, root_state = NULL, num_paths = NULL, reverse = NULL)
error in lazy_dots(..., .follow_symbols = FALSE):
comand not found 'make_lazy_dots'
(the problem then i meet)

@maelle
Copy link

maelle commented Nov 18, 2024

@Hunkhuyu I'm sorry to hear about that. Would you mind preparing a small reproducible example so I might look into it more efficiently? See https://reprex.tidyverse.org/articles/reprex-dos-and-donts.html Thank you!

@szhorvat
Copy link

szhorvat commented Nov 18, 2024

@Hunkhuyu There is no make_lazy_dots in igraph 2.1.1. If you see such an error, you must be using an older version. Make sure you are using the latest version.

@szhaoaf
Copy link

szhaoaf commented Nov 18, 2024

In which package is nei() used? In that package, it can simply be replaced by .nei() which is the name of the function in igraph. Happy to make a PR to the relevant repository if you give me the link. 😸

Dear Maelle,

Thank you for your information and sorry to miss your reply.
I guess it would be one of the below packages using .nei() function.

detach("package:igraph", unload = TRUE)
Warning message:
‘igraph’ namespace cannot be unloaded:
namespace ‘igraph’ is imported by ‘leiden’, ‘leidenbase’, ‘monocle’, ‘Seurat’ so cannot be unloaded

To be more precise, when running Monocle2 with the lastest version igraph (or igraph version > 2.1.0; mine is 2.1.1), the error will appear as below:

gbm_cds <- orderCells(gbm_cds)
Error:
! nei() was deprecated in igraph 2.1.0 and is now defunct.
ℹ Please use .nei() instead.
Run rlang::last_trace() to see where the error occurred.

As suggested by the error, I just downgraded my igraph into igraph 2.0.3 as I mentioned in previous comments. Restart R, it solved the error.

gbm_cds <- orderCells(gbm_cds)
Warning messages:
1: In dfs(graph = graph, root = root, mode = mode, unreachable = unreachable, :
Argument neimode' is deprecated; use mode' instead
2: In dfs(graph = graph, root = root, mode = mode, unreachable = unreachable, :
Argument neimode' is deprecated; use mode' instead

Best,
szhaoaf

@orange511
Copy link

As the error said, ! nei() was deprecated in igraph 2.1.0 and is now defunct. The igraph version: 2.1.1 version accounts for the error.

To solve this issue, simply downgrading igraph can work.

https://cran.rstudio.com/bin/macosx/big-sur-arm64/contrib/4.2/igraph_2.0.3.tgz

Go to above link and install the 2.0.3 version, restart the R session. Then it solved for me.

> gbm_cds <- orderCells(gbm_cds)
Warning messages:
1: In dfs(graph = graph, root = root, mode = mode, unreachable = unreachable,  :
  Argument `neimode' is deprecated; use `mode' instead
2: In dfs(graph = graph, root = root, mode = mode, unreachable = unreachable,  :
  Argument `neimode' is deprecated; use `mode' instead

Session info:

sessionInfo()
R version 4.4.1 (2024-06-14)
monocle_2.32.0
igraph_2.0.3

Bests

It works!
Thank you very much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants