Predict the PCA scores for a gt_pca, either for the original data or projecting new data.

# S3 method for class 'gt_pca'
predict(
  object,
  new_data = NULL,
  project_method = c("none", "simple", "OADP", "least_squares"),
  lsq_pcs = c(1, 2),
  block_size = NULL,
  n_cores = 1,
  ...
)

Arguments

object

the gt_pca object

new_data

a gen_tibble if scores are requested for a new dataset

project_method

a string taking the value of either "simple", "OADP" (Online Augmentation, Decomposition, and Procrustes (OADP) projection), or "least_squares" (as done by SMARTPCA)

lsq_pcs

a vector of length two with the values of the two principal components to use for the least square fitting. Only relevant ifproject_method = 'least_squares'

block_size

number of loci read simultaneously (larger values will speed up computation, but require more memory)

n_cores

number of cores

...

no used

Value

a matrix of predictions, with samples as rows and components as columns. The number of components depends on how many were estimated in the gt_pca object.

References

Zhang et al (2020). Fast and robust ancestry prediction using principal component analysis 36(11): 3439–3446.