Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
sirplus
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
BioCellGen-public
sirplus
Commits
ac323bd7
Commit
ac323bd7
authored
8 years ago
by
Luke Zappia
Browse files
Options
Downloads
Patches
Plain Diff
Add addGeneLengths tests
parent
791ec65b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
man/addGeneLengths.Rd
+7
-1
7 additions, 1 deletion
man/addGeneLengths.Rd
tests/testthat/test-SCESet-functions.R
+19
-0
19 additions, 0 deletions
tests/testthat/test-SCESet-functions.R
with
26 additions
and
1 deletion
man/addGeneLengths.Rd
+
7
−
1
View file @
ac323bd7
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
tests/testthat/test-SCESet-functions.R
0 → 100644
+
19
−
0
View file @
ac323bd7
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"
)
})
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment