-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathplotPCA4plink.Rd
61 lines (56 loc) · 1.89 KB
/
plotPCA4plink.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
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/genotypeQC.R
\name{plotPCA4plink}
\alias{plotPCA4plink}
\title{Population outlier detection}
\usage{
plotPCA4plink(
gcta,
inputPrefix,
nThread = 20,
outputPC4subjFile,
outputPCplotFile
)
}
\arguments{
\item{gcta}{an executable program in either the current working directory
or somewhere in the command path.}
\item{inputPrefix}{the prefix of the input PLINK binary files.}
\item{nThread}{the number of threads used for computation.
The default is 20.}
\item{outputPC4subjFile}{the pure text file that stores all the subject IDs
and their corresponding eigenvalues of the first two principle components.}
\item{outputPCplotFile}{the plot file for visualizing the first two
principle components of all investigated subjects.}
}
\value{
The output pure text file and plot file for storing first two
principle components of study subjects.
}
\description{
Principle component analysis (PCA) on the genotype data is performed
to detect population outliers, and the first two PCs
are plotted for the visualization.
}
\details{
Before population outlier detection, it's better to perform QC
on the genotype data.
Only autosomal genotypes are used for principle component analysis.
}
\examples{
## In the current working directory
bedFile <- system.file("extdata", "QCdata.bed", package="Gimpute")
bimFile <- system.file("extdata", "QCdata.bim", package="Gimpute")
famFile <- system.file("extdata", "QCdata.fam", package="Gimpute")
system(paste0("scp ", bedFile, bimFile, famFile, " ."))
inputPrefix <- "QCdata"
outputPC4subjFile <- "2_13_eigenvalAfterQC.txt"
outputPCplotFile <- "2_13_eigenvalAfterQC.png" ## png format
## Not run: Requires an executable program GCTA, e.g.
## gcta <- "/home/tools/gcta64"
## plotPCA4plink(gcta, inputPrefix, nThread=20,
## outputPC4subjFile, outputPrefix)
}
\author{
Junfang Chen
}