Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set up testthat framework #10

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Package: NanoStringNorm
Type: Package
Title: Normalize NanoString miRNA and mRNA Data
Version: 3.0.0
Date: 2025-01-15
Date: 2025-01-17
Authors@R: c(
person(c("Daryl", "M."), "Waggott", role = "aut"),
person("Paul", "Boutros", email = "[email protected]", role = "cre"),
Expand All @@ -11,7 +11,10 @@ Depends:
R (>= 2.14.0)
Imports:
methods
Suggests: googleVis (>= 0.2.14), lme4, RUnit (>= 0.4.26)
Suggests:
testthat,
googleVis (>= 0.2.14),
lme4
Description: A set of tools for normalizing, diagnostics and visualization of NanoString nCounter data.
License: GPL-2
LazyLoad: yes
Expand Down
3 changes: 2 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# NanoStringNorm 3.0.0 (2025-01-15)
# NanoStringNorm 3.0.0 (2025-01-17)

## Removed
* Removed Excel `.xls` support due to broken CRAN dependency
Expand All @@ -8,6 +8,7 @@

## Changed
* Update changelog to Markdown format
* Replaced RUnit framework with testthat


# NanoStringNorm 2.0.0 (2023-03-21)
Expand Down
1 change: 1 addition & 0 deletions R/read.csv.RCC.R
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ read.csv.RCC <- function(path, sample.id.row = 'File.Name') {

colnames(rcc$x) <- gsub(' ', '.', colnames(rcc$x));
colnames(rcc$x) <- c(colnames(rcc$x)[1:3], sample.ids);
rcc$x[, sample.ids] <- lapply(rcc$x[, sample.ids], as.numeric);

cat(paste('There were', length(sample.ids), 'samples imported. \nNote that spaces in sample names will be replaced by dots. \n'));

Expand Down
38 changes: 0 additions & 38 deletions R/unit.testing.NanoStringNorm.R

This file was deleted.

15 changes: 0 additions & 15 deletions tests/NanoStringNorm.unitTests.R

This file was deleted.

4 changes: 4 additions & 0 deletions tests/testthat.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
library(testthat);
library(NanoStringNorm);

test_check('NanoStringNorm');
Binary file added tests/testthat/data/load.rcc.Rda
Binary file not shown.
29 changes: 29 additions & 0 deletions tests/testthat/test-load.rcc.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
test_that(
'read.csv.RCC header loads correctly', {
load('data/load.rcc.Rda');

path <- system.file(
'extdata',
'RCC_files',
'RCCCollector1_rat_tcdd.csv',
package = 'NanoStringNorm'
);
result <- read.csv.RCC(path);
expect_equivalent(result$header, csv.nanostring.mrna.result$header);
}
);

test_that(
'read.csv.RCC counts load correctly', {
load('data/load.rcc.Rda');

path <- system.file(
'extdata',
'RCC_files',
'RCCCollector1_rat_tcdd.csv',
package = 'NanoStringNorm'
);
result <- read.csv.RCC(path);
expect_equivalent(result$x, csv.nanostring.mrna.result$x, );
}
);
Loading