Closed Chenium123 closed 2 months ago
Can you make sure the variables ligand
and receptor
aren't NULL or empty? You can do this with is.null(ligand)
or is.null(receptor)
.
Can you make sure the variables
ligand
andreceptor
aren't NULL or empty? You can do this withis.null(ligand)
oris.null(receptor)
.
I have just made sure they are all not NULL. If you have recently been using this package, you can try running this step in your environment. I have contacted several friends, and they all encountered the same error and issue. It seems to have appeared only recently.
rlang::last_trace()
<error/dplyr:::mutate_error>
Error in `mutate()`:
ℹ In argument: `ligand = convert_alias_to_symbols(ligand, organism = organism)`.
Caused by error in `convert_alias_to_symbols()`:
! could not find function "convert_alias_to_symbols"
---
Backtrace:
▆
1. ├─... %>% ...
2. ├─dplyr::mutate(...)
3. └─dplyr:::mutate.data.frame(...)
4. └─dplyr:::mutate_cols(.data, dplyr_quosures(...), by)
5. ├─base::withCallingHandlers(...)
6. └─dplyr:::mutate_col(dots[[i]], data, mask, new_columns)
7. └─mask$eval_all_mutate(quo)
8. └─dplyr (local) eval()
Run rlang::last_trace(drop = FALSE) to see 3 hidden frames.
The function comes from the nichenetr package can you make sure to also install and load the nichenetr package using library(nichenetr)
or with nichenetr::convert_alias_to_symbols(ligand, organism = organism)
? This should resolve the error you encounter.
Additionally, make sure you read each step in the vignettes thoroughly, especially read this as it gives a detailed explanation on all steps needed to run multinichenetr. Following packages are needed for the analysis:
library(SingleCellExperiment)
library(dplyr)
library(ggplot2)
library(nichenetr)
library(multinichenetr)
The function comes from the nichenetr package can you make sure to also install and load the nichenetr package using
library(nichenetr)
or withnichenetr::convert_alias_to_symbols(ligand, organism = organism)
? This should resolve the error you encounter.
Thank you for your response. Before loading the multinichenetr package, I updated and loaded the nichenetr package. However, the same error still occurred at this step. Therefore, I checked and ran the source code:
> group_data = prioritization_tables$group_prioritization_table_source %>% dplyr::mutate(sender_receiver = paste(sender, receiver, sep = " --> "), lr_interaction = paste(ligand, receptor, sep = " - ")) %>% dplyr::distinct(id, sender, receiver, sender_receiver, lr_interaction, group, activity, activity_scaled, direction_regulation, prioritization_score) %>% dplyr::filter(id %in% sample_data$id) %>% dplyr::arrange(receiver) %>% dplyr::group_by(receiver) %>% dplyr::arrange(sender, .by_group = TRUE)
Error in UseMethod("mutate") :
no applicable method for 'mutate' applied to an object of class "NULL"
> rlang::last_trace()
<error/rlang_error>
Error in `dplyr::filter()`:
ℹ In argument: `id %in% prioritized_tbl_oi$id`.
Caused by error in `h()`:
! error in evaluating the argument 'table' in selecting a method for function '%in%': object 'prioritized_tbl_oi' not found
---
Backtrace:
▆
1. ├─... %>% dplyr::arrange(sender, .by_group = TRUE)
2. ├─dplyr::arrange(., sender, .by_group = TRUE)
3. ├─dplyr::group_by(., receiver)
4. ├─dplyr::arrange(., receiver)
5. ├─dplyr::mutate(...)
6. ├─dplyr::filter(., id %in% prioritized_tbl_oi$id)
7. ├─dplyr:::filter.data.frame(., id %in% prioritized_tbl_oi$id)
8. │ └─dplyr:::filter_rows(.data, dots, by)
9. │ └─dplyr:::filter_eval(...)
10. │ ├─base::withCallingHandlers(...)
11. │ └─mask$eval_all_filter(dots, env_filter)
12. │ └─dplyr (local) eval()
13. ├─id %in% prioritized_tbl_oi$id
14. └─base::.handleSimpleError(...)
15. └─base (local) h(simpleError(msg, call))
Run rlang::last_trace(drop = FALSE) to see 3 hidden frames.
Based on the error message, I checked the prioritized_tbl_oi file. As shown in the figure, it exists in the environment, and the data appears to be normal.
Thank you again!
After comparing the parameters with the source code, I found that the issue arises from some parameters in the new visualization code being incompatible with the multinichenet output file generated by version 1.0.3. It is necessary to run the full version 2.0.0 program. However, while running version 2.0.0, I encountered an issue consistent with issue #70. The developer needs to fix this. Thank you!
Hi @Chenium123 The issue is indeed this: Some visualization options of multinichenetr version >= 2.0.0. are only compatible with MultiNicheNet output object generated by version multinichenetr version >= 2.0.0. This is now added to the Readme of this package.
I encountered the following error while generating interpretable bubble plots:
Two weeks ago, I had no issues running the same code and using the same output files. I haven’t updated your package during this period, which makes me very puzzled.