plot.pcair {GENESIS} | R Documentation |
plot.pcair
is used to plot pairs of principal components contained in a class 'pcair
' object obtained as output from the pcair
function.
## S3 method for class 'pcair' plot(x, vx = 1, vy = 2, pch = NULL, col = NULL, xlim = NULL, ylim = NULL, main = NULL, sub = NULL, xlab = NULL, ylab = NULL, ...)
x |
An object of class ' |
vx |
An integer indicating which principal component to plot on the x-axis; the default is 1. |
vy |
An integer indicating which principal component to plot on the y-axis; the default is 2. |
pch |
Either an integer specifying a symbol or a single character to be used in plotting points. If |
col |
A specification for the plotting color for points. If |
xlim |
The range of values shown on the x-axis. If |
ylim |
The range of values shown on the y-axis. If |
main |
An overall title for the plot. If |
sub |
A sub title for the plot. If |
xlab |
A title for the x-axis. If |
ylab |
A title for the y-axis. If |
... |
Other parameters to be passsed through to plotting functions, (see |
This function provides a quick and easy way to plot principal components obtained with the function pcair
to visualize the population structure captured by PC-AiR.
A figure showing the selected principal components plotted against each other.
Matthew P. Conomos
pcair
for obtaining principal components that capture population structure in the presence of relatedness.
par
for more in depth descriptions of plotting parameters.
The generic function plot
.
library(GWASTools) # file path to GDS file gdsfile <- system.file("extdata", "HapMap_ASW_MXL_geno.gds", package="GENESIS") # read in GDS data HapMap_geno <- GdsGenotypeReader(filename = gdsfile) # create a GenotypeData class object HapMap_genoData <- GenotypeData(HapMap_geno) # load saved matrix of KING-robust estimates data("HapMap_ASW_MXL_KINGmat") # run PC-AiR mypcair <- pcair(genoData = HapMap_genoData, kinMat = HapMap_ASW_MXL_KINGmat, divMat = HapMap_ASW_MXL_KINGmat) # plot top 2 PCs plot(mypcair) # plot PCs 3 and 4 plot(mypcair, vx = 3, vy = 4) close(HapMap_genoData)