context("test polar_landscape function")
library(proto)
write("ATOM 7584 N THR A1038 85.730 97.747 55.352 1.00 20.29 N", file ="test.pdb")
y <- Rpdb::read.pdb("test.pdb")
y2 <- assign_params(pdb_dataframe(y))
q <- polar_landscape(y2)
test_that("make sure LogP information exists",{
expect_match(colnames(y2, do.NULL = TRUE, prefix = "col"),"logP", all=FALSE)
expect_identical(q$data$logP,-2.94)
})
test_that("make sure chains exist for for faceting, with default name",{
expect_identical(q$data$chainid,"A")
})
test_that("make sure labelling worked out",{
expect_identical(q$labels$x, "atom coordinate")
expect_identical(q$labels$y, "logP")
expect_identical(q$labels$title, "logP Landscape")
})
test_that("make sure non sensical data is not plotted",{
y3 <- y2
y3$logP <- NULL
expect_error(polar_landscape(y3))
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.