pca_vcf: Perform PCA on a VCF file using 'akt pca' and consume result

View source: R/vcf.R

pca_vcfR Documentation

Perform PCA on a VCF file using 'akt pca' and consume result

Description

Perform PCA on a VCF file using 'akt pca' and consume result

Usage

pca_vcf(
  vcf,
  samples = NULL,
  skeleton = NULL,
  K = 10,
  meta = NULL,
  region = NULL,
  useX = FALSE,
  ...
)

Arguments

vcf

path to VCF file; must be indexed

samples

optional character vector of sample IDs to which the analysis should be restricted

K

number of PCs to compute

region

genomic region on which to perform PCA, as samtools-style region expression (eg. "chr1:1-10")

...

ignored

Details

This function generates a command-line call to akt pca, whose output is directed to a set of temporary files and then read into the R session.

Value

An object of classes data.frame 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.