directPA: Direction Analysis for Pathways

Description Usage Arguments Value Examples

View source: R/directPA.R

Description

The main function of direction Analysis. This function takes in a matrix of test statistics with two (2-dimensional space) or three (3-dimensional space) columns, the direction of interests, and the annotation list such as pathway annotation, and test for enrichment of pathways on the specified direction.

Usage

1
2
directPA(Tc, direction, annotation, minSize=5, gene.method="OSP", 
path.method="Stouffer", visualize=TRUE, ...)

Arguments

Tc

a numeric matrix. Rows are genes and columns are treatments vs control statistics.

direction

the direction to be tested for enrichment. Either specified as a degree for two-dimensional analysis or as contrast (in a triplet) for three-dimensional analysis.

annotation

a list with names correspond to pathways and elements correspond to genes belong to each pathway, respectively.

minSize

the size of annotation groups to be considered for calculating enrichment. Groups that are smaller than the minSize will be removed from the analysis.

gene.method

the method to be used for integrating statistics across treatments for each gene. Available methods are Stouffer, OSP, Fisher, and maxP. Default method is OSP.

path.method

the method to be used for integrating statistics of all genes that belongs to a pathway. Available methods are Stouffer, OSP, Fisher, and maxP. Default method is Stouffer.

visualize

whether to visualize the plot.

...

other visualization parameters to pass on.

Value

a list that contains directional p-values for each gene and directional enrichment for each pathway.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# load the proteomics dataset
data(PM)

# load pathway annotations
data(Pathways)

# display reactome pathways. Could be replaced by any other pathway databases
Pathways.reactome[1:5]

# direction pathway analysis in 3-dimensional space. Implemnted as rotating by contrast
# (1) test combined effect of all 3 treatments (stimulation and inhibitions) vs control (basal) 
# on the original direction.
dPA <- directPA(Tc=PM, direction=c(1,1,1), annotation=Pathways.reactome)
dPA$gst[order(unlist(dPA$gst[,1])),][1:20,]
# rank substrates on the direciton of interest
sort(dPA$gene.pvalues)[1:20]

# (2) test combined effect of all 3 treatments vs controls on direction c(1,-1, 0)
# this rotates Ins by 0 degree, Wmn by 90 degree, and MK by 45 degree.
dPA <- directPA(Tc=PM, direction=c(1,-1,0), annotation=Pathways.reactome)
dPA$gst[order(unlist(dPA$gst[,1])),][1:20,]

# (3) test combined effect of all 3 perturbations vs controls on direction c(1,-1, 1)
# this rotates Ins by 0 degree, Wmn by 90 degree, and MK by 0 degree.
dPA <- directPA(Tc=PM, direction=c(1,-1,1), annotation=Pathways.reactome)
dPA$gst[order(unlist(dPA$gst[,1])),][1:20,]

directPA documentation built on Nov. 16, 2020, 9:09 a.m.