plink_pca: Plink PCA analysis

Description Usage Arguments Value

View source: R/plink_pca.R

Description

Plink PCA analysis

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
plink_pca(
  input,
  output,
  pop,
  col,
  iid_col,
  pop_col,
  ell_col,
  ld = c(50, 5, 0.5),
  pc.x = c(2, 3, 4, 3, 4, 4),
  pc.y = c(1, 1, 1, 2, 2, 3),
  k,
  track_iid = F,
  track_outlier = F,
  plot = T,
  plot_type = "png"
)

Arguments

input

Character. The name (and path) of the plink binary files without extension.

output

Character. The prefix name for the output files.

pop

Optional. Data.frame or data.table containing the first two columns of the fam file (named as FID and IID, respectively), and additional columns with desired information for grouping populations (color and/or ellipses).

col

Optional. A named vector containing color name/code for each population.

iid_col

Optional. Character. Column name of the pop data.frame/data.table indicating the target-individuals.

pop_col

Optional. Character. Column name of the pop data.frame/data.table indicating the target-populations.

ell_col

Optional. Character. Column name of the pop data.frame/data.table for plotting ellipses. These ellipses are normal confidence ellipses computed by 'stat_ellipse' function from 'ggplot2' package.

ld

Numeric vector of length = 3. Indicates the window, step size and correlation threshold for LD filter, respectively. Default set to c(50, 5, 05). Set it to NULL if no LD filter is desired.

pc.x

Numeric vector. PC IDs for plotting. Default set to c(2, 3, 4, 3, 4, 4).

pc.y

Numeric vector. PC IDs for plotting. Default set to c(1, 1, 1, 2, 2, 3).

k

Numeric. Max number of PCs to be combined as figures. Default set to the length of pc.x/pc.y

track_iid

Character vector. Target individuals to be mapped on plot. Default set to FALSE (none).

track_outlier

Logical. Should outlier individuals be tracked on the figures? Default set to FALSE.

plot

Logical. Should PCA figures be generated? Default set to TRUE.

plot_type

Character. File format for output figures (e.g. bmp, jpeg, png, tiff, or pdf). Default set to png.

Value

List of PCA figures tracking down outlier individuals. Written PCA table and figures.


cmcouto-silva/gt documentation built on June 6, 2021, 7:14 p.m.