geneodds | R Documentation |
geneodds combines the odds of all guides per gene.
geneodds(guides, oddscores, log = TRUE)
guides |
Character vector. List of guides |
oddscores |
Numeric vector. oddscores of guides |
log |
Logical. Are the oddscores log-transformed or not? Default = TRUE |
Returns a numeric vector of the same length as the number of genes with the combined odds.
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.
Jos B. Poell
oddscores
, odds2pq
, sumZ
,
getdeg
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))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.