sumZ: Calculate corrected summed Z-values per gene

View source: R/CSSA.R

sumZR Documentation

Calculate corrected summed Z-values per gene

Description

sumZ adds Z-values of all guides per gene, then corrects each value by dividing by the square root of the number of guides representing the gene

Usage

sumZ(guides, Z)

Arguments

guides

Character vector. List of guides

Z

Numeric vector. Z-values of guides

Value

Returns a numeric vector of the same length as the number of genes with the corrected summed Z-value.

Note

Z-values can be based on the entire population, but also on a population of control genes. See examples below

Author(s)

Jos B. Poell

See Also

CRISPRsim, jar, radjust, r2Z

Examples

ut <- CRISPRsim(5000, 4, a = c(3,3), allseed = 1, perfectsampling = TRUE)
tr <- CRISPRsim(5000, 4, a = c(3,3), e = TRUE, allseed = 1, perfectsampling = TRUE)
cgi <- which(tr$d > -0.05 & tr$d < 0.05 & tr$e > -0.05 & tr$e < 0.05)
r0 <- jar(ut$t6, ut$t0)
r1 <- jar(tr$t6, ut$t6)
Z0 <- r2Z(r0, normsubset = cgi)
Z1 <- r2Z(r1, normsubset = cgi)
sumZ0 <- sumZ(tr$guides, Z0)
sumZ1 <- sumZ(tr$guides, Z1)
reald <- rle(tr$d)$values
reale <- rle(tr$e)$values
plot(reald, sumZ0)
plot(reale, sumZ1)


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