From ab9f8875e36fe3e3b0b196382ab5f83d269f3982 Mon Sep 17 00:00:00 2001 From: Nikhil I <56198218+unikill066@users.noreply.github.com> Date: Fri, 23 Aug 2024 13:15:30 -0500 Subject: [PATCH] Fix for countsplit function in utils.R > vespucci_res = run_vespucci(input = input, meta = meta) run_vespucci runs the following functions in this particular order: countsplit_matrix, calculate_spatial_auc and find_spatial_de And the error here propagates from the function: `countsplit_matrix` as mentioned below ... 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" --- R/utils.R | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/R/utils.R b/R/utils.R index 21fae22..fbd417c 100644 --- a/R/utils.R +++ b/R/utils.R @@ -261,17 +261,17 @@ get_GO_matrix = function( #' #' @export countsplit_matrix = function( - input, - seed = 42 + 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) + 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) }