nestedradjust: Calculate rate ratios of rate ratios restricted by confidence...

View source: R/CSSA.R

nestedradjustR Documentation

Calculate rate ratios of rate ratios restricted by confidence level

Description

nestedradjust is an extension of radjust. It is specifically applicable for comparison of two samples with an independent time base.

Usage

nestedradjust(
  mt1,
  wt1,
  mt0,
  wt0,
  conf.level = 0.8,
  normfun = "sum",
  normsubset,
  log = 2,
  belowxreads = 300
)

Arguments

mt1

Integer vector. Raw sequencing reads in test sample, t1

wt1

Integer vector. Raw sequencing reads in control sample, t1

mt0

Integer vector. Raw sequencing reads in test sample, t0

wt0

Integer vector. Raw sequencing reads in control sample, t0

conf.level

Numeric. Sets the confidence level of the rate ratio. If FALSE, an unadjusted rate ratio will be returned. Default = 0.8

normfun

Character string. Specify with which function to standardize the data. Default = "sum"

normsubset

Integer vector. Specify the indices of features that are to be used in standardization

log

Logical. Specify whether the rate ratio should be log-transformed. If TRUE, uses natural logarithm. Default = 2

belowxreads

Logical or numeric. Set threshold above which the unadjusted rate ratio is returned. Default = 300

Details

The basic functionality is similar to radjust. The major difference lies in the time base factor. Because both samples have an independent origin, there is added uncertainty of this time base factor. This is where the nested aspect of this function comes in. Both the upper and lower confidence limit of the rate ratio at baseline are tested as time base. From the resulting two rate ratios, the smallest fold change ratio is returned. It therefore estimates a conservative rate ratio.

Value

Returns the (log2-transformed) adjusted rate ratio.

Note

The function will run but give a warning when supplying a matrix per experimental arm. For most experimental set-ups, replicates between mutant and wild-type will not be paired, and rrep will have to be used. An example of when you can supply a matrix of data is when you are analyzing isogenic lines in different parental lines, and each column represents a different parental line.

Author(s)

Jos B. Poell

See Also

radjust, doublejar, ess, noness

Examples

wt <- CRISPRsim(genes = 10, guides = 4, a = 3, allseed = 1, t0seed = 2, perfectseq = TRUE)
mt <- CRISPRsim(genes = 10, guides = 4, a = 3, e = TRUE, f = jitter(wt$f),
                allseed = 1, repseed = 2, perfectseq = TRUE)
r <- nestedradjust(mt$t3, wt$t3, mt$t0, wt$t0)
plot(mt$e, r)


tgac-vumc/CSSA documentation built on Oct. 10, 2022, 7:27 p.m.