pca_plink: Perform PCA using 'plink2'

View source: R/pca.R

pca_plinkR Documentation

Perform PCA using 'plink2'

Description

Perform PCA using 'plink2'

Usage

pca_plink(
  bfile,
  skeleton = NULL,
  samples = NULL,
  max_missing = 0,
  min_maf = 0,
  ...
)

Arguments

skeleton

optional character vector fo sample IDs to use for constructing PCs

samples

optional character vector of sample IDs to project (if using 'skeleton', should include all reference samples)

max_missing

input filter for 'plink' corresponding to '–geno'

min_maf

input filter for 'plink' corresponding to '–maf'

...

ignored

vcf

path to 'plink' binary fileset (bed/bim/fam)

Details

This function generates command-line calls to plink2, whose output is directed to a set of temporary files and then read into the R session. This requires the hottest version (alpha 3 or newer) of plink2.

Value

An object of classes tbl_df and pca_result whose columns are the projections of samples onto PCs. Eigenvalues, expressed as proportion of variance explained, are returned as an attribute.


andrewparkermorgan/popcorn documentation built on July 8, 2023, 12:42 p.m.