CAMMGCluster {debCAM} | R Documentation

## MG cluster detection for CAM

### Description

This function finds corner clusters as MG clusters (clusters containing marker genes).

### Usage

    CAMMGCluster(K, PrepResult, generalNMF = FALSE, nComb = 200)

### Arguments

`K` | The candidate subpopulation number.
`PrepResult` | An object of class "`CAMPrepObj`" obtained from `CAMPrep` function.
`generalNMF` | If TRUE, the decomposed proportion matrix has no sum-to-one constraint for each row. Without this constraint, the scale ambiguity of corner cluster centers will not be removed when computing reconstruction errors. The default is FALSE.
`nComb` | The number of possible combinations of clusters as corner clusters. Within these possible combinations ranked by margin errors, we can further select the best one based on reconstruction errors. The default is 200.

### Details

This function is used internally by `CAM` function to detect clusters containing marker genes, or used when you want to perform CAM step by step.

This function provides two solutions. The first is the combination of clusters yielding the minimum sum of margin-of-errors for cluster centers. In the second, nComb possible combinations are selected by ranking sum of margin-of-errors for cluster centers. Then the best one is selected based on reconstruction errors of all data points in original space.

### Value

An object of class "`CAMMGObj`" containing the following components:

`idx` | Two numbers which are two solutions' ranks by sum of margin-of-error.
`corner` | The indexes of clusters as detected corners. Each row is a solution.
`error` | Two rows. The first row is sum of margin-of-errors for nComb possible combinations. The second row is reconstruction errors for nComb possible combinations.

### Examples

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

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

    #Marker gene cluster detection with a fixed K = 3
    rMGC <- CAMMGCluster(3, rPrep)

[Package debCAM version 1.5.0 Index]