Learn R Programming

directPA (version 1.5.1)

rotate3d: Spherical Coordinates Rotation

Description

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

Usage

rotate3d(T, contrast)

Value

A rotated matrix with respect to the direction of interest.

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).

Examples

Run this code
# 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))

Run the code above in your browser using DataLab