Skip to contents

Converts validated PCA coordinates and eigenvalues into canonical tables, vector and raster figures, manuscript methods text, a figure caption, source data, and machine-readable validation checks.

Usage

write_pca_publication_artifacts(
  coordinates,
  eigenvalues,
  metadata = NULL,
  output_dir,
  palette = NULL,
  module = "pca",
  variance_percent = NULL
)

Arguments

coordinates

Data frame containing sample_id, PC1, and PC2.

eigenvalues

Numeric PCA eigenvalues, for reference/diagnostic display only.

metadata

Optional data frame containing sample_id and population.

output_dir

Analysis output directory.

palette

Optional named population colour vector.

module

Artifact module name.

variance_percent

Optional pre-computed percent-of-total-variance for each component (same length/order as eigenvalues), on a 0-100 scale. Required whenever eigenvalues is a truncated subset of a larger spectrum (e.g. SNPRelate::snpgdsPCA(eigen.cnt = N)'s retained-only eigenvalues): eigenvalues / sum(eigenvalues) is only the true percent of TOTAL variance when eigenvalues is the complete spectrum, and silently inflates every percentage otherwise. Defaults to NULL, which falls back to treating eigenvalues as the complete spectrum – correct only when it genuinely is.

Value

A PopgenVCFArtifactManifest.