forked from gabraham/flashpca
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathproject.Rd
72 lines (63 loc) · 2.26 KB
/
project.Rd
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
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/project.R
\name{project}
\alias{project}
\title{Project new data onto existing principal components}
\usage{
project(
X,
loadings,
orig_mean = NULL,
orig_sd = NULL,
ref_alleles = NULL,
divisor = "p",
block_size = 1000,
verbose = FALSE,
check_geno = TRUE,
check_bim = TRUE
)
}
\arguments{
\item{X}{A numeric matrix to project onto the PCs, or a
character string pointing to a PLINK dataset.}
\item{loadings}{A numeric matrix of right
eigenvectors (SNPs on rows, ndim dimensions on columns).}
\item{orig_mean}{A numeric vector of the original SNP means (averages)
used to standardise the genotypes before PCA.}
\item{orig_sd}{A numeric vector of the original SNP standard deviations
used to standardise the genotypes before PCA.}
\item{ref_alleles}{A character vector of the reference alleles for each
SNP. This must match the reference alleles used for PCA.}
\item{divisor}{A character string indicating whether to divide the
eigenvalues by number of columns of X ("p"), the number of
rows of X minus 1 ("n1") or none ("none").}
\item{block_size}{Integer. Block size for PCA on PLINK files.}
\item{verbose}{Logical. Verbose output.}
\item{check_geno}{Logical. Whether to explicitly check if the matrix X
contains values other than {0, 1, 2}, when stand="binom". This can be
be set to FALSE if you are sure your matrix only contains these values
(only matters when using stand="binom").}
\item{check_bim}{Logical. Whether to check that the number of rows in
the PLINK bim file (if X is a character string) matches the number of
rows in the loadings.}
}
\value{
\code{project} returns a list containing the following components:
\describe{
\item{projection}{A numeric matrix. The projections of the new data
onto the principal components.}
}
}
\description{
Project new data onto existing principal components
}
\details{
\code{project} projects data Z onto existing principal components (PCs), i.e.,
\deqn{P_z = Z V} where V is the matrix of SNPs loadings. The projected data
must match the original data used to derive the PCs in terms of
\describe{
\item{}{Same SNPs, in the same order}
\item{}{Same alleles and reference alleles}
\item{}{Same divisor specified (although not strictly necessary}.
}
}