Learn R Programming

ACNE (version 0.9.1)

fitSnpNmfArray: 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, ...)

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.

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.

See Also

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

Examples

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

Run the code above in your browser using DataLab