Fast pedigree PCA using sparse matrices and randomised linear algebra
rppca(X, ...)# S3 method for spam
rppca(
X,
method = "randSVD",
rank = 10,
depth = 3,
numVectors = 15,
totVar = NULL,
center = FALSE,
...
)
# S3 method for pedigree
rppca(
X,
method = "randSVD",
rank = 10,
depth = 3,
numVectors = 15,
totVar = NULL,
center = FALSE,
...
)
A list
containing:
x
the principal components
sdev
the variance components of each PC. Note that the total variance is
not known per se and this these components cannot be used to compute the
proportion of the total variance accounted for by each PC. However, if
nVecTraceEst
is specified, rppca
will estimate the total variance and
return variance proportions.
vProp
the estimated variance proportions accounted for by each PC.
Only returned if totVar
is set.
scale
always FALSE
center
logical
indicating whether or not the implicit data matrix was centred
rotation
the right singular values of the relationship matrix.
Only returned if returnRotation == TRUE
varProps
proportion of the total variance explained by each PC. Only
returned if starting from a pedigree object without centring, or if totVar
is supplied.
A representation of a pedigree, see Details.
optional arguments passed to methods
string
only randSVD (the default) is implemented
integer
how many principal components to return
integer
number of iterations for generating the range matrix
integer > rank
to specify the oversampling for the
range matrix
scalar
(optional) the total variance, required for
computation of variance proportions when using an L-inverse matrix a input
logical
whether or not to (implicitly) centre the additive
relationship matrix
The output slots are named like those of R's built in prcomp
function.
Rotation is not returned by default as it is the transpose of the PC scores,
which are returned in x
. scale
and center
are set to FALSE
.
pc <- rppca(pedLInv)
ped <- pedigree(sire=pedMeta$fid,
dam=pedMeta$mid,
label=pedMeta$id
)
pc2 <- rppca(ped)
Run the code above in your browser using DataLab