Nothing
library("BioCor")
context("Testing mpathSim")
test_that("mpathSim", {
test <- mpathSim(c("194840", "156580"), info, method = "max")
expect_equal(test, 1L)
test <- mpathSim(c("194840", "156580"), info, NULL)
expect_equal(test[2L, 1L], 0.4)
test <- mpathSim(c("a" = "194840", "b" = "156580"), info, method = NULL)
expect_equal(test["a", "b"], 0.4)
expect_error(mpathSim("156580", info), "Introduce several")
expect_error(mpathSim(c(1, 156580), info), "character")
expect_error(mpathSim(c("a", "156580"), "a"), "list")
expect_warning(mpathSim(c("a", "156580"), info), "not in")
})
test_that("pathSims_matrix", {
test <- pathSims_matrix(info)
pathways <- unique(unlist(info))
nPathways <- length(pathways[!is.na(pathways)])
expect_equal(dim(test), c(nPathways, nPathways))
expect_true(all(diag(test) == 1L))
eq <- pathSim("1430728", "156580", info)
expect_equal(test["1430728", "156580"], eq)
})
fl <- system.file("extdata", "Broad.xml", package = "GSEABase")
gss <- getBroadSets(fl) # GeneSetCollection of 2 sets
test_that("mpathSim for GeneSetCollections and list is equal", {
# With missing all
a <- mpathSim(info = inverseList(geneIds(gss)))
b <- mpathSim(info = gss)
expect_equal(a, b)
pathways <- colnames(a)
# Without missing pathways
a <- mpathSim(names(geneIds(gss)), info = inverseList(geneIds(gss)))
b <- mpathSim(names(geneIds(gss)), info = gss)
expect_equal(a, b)
# Without missing pathways
a <- expect_warning(
mpathSim(c(pathways, "A"),
info = inverseList(geneIds(gss))
),
"not in the list"
)
b <- expect_warning(
mpathSim(c(pathways, "A"), info = gss),
"not in the GeneSetCollection"
)
expect_equal(a, b)
# Without missing method
a <- mpathSim(info = inverseList(geneIds(gss)), method = "avg")
b <- mpathSim(info = gss, method = "avg")
expect_equal(a, b)
# Without missing pathways and method
a <- mpathSim(names(geneIds(gss)),
info = inverseList(geneIds(gss)),
method = "avg"
)
b <- mpathSim(names(geneIds(gss)), info = gss, method = "avg")
expect_equal(a, b)
# Without missing pathways and methods
a <- expect_warning(
mpathSim(c(pathways, "A"),
info = inverseList(geneIds(gss))
),
"not in the list"
)
b <- expect_warning(
mpathSim(c(pathways, "A"), info = gss),
"not in the GeneSetCollection"
)
expect_equal(a, b)
})
test_that("mpathSim for GeneSetCollections", {
a <- mpathSim(info = gss)
expect_true(all(diag(a) == 1))
expect_equal(colnames(a), rownames(a))
a <- expect_warning(
mpathSim(c(colnames(a), "A"), info = gss),
"not in the GeneSetCollection"
)
expect_true(is.na(all(diag(a) == 1)))
expect_equal(colnames(a), rownames(a))
})
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.