tests/testthat/test_getDrugActivityRange.R

test_that("getDrugActivityRange output is correct", {
	
	nscSet <- c("609699", "740", "721")
	logActRanges <- getDrugActivityRange(nscSet)
	logActIQRs <- getDrugActivityRange(nscSet, computeIQR = TRUE)
	
	for (nsc in nscSet){
		avgActVec <- as.numeric(getDrugActivityData(nsc))
		expect_identical((max(avgActVec, na.rm = TRUE) - min(avgActVec, na.rm = TRUE)), 
										 unname(logActRanges[nsc]))
		expect_identical(IQR(avgActVec, na.rm = TRUE), unname(logActIQRs[nsc]))
	}
	
	suppressWarnings(expect_true(is.na(getDrugActivityRange("-1"))))
	suppressWarnings(expect_true(is.na(getDrugActivityRange("-1", computeIQR = TRUE))))
	
})

Try the rcellminer package in your browser

Any scripts or data that you put into this service are public.

rcellminer documentation built on Nov. 26, 2020, 2:02 a.m.