degrep: Derive growth-modifying effect of gene knockout in pooled...

Description Usage Arguments Details Value Note Author(s) See Also Examples

View source: R/rrep_degrep.R

Description

degrep is a variant of getdeg that utilizes confidence measures of rate ratios to find the "best guide". First, the median rate ratio of a group (e.g. a gene) is determined. The best guide is corresponds to the most extreme rate ratio with the same sign (direction) as the median, after moving two (or another specified number) standard (error) units toward null. See details below. For more context, see getdeg

Usage

1
2
degrep(guides, r0, se0, r1, se1, rt = FALSE, set = FALSE, a, b,
  hnull = 0, nse = 2, secondbest = TRUE, correctab = TRUE)

Arguments

guides

Character vector. Guides are assumed to start with the gene name, followed by an underscore, followed by a number or sequence unique within that gene.

r0

Numeric vector. Rate ratios of features representing straight lethality.

se0

Numeric vector. Standard errors corresponding to r0.

r1

Numeric vector. Rate ratios of features representing sensitization or synthetic lethality. Optional but required to calculate e.

se1

Numeric vector. Standard errors corresponding to r1.

rt

Numeric vector. Rate ratios of features representing lethality in the test sample. Optional.

set

Numeric vector. Standard errors corresponding to rt.

a

Numeric. Estimated potential population doublings between time points.

b

Numeric. Estimated potential population doublings between time points in test sample. Only applicable if r1 is given. If omitted, assumed equal to a.

hnull

Numeric. Null hypothesis. Growth effects of genes are tested to be more extreme than this value. Setting hnull can greatly improve the usefulness of p-values, and can be considered a cutoff for relevance. Default = 0

nse

Numeric. Number of standard units, used for comparing guides. See details below. Default = 2

secondbest

Logical. If TRUE, calculate effect sizes based on the second best guides of each gene as well. Default = TRUE

correctab

Logical. When a != b, it is be possible (and necessary?) to mathematically correct for this difference. If you analyze an experiment with unequal a and b, try both with and without correction. Default = TRUE

Details

For more details on basic functionality, see getdeg documentation. The added functionality in this function hinges on the use of confidence measures of rate ratios. Rate ratios and associated errors can be derived from other sources, but I recommend using the output of rrep. As in getdeg, a single best guide is determined using all available data. But now, the confidence given by the standard error is used to help select the best guide. Here is an example to illustrate. Say guide 1 has a rate ratio of -4 and a standard error of 1.2, while guide 2 targeting the same gene has a rate ratio of -3 and a standard error of 0.5 and guide 3 and guide 4 both have little effect. When using the default nse = 2, guide 2 scores better than guide 1, and is thus designated "best guide". However, for the p-value calculation, the lowest p-value is reported, which is calculated using the rate ratio, its standard error, and the null hypothesis as determined by hnull and the number of population doublings. The p-value reported for a gene does therefore not necessarily match to the best guide, and can in fact below to an outlier. The p-values are also not corrected for multiple testing. Instead, p-values can easily be calculated for all guides using 2*pnorm(-abs(r)/se) or pnorm((hnull*a-abs(r))/se), and corrected for multiple testing using p.adjust.

Value

Returns a list with the following (depending on input arguments):

Note

With these analyses, it is important to visually inspect all steps, and preferentially to analyze a data set with several settings.

Author(s)

Jos B. Poell

See Also

getdeg, rrep

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
ut1 <- CRISPRsim(1000, 4, a = c(3,3), allseed = 100, t0seed = 10, repseed = 1)
tr1 <- CRISPRsim(1000, 4, a = c(3,3), e = TRUE, allseed = 100, t0seed = 10, repseed = 2)
ut2 <- CRISPRsim(1000, 4, a = c(3,3), allseed = 100, t0seed = 20, repseed = 3)
tr2 <- CRISPRsim(1000, 4, a = c(3,3), e = TRUE, allseed = 100, t0seed = 20, repseed = 4)
ut3 <- CRISPRsim(1000, 4, a = c(3,3), allseed = 100, t0seed = 30, repseed = 5)
tr3 <- CRISPRsim(1000, 4, a = c(3,3), e = TRUE, allseed = 100, t0seed = 30, repseed = 6)
cgi <- tr1$d > -0.05 & tr1$d < 0.05 & tr1$e > -0.05 & tr1$e < 0.05
rr0 <- rrep(cbind(ut1$t6, ut2$t6, ut3$t6), cbind(ut1$t0, ut2$t0, ut3$t0), normsubset = cgi)
rr1 <- rrep(cbind(tr1$t6, tr2$t6, tr3$t6), cbind(ut1$t6, ut2$t6, ut3$t6), normsubset = cgi)
deg <- degrep(ut1$guides, rr0$r, rr0$se, rr1$r, rr1$se, a = 6, b = 6, secondbest = FALSE)
reald <- rle(tr1$d)$values
reale <- rle(tr1$e)$values
plot(reald, deg$d)
plot(reale, deg$e)

tgac-vumc/CSSA documentation built on Dec. 14, 2019, 9:40 p.m.