rotate2d: Polar Coordinates Rotation

Description Usage Arguments Value Examples

View source: R/rotate2d.R

Description

Rotate to the direction of interest in polar coordinates by degree (e.g. pi/4).

Usage

1
rotate2d(T, degree = 0)

Arguments

T

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

degree

the direction to be tested for enrichment. Specified as degree from to the original direction.

Value

A rotated matrix with respect to the direction of interest.

Examples

1
2
3
4
5
6
7
8
# load the phosphoproteomics dataset
data(HEK)

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

# Rotate the matrix by 1/2 pi (i.e. down-regulation, dow-regulation).
HEK.rotated <- rotate2d(HEK.zscores, degree = pi/2)

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