CAM3ASest: A and S matrix estimation by CAM3

View source: R/CAM3ASest.R

CAM3ASestR Documentation

A and S matrix estimation by CAM3

Description

This function estimates A and S matrix based on marker gene clusters detected by CAM3.

Usage

CAM3ASest(MGResult, PrepResult, data, corner.strategy = 2, generalNMF = FALSE)

Arguments

MGResult

An object of class "CAMMGObj" obtained from CAM3MGCluster function.

PrepResult

An object of class "CAMPrepObj" obtained from CAMPrep function.

data

Matrix of mixture expression profiles which need to be the same as the input of CAMPrep. Data frame, SummarizedExperiment or ExpressionSet object will be internally coerced into a matrix. Each row is a gene and each column is a sample. Data should be in non-log linear space with non-negative numerical values (i.e. >= 0). Missing values are not supported. All-zero rows will be removed internally.

corner.strategy

The method to detect corner clusters. 1: minimum sum of margin-of-errors; 2: minimum sum of reconstruction errors. The default is 2.

generalNMF

If TRUE, the decomposed proportion matrix has no sum-to-one constraint for each row. Without this constraint, the scale ambiguity of each column vector in proportion matrix will not be removed. The default is FALSE.

Details

This function is used internally by CAM3Run function to estimate proportion matrix (A), subpopulation-specific expression matrix (S) and mdl values. It can also be used when you want to perform CAM step by step.

The mdl value is based on original data with A matrix estimated by transforming dimension-reduced A matrix back to original space. The mdl value is the sum of two terms: code length of data under the model and code length of model. Both mdl value and the first term (code length of data) will be returned.

Value

An object of class "CAMASObj" containing the following components:

Aest

Estimated proportion matrix.

Sest

Estimated subpopulation-specific expression matrix.

Aest.proj

Estimated proportion matrix, before removing scale ambiguity.

Ascale

The estimated scales to remove scale ambiguity of each column vector in Aest. Sum-to-one constraint on each row of Aest is used for scale estimation.

AestO

No use in CAM3, will be deprecated in future version.

SestO

No use in CAM3, will be deprecated in future version.

AestO.proj

No use in CAM3, will be deprecated in future version.

AscaleO

No use in CAM3, will be deprecated in future version.

datalength

Code length of data.

mdl

The mdl value.

Examples

#obtain data
data(ratMix3)
data <- ratMix3$X

#preprocess data
rPrep3 <- CAMPrep3(data, dim.rdc = 3, thres.low = 0.30, thres.high = 0.95)

#Marker gene cluster detection with greedy search
rMGC3 <- CAM3MGCluster(3, rPrep3)

#A and S matrix estimation
rASest3 <- CAM3ASest(rMGC3, rPrep3, data)

ChiungTingWu/CAM3 documentation built on Feb. 14, 2024, 9:22 a.m.