rotate3d: Spherical Coordinates Rotation

Description Usage Arguments Value Examples

View source: R/rotate3d.R

Description

Rotate to the direction of interest in spherical coordinates by contrasts (e.g. 1, -1, -1).

Usage

1
rotate3d(T, contrast)

Arguments

T

a numeric matrix (normally z-score converted) with 3 columns. The rows are genes or phosphorylation sites and the columns are treatments vs control statistics.

contrast

the direction to be tested for enrichment. Specified as contrast in a triplet (see example).

Value

A rotated matrix with respect to the direction of interest.

Examples

1
2
3
4
5
6
7
8
# load the example data
data(PM)

# convert statistics into z-scores
PM.zscores <- apply(PM, 2, function(x){qnorm(rank(x)/(nrow(PM)+1))})

# Rotate the matrix by contrast 1, -1, -1 (i.e. up-regulation, down-regulation, dow-regulation).
PM.rotated <- rotate3d(PM.zscores, contrast = c(1, -1, -1))

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