fitSnpNmfArray: Allele-specific copy number estimation using non-negative...

View source: R/fitSnpNmfArray.R

fitSnpNmfArrayR Documentation

Allele-specific copy number estimation using non-negative matrix factorization (NMF)

Description

Allele-specific copy number estimation using non-negative matrix factorization (NMF).

Usage

fitSnpNmfArray(Y, ...)

Arguments

Y

An Lx2xI array where L is number of probe pairs, 2 is the number of alleles (A and B), and I is the number of arrays.

maxIter

A positive integer specifying the maximum number of iterations used to calculate the decomposition.

acc

A positive double specifying the converence threshold. For more details on convergence, see below.

Details

The algorithm is considered to have converged when the maximum update of any allele-specific copy number of any array (H) is greater than acc.

Value

Returns a list of class SnpNmfFit:

Y

The Lx2xI array Y.

W

The Kx2 matrix containing allele-specific affinity estimates where K=2L.

H

A 2xI matrix containing allele-specific copy number estimates.

hasConverged

TRUE if the algorithm converged, otherwise FALSE. If not applicable, it is NA.

nbrOfIterations

The number of iteration ran before stopping. If not applicable, it is NA.

See Also

Internally, the array is stacked into a 2LxI matrix and decomposed using fitSnpNmf(). See plot.SnpNmfFit().

Examples

# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# DATA: Lx2xI allele-specific signals for six different SNPs
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
filenames <- sprintf("V%d.Rbin", 1:6)
pathnames <- system.file("extData", filenames, package="ACNE")
Ys <- lapply(pathnames, FUN=function(p) snpMatrixToArray(loadToEnv(p)$V))
names(Ys) <- sprintf("SNP #%d", seq_along(Ys))


# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# ACNE fitting of NMF to the six SNPs
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
for (name in names(Ys)) {
  Y <- Ys[[name]]
  fit <- fitSnpNmfArray(Y)
  str(fit)
  plot(fit, lim=c(0,2^14), main=name)
}

ACNE documentation built on July 9, 2023, 6:18 p.m.