checkContrastNames: Check a contrast matrix to make sure that it is likely o.k.

View source: R/edgeR-slurm-lsf.R

checkContrastNamesR Documentation

Check a contrast matrix to make sure that it is likely o.k.

Description

Check a contrast matrix to make sure that it is likely o.k.

Usage

checkContrastNames(contrastMatrix, action = c("message", "warning", "error"))

Arguments

contrastMatrix

A contrast matrix

action

Character strings, the action to perform in case the names show irregularities

Right now, the function checks no column names contain the equal sign.

Examples

testDesign <- cbind(Control=rep(1,8), Treatment=rep(c(0,1),4), Batch=rep(c(0, 1), each=4))
problemContrast <- limma::makeContrasts("Treatment"="Treatment",
  "Batch=Batch", ## problematic
  levels=testDesign)
checkContrastNames(problemContrast, action="message")
if(requireNamespace("testthat")) {
  testthat::expect_warning(checkContrastNames(problemContrast,
         action="warning"))
  testthat::expect_error(checkContrastNames(problemContrast,
         action="error"))
}

bedapub/ribiosNGS documentation built on Feb. 10, 2025, 12:34 a.m.