compute.errors {Clomial} | R Documentation

## Computes the error of a Clomial model.

### Description

Given the true genotype and frequency matrices, finds the permutation of genotypes matrix which best matches the true genotypes and returns the corresponding errors.

### Usage

    compute.errors(Mu, U, P, PTrue)

### Arguments

`Mu` | The matrix which models the genotypes, where rows and columns correspond to genomic loci and clones, accordingly.
`U` | The true genotype matrix defined similar to `Mu`.
`P` | The matrix of clonal frequency where rows and columns correspond to clones and samples, accordingly.
`PTrue` | The true clonal frequency matrix defined similar to `P`.

### Details

Computing the error is useful for estimating the performance of inference on simulated, and for comparing different trained models. Genotype and frequency errors are defined as the normalized `l1`-error in reconstructing the genotype, and the clone frequency matrices, accordingly, where by normalized `l1`-error we mean the sum of absolute values of an error matrix divided by the size of the matrix.

### Value

A list will be made with the following entries:

`UError` | The `l1`-error of the genotype matrix normalized by the size of matrix.
`discretizedUError` | The `l1`-error of the rounded genotype matrix, i.e. the number of mismatching genotypes, normalized by the size of matrix

.

`PErrorAbsolute` | The normalized `l1`-error of the clone frequency matrix.
`PErrorRelative` | Each entry of the error clone frequency matrix is normalized by the corresponding entry in `PTrue`, and then the normalized `l1` norm is computed.

### Note

The use of `UError` and `PErrorAbsolute` is recommended. Computing the error is not feasible for more than 7 clones because the number of all possible permutations is factorial in the number of clones which grows super fast. Such input will trigger an error message.

### Author(s)

Habil Zare

### References

Inferring clonal composition from multiple sections of a breast cancer, Zare et al., Submitted.

### See Also

`Clomial`

### Examples

    set.seed(1)
    data(breastCancer)
    Dc <- breastCancer$Dc
    Dt <- breastCancer$Dt
    bics <- c()
    ClomialResult <-Clomial(Dc=Dc,Dt=Dt,maxIt=20,C=3,doParal=FALSE,binomTryNum=2)
    model1 <- ClomialResult$models[[1]]
    model2 <- ClomialResult$models[[2]]
    ## Comparing 2 trained models:
    compute.errors(Mu=model1$Mu,U=model2$Mu,P=model1$P,PTrue=model2$P)

[Package Clomial version 1.18.1 Index]