Learn R Programming

Clomial (version 1.8.0)

compute.errors: 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.

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.

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.

References

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

See Also

Clomial

Examples

Run this code
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)

Run the code above in your browser using DataLab