tests/testthat/test_basic.r

context('basic functionality')

test_that('DiffusionMap works', {
	data(guo_norm)
	dm <- DiffusionMap(guo_norm)
	expect_identical(dm@distance, 'euclidean')
})

test_that('Eigenvectors retain cell names', {
	data(guo_norm)
	dm <- DiffusionMap(guo_norm)
	expect_identical(rownames(dm@eigenvectors), Biobase::sampleNames(guo_norm))
})

test_that('DM works with dist matrices', {
	data(guo_norm)
	dists <- as(dist(t(Biobase::exprs(guo_norm))), 'sparseMatrix')
	rownames(dists) <- colnames(dists) <- Biobase::sampleNames(guo_norm)
	dm <- DiffusionMap(distance = dists)
	expect_identical(rownames(dm@eigenvectors), rownames(dists))
})

Try the destiny package in your browser

Any scripts or data that you put into this service are public.

destiny documentation built on Nov. 8, 2020, 7:38 p.m.