add_pathway_direction | R Documentation |
Add directionality to pathway enrichment
add_pathway_direction(
x,
gene_hits,
delim = "/",
dir_colname = "z-score",
verbose = FALSE,
...
)
x |
|
gene_hits |
|
delim |
|
dir_colname |
|
verbose |
|
... |
additional arguments are ignored. |
This function uses pathway enrichment data provided as an
enrichResult
object. Data is added as a new column (default "z-score")
with numeric
values indicating the direction of change.
It requires gene_hits
with the direction of change for each gene,
which is used to determine the up- and down-regulated genes
in each gene set.
The default equation uses the IPA z-score of activation, since the z-score has beneficial properties in downstream visualization functions. It is symmetric around zero, and implies reasonable thresholds.
Note that when no genes involved in enrichment are present in the
gene_hits
data, the resulting directional value is expected
to be NA
, which will be treated as "non-directional" in downstream
visualization functions.
The IPA Activation "z-score"
uses the following formula:
z <- (N_genes_up - N_genes_down) / sqrt(N_genes_up + N_genes_down)
Citation for IPA formula: https://doi.org/10.1093/bioinformatics/btt703 as referenced: IPA FAQ - Statistical Calculations
The deprecated calculation for "direction"
is shown below:
direction_1 <- (N_genes_up - N_genes_down) / (N_genes); # then log2(1.2 + x) transformed direction <- log2(1.2 + abs(direction_1)) * sign(direction_1)
enrichResult
object, with directional values populated
into the result column name defined by dir_colname
.
When no genes in a gene set are present in gene_hits
the
expected directional value is NA
.
Other jam enrichment functions:
multiEnrichMap()
,
topEnrichBySource()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.