XWProj {CAMTHC} | R Documentation

## Perspective projection to obtain simplex

### 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

    XWProj(data, W)

### 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

    #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

[Package CAMTHC version 1.5.0 Index]