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.

...

Additional arguments passed to fitSnpNmf().

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 May 29, 2024, 12:33 p.m.