Skip to content
Snippets Groups Projects
Commit ac323bd7 authored by Luke Zappia's avatar Luke Zappia
Browse files

Add addGeneLengths tests

parent 791ec65b
No related branches found
No related tags found
No related merge requests found
......@@ -25,7 +25,13 @@ SCESet with added gene lengths
Add gene lengths to an SCESet object
}
\details{
This function adds simulated gene lengths to the \code{fData} slot of an
\code{SCESet} object that can be used for calculating length normalised
expression values such as TPM or FPKM. The \code{generate} simulates lengths
using a (rounded) log-normal distribution, with the default \code{loc} and
\code{scale} parameters based on human coding genes. Alternatively the
\code{sample} method can be used which randomly samples lengths (with
replacement) from a supplied vector.
}
\examples{
# Default generate method
......
context("SCESet functions")
test_that("addGeneLengths generate method works", {
sce <- simpleSimulate()
expect_silent(addGeneLengths(sce))
expect_error(addGeneLengths("a"))
expect_error(addGeneLengths(sce, loc = "a"))
expect_error(addGeneLengths(sce, scale = "a"))
expect_error(addGeneLengths(sce, scale = -1))
})
test_that("addGeneLength sample method works", {
sce <- simpleSimulate()
lens <- round(runif(100, 100, 10000))
expect_silent(addGeneLengths(sce, method = "sample", lengths = lens))
expect_error(addGeneLengths(sce, method = "sample"))
expect_error(addGeneLengths(sce, method = "sample"), lengths = 0)
expect_error(addGeneLengths(sce, method = "sample"), lengths = "a")
})
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment