check_contrasts: Check contrasts

View source: R/check_contrasts.R

check_contrastsR Documentation

Check contrasts

Description

Check all possible contrasts used by results_all. Following DESeq2 conventions, control group should be listed first and then pairswise comparisons are selected in reverse order, so A, B, C levels will return C vs. B, C vs. A, and B vs. A

Usage

check_contrasts(trt, vs = "all")

Arguments

trt

a vector

vs

either compare all vs. all (default) or a all vs. a specific treatment, or see note.

Value

A vector of contrasts

Note

If you combine factors of interest into a single group following section 3.3 in the DESeq2 vignette, you can set vs = "combined" to limit the comparisons to those within the first group.

Author(s)

Chris Stubben

Examples

 # check_contrasts(samples$trt)
 trt <- c("B", "A", "C")
 # sorted alphabetically and then reverse order combn
 check_contrasts(trt)
 # or specify factor levels with control first
 check_contrasts(factor(trt, levels = c("C", "B", "A")))
 # combine 2 trt groups  (66 possible contrasts)
 trt <- paste( 1:4, rep(c("A", "B", "C"), each=4))
 check_contrasts( trt, vs = "combined")

HuntsmanCancerInstitute/hciR documentation built on Dec. 10, 2024, 12:22 p.m.