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

Error when running run_vespucci. #1

Open
unikill066 opened this issue Aug 23, 2024 · 2 comments
Open

Error when running run_vespucci. #1

unikill066 opened this issue Aug 23, 2024 · 2 comments

Comments

@unikill066
Copy link

I am encountering an error while trying to run Vespucci- run_vespucci function. The error occurs both when running the function with the basic inputs and when additional parameters are provided.

Error Message:

> vespucci_res = run_vespucci(input = input, meta = meta)
Splitting matrix
As no overdispersion parameters were provided, Poisson count splitting will be performed.
Error in auc@x : 
  no applicable method for `@` applied to an object of class "NULL"
> data('spatial_sim_distance_metrics_df')
> vespucci_res = run_vespucci(
+   input = input,
+   meta = meta,
+   distance_metrics_df = spatial_sim_distance_metrics_df,
+   test_sim = T
+ )
Splitting matrix
As no overdispersion parameters were provided, Poisson count splitting will be performed.
Error in auc@x : 
  no applicable method for `@` applied to an object of class "NULL"

Code:

# Vespucci

# install.packages("devtools")
# install.packages("propr")
# devtools::install_github("tpq/propr")
# install.packages("dismay")
# install.packages("remotes")
# remotes::install_github("skinnider/dismay")
# devtools::install_github("neurorestore/Vespucci")

library(Vespucci)
library(Seurat)


setwd("C:/Users/NXI220005/Downloads/vispu_data")
files <- list.files()
print(files)

load("spatial_sim.rda")
load("spatial_sim_calculated_auc_df.rda")
load("spatial_sim_distance_metrics_df.rda")

ls()

data("spatial_sim")
input = GetAssayData(spatial_sim, slot='counts')
meta = [email protected]

?run_vespucci

vespucci_res = run_vespucci(input = input, meta = meta)

data('spatial_sim_distance_metrics_df')
vespucci_res = run_vespucci(
  input = input,
  meta = meta,
  distance_metrics_df = spatial_sim_distance_metrics_df,
  test_sim = T
)

Despite following the instructions, I keep receiving the Error in auc@x indicating that no applicable method for @ is being applied to an object of class "NULL". Any guidance on what might be causing this issue would be appreciated.

@unikill066
Copy link
Author

It seems we might have identified the issue here.

In utils.R, the function should be updated from:

countsplit_matrix = function(
    input,
    seed = 42
) {
    set.seed(seed)
    split = countsplit(input, epsilon=0.5)
    auc = split$train
    auc@x = as.numeric(auc@x)
    de = split$test
    out_list = list(
        'run_auc' = auc,
        'run_de' = de
    )
    return(out_list)
}

to:

countsplit_matrix = function(
    input,
    seed = 42
) {
    set.seed(seed)
    split = countsplit(input, epsilon=0.5)
    auc = split[[1]]
    auc@x = as.numeric(auc@x)
    de = split[[2]]
    out_list = list(
        'run_auc' = auc,
        'run_de' = de
    )
    return(out_list)
}

We referenced the information from here. Please let me know if this can be implemented as a fix. If so, I will fork the repository. Thanks!

@AlanTeoYueYang
Copy link
Contributor

Hi, thank you for bringing this to our attention. We have implemented the fix as suggested.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants