File: LowRankMatrix.Rd

package info (click to toggle)
r-bioc-biocsingular 1.6.0%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 364 kB
  • sloc: cpp: 57; sh: 13; makefile: 2
file content (75 lines) | stat: -rw-r--r-- 2,570 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
\name{LowRankMatrix}

\alias{LowRankMatrixSeed}
\alias{LowRankMatrixSeed-class}

\alias{dim,LowRankMatrixSeed-method}
\alias{dimnames,LowRankMatrixSeed-method}
\alias{extract_array,LowRankMatrixSeed-method}
\alias{DelayedArray,LowRankMatrixSeed-method}
\alias{show,LowRankMatrixSeed-method}

\alias{LowRankMatrix}
\alias{LowRankMatrix-class}

\alias{dimnames<-,LowRankMatrix,ANY-method}
\alias{t,LowRankMatrix-method}
\alias{[,LowRankMatrix,ANY,ANY,ANY-method}

\docType{class}

\title{The LowRankMatrix class}
\description{
Definitions of the LowRankMatrixSeed and LowRankMatrix classes and their associated methods.
These classes are designed to provide a memory-efficient representation of a low-rank reconstruction, e.g., after a principal components analysis.
}

\usage{
LowRankMatrixSeed(rotation, components)

LowRankMatrix(rotation, components)
}

\arguments{
\item{rotation}{A matrix-like object where each row corresponds to a row of the LowRankMatrix object.

This can alternatively be a LowRankMatrixSeed, in which case any value of \code{components} is ignored.}
\item{components}{A matrix-like object where each row corresponds to a column of the LowRankMatrix object.}
}

\value{
The \code{LowRankMatrixSeed} constructor will return a LowRankMatrixSeed object.

The \code{LowRankMatrix} constructor will return a LowRankMatrix object equivalent to \code{tcrossprod(rotation, components)}.
}

\section{Methods for LowRankMatrixSeed objects}{
LowRankMatrixSeed objects are implemented as \linkS4class{DelayedMatrix} backends.
They support standard operations like \code{dim}, \code{dimnames} and \code{extract_array}.

Passing a LowRankMatrixSeed object to the \code{\link{DelayedArray}} constructor will create a LowRankMatrix object.
}

\section{Methods for LowRankMatrix objects}{
LowRankMatrix objects are derived from \linkS4class{DelayedMatrix} objects and support all of valid operations on the latter.
Subsetting, transposition and replacement of row/column names are specialized for greater efficiency when operating on LowRankMatrix instances,
and will return a new LowRankMatrix rather than a DelayedMatrix.

All other operations applied to a LowRankMatrix will use the underlying \pkg{DelayedArray} machinery.
Unary or binary operations will generally create a new DelayedMatrix instance containing a LowRankMatrixSeed.
}

\author{
Aaron Lun
}

\examples{
a <- matrix(rnorm(100000), ncol=20)
out <- runPCA(a, rank=10)

lr <- LowRankMatrix(out$rotation, out$x)
}

\seealso{
\code{\link{runPCA}} to generate the rotation and component matrices.
}