geneodds: Calculate odds per gene

View source: R/oddscores.R

geneoddsR Documentation

Calculate odds per gene

Description

geneodds combines the odds of all guides per gene.

Usage

geneodds(guides, oddscores, log = TRUE)

Arguments

guides

Character vector. List of guides

oddscores

Numeric vector. oddscores of guides

log

Logical. Are the oddscores log-transformed or not? Default = TRUE

Value

Returns a numeric vector of the same length as the number of genes with the combined odds.

Note

In a similar fashion as sumZ and getdeg, this function combines odds of all guides belonging to a gene for all genes in the data set. Keep in mind that guides have to be sorted by gene name, and their value is expected to start with the gene name, number or symbol, followed by an underscore. Odds are combined by multiplying odds or adding log odds, after which the odds are corrected for being composed of multiple odds. This correction changes the meaning of the odds: the returned result does not signify the odds that this specific gene has a lower rate ratio, but the odds that any gene with this many guide has a lower rate ratio. The code in the example shows an example with uniformly distributed p-values.

Author(s)

Jos B. Poell

See Also

oddscores, odds2pq, sumZ, getdeg

Examples

guides <- paste0("gene", rep(1:2500, each = 4), "_", rep(1:4, 2500))
p <- runif(10000)
odds <- p/(1-p)
hist(log(odds, 10), breaks = 100, xlim = c(-3,3))
go <- geneodds(guides, odds, log = FALSE)
hist(log(go, 10), breaks = 25, xlim = c(-3,3))
pgene <- go/(1+go)
hist(pgene, breaks = 25)
logodds <- log(odds,10)
glo <- geneodds(guides, logodds, log = 10)
hist(glo, breaks = 25, xlim = c(-3,3))


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