rotate3d: Spherical Coordinates Rotation

View source: R/rotate3d.R

rotate3dR Documentation

Spherical Coordinates Rotation

Description

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

Usage

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

# 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. 17, 2023, 1:08 a.m.