<std::out_of_range/C++Error/error/condition>
Error: Mat::elem(): index out of bounds

context('Test main Harmony integration function: RunHarmony')
obj <- RunHarmony(cell_lines_small$scaled_pcs, cell_lines_small$meta_data, 'dataset',
theta = 1, nclust = 50, max_iter = 5, return_object = TRUE,
verbose = FALSE, .options = harmony_options(max.iter.cluster = 10))
test_that('dimensions match in Harmony object data structures', {
test_that('R defines proper probability distributions', {
expect_equal(colSums(obj$R), rep(1, obj$N), tolerance = 1e-5)
test_that('there are no null values in the corrected embedding', {
test_that('increasing theta decreases chi2 between Cluster and Batch assign', {
obj0 <- RunHarmony(cell_lines_small$scaled_pcs, cell_lines_small$meta_data, 'dataset',
theta = 0, nclust = 20, max_iter = 2, return_object = TRUE,
obj1 <- RunHarmony(cell_lines_small$scaled_pcs, cell_lines_small$meta_data, 'dataset',
theta = 1, nclust = 5, max_iter = 2, return_object = TRUE,
RunHarmony(cell_lines_small$scaled_pcs, cell_lines_small$meta_data, 'dataset', lambda = c(1,2))

'Test main Harmony integration function: RunHarmony'
'dimensions match in Harmony object data structures'
'R defines proper probability distributions'
'there are no null values in the corrected embedding'
'increasing theta decreases chi2 between Cluster and Batch assign'