Version: 0.9.1
Depends: R (≥ 3.0.0), aroma.affymetrix (≥ 2.14.0)
Imports: MASS, R.methodsS3 (≥ 1.7.0), R.oo (≥ 1.23.0), R.utils (≥ 2.1.0), matrixStats (≥ 0.50.0), R.filesets (≥ 2.9.0), aroma.core (≥ 2.14.0)
Suggests: DNAcopy
Title: Affymetrix SNP Probe-Summarization using Non-Negative Matrix Factorization
Description: A summarization method to estimate allele-specific copy number signals for Affymetrix SNP microarrays using non-negative matrix factorization (NMF).
License: LGPL-2.1 | LGPL-3 [expanded from: LGPL (≥ 2.1)]
URL: https://github.com/HenrikBengtsson/ACNE
BugReports: https://github.com/HenrikBengtsson/ACNE/issues
LazyLoad: TRUE
biocViews: aCGH, CopyNumberVariants, SNP, Microarray, OneChannel, TwoChannel, Genetics
NeedsCompilation: no
Packaged: 2024-02-17 20:36:57 UTC; henrik
Author: Maria Ortiz [aut], Henrik Bengtsson [aut, cre, cph], Angel Rubio [aut]
Maintainer: Henrik Bengtsson <henrikb@braju.com>
Repository: CRAN
Date/Publication: 2024-02-17 21:10:22 UTC

Package ACNE

Description

A summarization method to estimate allele-specific copy number signals for Affymetrix SNP microarrays using non-negative matrix factorization (NMF).

Installation and updates

This package requires the aroma.affymetrix package. To install this package, do: install.packages("ACNE")

To get started

  1. For a one-command pipeline, see the doACNE() method.

  2. For other usages, see the NmfPlm class.

License

LGPL (>= 2.1)

Author(s)

Maria Ortiz, Henrik Bengtsson, Angel Rubio

References

[1] M. Ortiz-Estevez, H. Bengtsson, A. Rubio, ACNE: a summarization method to estimate allele-specific copy numbers for Affymetrix SNP arrays, Bioinformatics, 2010 [PMC2913655].


The NmfPlm class

Description

Package: ACNE
Class NmfPlm

Object
~~|
~~+--ParametersInterface
~~~~~~~|
~~~~~~~+--Model
~~~~~~~~~~~~|
~~~~~~~~~~~~+--UnitModel
~~~~~~~~~~~~~~~~~|
~~~~~~~~~~~~~~~~~+--MultiArrayUnitModel
~~~~~~~~~~~~~~~~~~~~~~|
~~~~~~~~~~~~~~~~~~~~~~+--ProbeLevelModel
~~~~~~~~~~~~~~~~~~~~~~~~~~~|
~~~~~~~~~~~~~~~~~~~~~~~~~~~+--NmfPlm

Directly known subclasses:
NmfSnpPlm

public abstract static class NmfPlm
extends ProbeLevelModel

This class represents the NMF model of [REF].

Usage

NmfPlm(..., maxIter=10L, maxIterRlm=20L, refs=NULL, flavor=c("v4", "v3", "v2", "v1"))

Arguments

...

Arguments passed to ProbeLevelModel.

maxIter

The maximum number of iteration in the NMF step.

maxIterRlm

A positive integer specifying the maximum number of iterations used in rlm.

refs

An index vector (integer or logical) specifying the reference samples. If NULL, all samples are used as a reference.

flavor

(Internal/developmental only) A character string specifying which algorithm to use.

Fields and Methods

Methods:

getAsteriskTags -

Methods inherited from ProbeLevelModel:
calculateResidualSet, calculateWeights, fit, getAsteriskTags, getCalculateResidualsFunction, getChipEffectSet, getProbeAffinityFile, getResidualSet, getRootPath, getWeightsSet

Methods inherited from MultiArrayUnitModel:
getListOfPriors, setListOfPriors, validate

Methods inherited from UnitModel:
findUnitsTodo, getAsteriskTags, getFitSingleCellUnitFunction, getParameters

Methods inherited from Model:
as.character, fit, getAlias, getAsteriskTags, getDataSet, getFullName, getName, getPath, getRootPath, getTags, setAlias, setTags

Methods inherited from ParametersInterface:
getParameterSets, getParameters, getParametersAsString

Methods inherited from Object:
$, $<-, [[, [[<-, as.character, attach, attachLocally, clearCache, clearLookupCache, clone, detach, equals, extend, finalize, getEnvironment, getFieldModifier, getFieldModifiers, getFields, getInstantiationTime, getStaticInstance, hasField, hashCode, ll, load, names, objectSize, print, save, asThis

Author(s)

Henrik Bengtsson

References

[1] M. Ortiz-Estevez, H. Bengtsson, A. Rubio, ACNE: a summarization method to estimate allele-specific copy numbers for Affymetrix SNP arrays, Bioinformatics, 2010 [PMC2913655].

See Also

Internally, for each SNP the NMF model is fitted using the fitSnpNmf() function.


The NmfSnpPlm class

Description

Package: ACNE
Class NmfSnpPlm

Object
~~|
~~+--ParametersInterface
~~~~~~~|
~~~~~~~+--Model
~~~~~~~~~~~~|
~~~~~~~~~~~~+--UnitModel
~~~~~~~~~~~~~~~~~|
~~~~~~~~~~~~~~~~~+--MultiArrayUnitModel
~~~~~~~~~~~~~~~~~~~~~~|
~~~~~~~~~~~~~~~~~~~~~~+--ProbeLevelModel
~~~~~~~~~~~~~~~~~~~~~~~~~~~|
~~~~~~~~~~~~~~~~~~~~~~~~~~~+--NmfPlm
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~+--SnpPlm
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~+--NmfSnpPlm

Directly known subclasses:

public abstract static class NmfSnpPlm
extends SnpPlm

Usage

NmfSnpPlm(..., mergeStrands=FALSE)

Arguments

...

Arguments passed to NmfPlm.

mergeStrands

If TRUE, the sense and the anti-sense strands are fitted together, otherwise separately.

Fields and Methods

Methods:
No methods defined.

Methods inherited from SnpPlm:
getCellIndices, getChipEffectSet, getMergeStrands, getParameters, getProbeAffinityFile, setMergeStrands

Methods inherited from NmfPlm:
getAsteriskTags

Methods inherited from ProbeLevelModel:
calculateResidualSet, calculateWeights, fit, getAsteriskTags, getCalculateResidualsFunction, getChipEffectSet, getProbeAffinityFile, getResidualSet, getRootPath, getWeightsSet

Methods inherited from MultiArrayUnitModel:
getListOfPriors, setListOfPriors, validate

Methods inherited from UnitModel:
findUnitsTodo, getAsteriskTags, getFitSingleCellUnitFunction, getParameters

Methods inherited from Model:
as.character, fit, getAlias, getAsteriskTags, getDataSet, getFullName, getName, getPath, getRootPath, getTags, setAlias, setTags

Methods inherited from ParametersInterface:
getParameterSets, getParameters, getParametersAsString

Methods inherited from Object:
$, $<-, [[, [[<-, as.character, attach, attachLocally, clearCache, clearLookupCache, clone, detach, equals, extend, finalize, getEnvironment, getFieldModifier, getFieldModifiers, getFields, getInstantiationTime, getStaticInstance, hasField, hashCode, ll, load, names, objectSize, print, save, asThis

Author(s)

Henrik Bengtsson


Non-documented objects

Description

This page contains aliases for all "non-documented" objects that R CMD check detects in this package.

Almost all of them are generic functions that have specific document for the corresponding method coupled to a specific class. Other functions are re-defined by setMethodS3() to default methods. Neither of these two classes are non-documented in reality. The rest are deprecated methods.

Author(s)

Henrik Bengtsson


Initialization of the W and H matrices

Description

Initialization of the W and H matrices.

Usage

WHInit(V, ...)

Arguments

V

An KxI matrix where I is the number of arrays and K is the number of probes where K should be even (K=2L).

...

Not used.

Details

The allele-specific copy number estimates are estimated using a naive genotyping algorithm. The probe-affinities are estimated using a pseudo inverse.

Value

Returns a list:

W

A Kx2 matrix of initial probe-affinity estimates.

H

A 2xI matrix of initial allele-specific copy-number estimates.

status

An integer specifying the status of the initialization: 0=normal case, 1=only one allele (either AA or BB), or 2=all samples are AB.


(ACNE)

Description

(ACNE) based on [1]. The algorithm is processed in bounded memory, meaning virtually any number of arrays can be analyzed on also very limited computer systems.

Usage

  ## S3 method for class 'AffymetrixCelSet'
doACNE(csR, fln=FALSE, drop=TRUE, verbose=FALSE, ...)
  ## Default S3 method:
doACNE(dataSet, ..., verbose=FALSE)

Arguments

csR, dataSet

An AffymetrixCelSet (or the name of an AffymetrixCelSet).

fln

If TRUE, CRMAv2-style PCR fragment-length normalization is performed, otherwise not.

drop

If TRUE, the RMA summaries are returned, otherwise a named list of all intermediate and final results.

verbose

See Verbose.

...

Additional arguments used to set up AffymetrixCelSet (when argument dataSet is specified).

Value

Returns a named list, iff drop == FALSE, otherwise a named list of AromaUnitTotalCnBinarySet and AromaUnitFracBCnBinarySet.

Author(s)

Henrik Bengtsson

References

[1] M. Ortiz-Estevez, H. Bengtsson, A. Rubio, ACNE: a summarization method to estimate allele-specific copy numbers for Affymetrix SNP arrays, Bioinformatics, 2010 [PMC2913655].


Non-negative matrix factorization (NMF) of a matrix containing SNP probe signals

Description

Non-negative matrix factorization (NMF) of a matrix containing SNP probe signals.

Usage

fitSnpNmf(V, acc=0.02, maxIter=10, maxIterRlm=20, refs=NULL)

Arguments

V

An KxI matrix where I is the number of arrays and K is the number of probe where K should be even (K=2L).

acc

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

maxIter

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

maxIterRlm

A positive integer specifying the maximum number of iterations used in rlm.

refs

An index vector (integer or logical) specifying the reference samples. If NULL, all samples are used as a reference.

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:

W

The Kx2 matrix containing allele-specific affinity estimates.

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

WHInit(), robustWInit(), robustHInit(), and removeOutliers().


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)
}

Generates a multi-panel plot summarizing the NMF SNP fit

Description

Generates a multi-panel plot summarizing the NMF SNP fit.

Usage

## S3 method for class 'SnpNmfFit'
plot(x, lim=c(0, 2^16), cnLim=c(0, 4), epsLim=c(-1, 1) * 2^12, main=NULL, ...)

Arguments

lim, cnLim, epsLim

The plot ranges for the probe data, the CN estimates, and the probe-affinity estimates.

main

A character string to be the main title of the plot.

...

Not used.

Value

Return nothing.

See Also

See fitSnpNmfArray().


Calculates the pseudo inverse of a matrix

Description

Calculates the pseudo inverse of a matrix.

Usage

pseudoinverse(X, ...)

Arguments

X

A numeric matrix.

...

Not used.

Value

Returns a matrix.

See Also

Internally svd() is used.


Removes outliers in matrix containing SNP signals

Description

Removes outliers in matrix containing SNP signals by identifying outlier elements. The values of the elements that are outliers are substituted by corresponding values predicted values Yest=W*H from the current affinity (W) and copy number (H) estimates.

Usage

removeOutliers(Y, W, H, tau=10, ...)

Arguments

Y

An IxK matrix.

W

A Kx2 matrix of probe-affinity estimates.

H

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

tau

A scalar specifying the threshold for identifying outliers.

...

Not used.

Value

Returns an IxK matrix where outliers have been "pruned". Outliers are substituted by the corresponding value of Yest.


Robust initialization of the H (copy number) matrix

Description

Robust initialization of the H (copy number) matrix.

Usage

robustHInit(V, W, maxIter=5L, ...)

Arguments

V

An KxI matrix where I is the number of arrays and K is the number of probes where K should be even (K=2L).

W

A Kx2 matrix of probe-affinity estimates.

maxIter

The maximum number of iteration.

...

Not used.

Details

This function utilized a random number generator.

Value

Returns a 2xI matrix of robustified allele-specific copy-number estimates.


Robust initialization of the W (affinity) matrix

Description

Robust initialization of the W (affinity) matrix.

Usage

robustWInit(V, H, maxIter=50L, ...)

Arguments

V

An KxI matrix where I is the number of arrays and K is the number of probes where K should be even (K=2L).

H

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

maxIter

The maximum number of iterations.

...

Not used.

Details

This function utilized a random number generator.

Value

Returns a Kx2 matrix of robustified probe-affinity estimates.


Reshapes SNP data in matrix form to array form and vice versa

Description

Reshapes SNP data in matrix form to array form and vice versa.

Usage

snpArrayToMatrix(Y, dropNames=TRUE, ...)

Arguments

Y

A 2LxI matrix or a Lx2xI array, where L is the number of probe pairs and I is the number of arrays.

dropNames

If TRUE, dimension names are dropped, otherwise preserved.

...

Not used.

Value

Returns a Lx2xI array or a 2LxI matrix.

Examples

Y <- matrix(rnorm(200), nrow=20, ncol=10)
str(Y)

V <- snpMatrixToArray(Y)
str(V)

Y2 <- snpArrayToMatrix(V)
str(Y2)

stopifnot(identical(Y2, Y))