cluster_pca: Vizualise how missing data thresholds affect sample...

Description Usage Arguments Value Examples

View source: R/cluster_pca.R

Description

This function can be run in two ways: 1) Without 'thresholds' specified. This will run a PCA for the input vcf without filtering, and visualize the clustering of samples in two-dimensional space, coloring each sample according to a priori population assignment given in the popmap. 2) With 'thresholds' specified. This will filter your input vcf file to the specified missing data thresholds, and run a PCA for each filtering iteration. For each iteration, a 2D plot will be output showing clustering according to the specified popmap. This option is ideal for assessing the effects of missing data on clustering patterns.

Usage

1
cluster_pca(vcfR, popmap = NULL, thresholds = NULL, clustering = TRUE)

Arguments

vcfR

a vcfR object

popmap

set of population assignments that will be used to color code the plots

thresholds

optionally specify a vector of missing data filtering thresholds to explore

clustering

use partitioning around medoids (PAM) to do unsupervised clustering on the output? (default = TRUE, max clusters = # of levels in popmap + 2)

Value

a series of plots showing the clustering of all samples in two-dimensional space

Examples

1
2
3
assess_missing_data_pca(vcfR = species.clusteRs::vcfR.example,
popmap = species.clusteRs::popmap,
thresholds = c(.6,.8))

DevonDeRaad/species.clusteRs documentation built on Dec. 17, 2021, 4:12 p.m.