XWProj: Perspective projection to obtain simplex

Description Usage Arguments Details Value Examples

Description

This function reduces data dimension by loading matrix and then project dimension-reduced data to the hyperplane orthogonal to c(1,0,...,0), i.e., the first axis in the new coordinate system..

Usage

1

Arguments

data

A data set that will be internally coerced into a matrix. Each row is a gene and each column is a sample. Missing values are not supported. All-zero rows will be removed internally.

W

The matrix whose rows are loading vectors; should be obtained from CAM/CAMPrep function with accessor method PCAmat.

Details

This function can project gene expression vectors to simplex plot generated by CAM/CAMPrep. Using slot Xproj in "CAMPrepObj" can only show the simplex of genes after filtering. This function helps observe all genes in simplex plot.

Value

The data after perspective projection.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
#obtain data
data(ratMix3)
data <- ratMix3$X

#preprocess data
rPrep <- CAMPrep(data, dim.rdc = 3, thres.low = 0.50, thres.high = 0.90)

#obtain simplex
Xproj <- XWProj(data, PCAmat(rPrep))
#plot simplex in 3d space
#plot3d(Xproj[,-1]) #The first dimension is constant after projection

Lululuella/CAMTHC documentation built on May 5, 2019, 2:39 a.m.