File: test_ordering.R

package info (click to toggle)
r-bioc-edaseq 2.32.0%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 404 kB
  • sloc: makefile: 2
file content (17 lines) | stat: -rw-r--r-- 753 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
context("Test same ordering of rows after normalization if no rownames.")

counts <- matrix(rnbinom(n=1e3, size=2,
                         mu=rnorm(n=1e3, mean=100, sd=10)),
                 nrow=100, ncol=10)
gc <- runif(n=100, min=0.3, max=0.8)

test_that("ordering is correct without rownames", {
  # normalize a matrix without rownames (and strip any name given by the function)
  normCounts_noNames <- unname(withinLaneNormalization(unname(counts), gc, which="full"))
  # normalize a matrix with rownames (and strip any name given by the function)
  rownames(counts) <- paste0("gene", 1:nrow(counts))
  normCounts_withNames <- unname(withinLaneNormalization(counts, gc, which="full"))

  expect_equal(normCounts_noNames, normCounts_withNames)
}
)