diff --git a/R/colocboost_init.R b/R/colocboost_init.R index b9762fe..1223ecd 100644 --- a/R/colocboost_init.R +++ b/R/colocboost_init.R @@ -614,7 +614,7 @@ process_individual_data <- function(X, Y, dict_YX, target_variants, ind_id_Y <- rownames(Y[[i]]) ind_id_X <- rownames(X[[current_matrix_type]]) if (is.null(ind_id_X) || is.null(ind_id_Y)) { - stop("Please provide the sample index of X and Y, since they do not have the same sample size!") + stop("Please provide the sample index of X and Y, since they do not have the same samples!") } # Find matching samples pos <- match(ind_id_Y, ind_id_X) diff --git a/tests/testthat/test_colocboost.R b/tests/testthat/test_colocboost.R index 01ee6d5..e8360bd 100644 --- a/tests/testthat/test_colocboost.R +++ b/tests/testthat/test_colocboost.R @@ -241,5 +241,5 @@ test_that("colocboost handles missing/invalid inputs appropriately", { Y_list <- list(test_data$Y[,1], test_data$Y[,2]) X_list <- list(X_bad, X_bad) - expect_error(colocboost(X = X_list, Y = Y_list), "do not have the same sample size") + expect_error(colocboost(X = X_list, Y = Y_list), "Please provide the sample index of X and Y, since they do not have the same samples!") }) \ No newline at end of file diff --git a/tests/testthat/test_corner_cases.R b/tests/testthat/test_corner_cases.R index 7d0f097..2e8065b 100644 --- a/tests/testthat/test_corner_cases.R +++ b/tests/testthat/test_corner_cases.R @@ -87,7 +87,7 @@ test_that("colocboost handles missing values in Y", { X_list <- list(test_data$X, test_data$X) # Run colocboost - should handle NAs automatically - expect_warning( + expect_error( result <- colocboost( X = X_list, Y = Y_list, @@ -110,7 +110,7 @@ test_that("colocboost handles different sample sizes", { # Run colocboost - should error without sample indices expect_error( colocboost( - X = test_data$X[1], + X = test_data$X, Y = test_data$Y ) )