API Quick Reference
Every accessor by domain, with what it takes and what it returns
A flat index of the user-facing surface. For argument-level detail use the
reference section or ? on the accessor; for how the pieces fit together
use the guide.
Everything below is reached through one of five environments plus workspace. A handful
of functions are called directly because they have no accessor home; they are listed at
the end.
generate
Where a model comes from — either imported or built.
| Call | Returns |
|---|---|
generate$from.pgs.catalog(ids, id.type) |
PGS library, imported by accession, publication or trait |
generate$from.pgs.file(path) |
model, or PGS library from a directory or vector |
generate$models(sources, algorithms, target.build, naming, .execute) |
PGS library from the cross-join of sources and algorithms |
generate$sources$local(gwas, metadata) |
source specifications from in-memory tables or loader functions |
generate$sources$opengwas(ids, opengwas.jwt, wait.for.allowance) |
source specifications for OpenGWAS studies |
generate$sources$gwascatalog(ids) |
source specifications for GWAS Catalog accessions |
generate$algorithms$ClumpingThresholding(pval, reference.panel, ...) |
algorithm specifications |
generate$algorithms$LDpred2(mode, ...) |
algorithm specifications |
generate$algorithms$lassosum2(...) |
algorithm specifications |
generate$algorithms$PRScs(phi, ...) |
algorithm specifications |
Sources and algorithms declare; nothing is fetched or computed until generate$models()
runs. Model weights are always log-scale per-allele effects, and the genome build must be
one of the two supported assemblies.
compute
Quantities derived from your genotypes. Every one of these returns a value you assign — none writes into the cohort object.
| Call | Returns |
|---|---|
compute$scores(data, models, maf.thr, ...) |
samples × models score matrix, with a provenance log |
compute$populationStructure(data, npcs, variants, reference.panel) |
samples × PCs embedding, columns PC1..PCn |
compute$relatedness$kinship(data, degree, threshold, variants) |
sparse samples × samples kinship matrix |
compute$relatedness$prune(data, degree, threshold, key) |
logical, one per sample in study order — a decision, not a subset |
compute$similarity$samples(data, layer, method, samples, use) |
samples × samples similarity |
compute$similarity$models(data, layer, method, models, use) |
models × models similarity |
compute$embedding$samples(data, layer, method, similarity, n.components, samples, ...) |
samples × components, columns <METHOD><k> |
compute$embedding$models(data, layer, method, similarity, n.components, models, ...) |
models × components |
compute$genome$concordance(...) |
positioned signal object |
compute$genome$convergence(...) |
positioned signal object |
compute$genome$attribution(...) |
positioned signal object |
compute$genome$cumulativeWeight(...) |
positioned signal object |
Argument naming is symmetric here: both similarity and embedding take samples on
the sample side and models on the model side.
associate
Effect estimates. Never computes scores for you.
| Call | Returns |
|---|---|
associate$regression(data, outcomes, predictors, scores.layer, split.by, interactions, covariates, model, p.adjust.method, artifacts, output, ...) |
association; one row per outcome × predictor × term × stratum |
associate$compare(data, outcomes, predictors, groups.by, type, ...) |
association, comparison schema; incremental, contrast or heterogeneity |
associate$mediation(data, exposure, mediator, outcome, covariates, conf.level, ...) |
association; three rows per fit |
associate$singleVariant(data, phenotypes, variants, covariates, split.by, maf, mac, vif, ...) |
association, GWAS column naming |
associate$meta(..., by, method, conf.level, output) |
pooled association |
associate$mr(...) |
not implemented — errors |
Note that singleVariant() takes phenotypes, not outcomes.
evaluate
Comparing candidate models. The score layer must already exist; like associate, nothing
here scores or standardises it for you.
| Call | Returns |
|---|---|
evaluate$performance(data, outcomes, scores.layer, split.by, bootstrap, conf.level) |
evaluation |
evaluate$incremental(data, outcomes, covariates, scores.layer, split.by, bootstrap, ...) |
evaluation; requires covariates |
evaluate$association(data, outcomes, covariates, scores.layer, split.by, ...) |
evaluation; delegates to associate$regression() |
evaluate$stratification(data, outcomes, covariates, scores.layer, quantiles, reference, ...) |
evaluation |
evaluate$compare(data, outcomes, scores.layer, metric, reference.model, bootstrap, ...) |
evaluation |
evaluate$redundancy(data, scores.layer, method) |
evaluation; takes no outcomes |
evaluate$profile(data, outcomes, covariates, scores.layer, split.by, ...) |
evaluation combining several components |
evaluate$select(results, metrics) |
data.table ranking, one row per outcome x model |
profile() runs incremental value only if covariates is supplied, which changes what
select() ranks on. All metrics are in-sample.
visualize
Figures. Never computes a statistic it reports.
| Family | Entries |
|---|---|
visualize$data$ |
scores$distribution, scores$distribution.heatmap, scores$heatmap, similarity$samples, similarity$models, embedding$samples, embedding$models |
visualize$models$ |
sizes, reuse, uniqueness, top.variants |
visualize$associations$ |
forest, heatmap, survival, variants.qq |
visualize$evaluate$ |
performance; incremental; association; stratification; compare; redundancy; profile |
visualize$genome$ |
stack, overview, region, manhattan, prs, reuse, coverage, effects, concordance, convergence, cumulativeWeight, attribution |
visualize$palette$ |
tokens, neutral, categorical, sequential, diverging, theme, scale$color, scale$colour, scale$fill |
visualize$execution$ |
dashboard, performance |
plot() on a result gives its default figure. Return types differ — ggplot, patchwork,
ComplexHeatmap, a genome-track specification, or a named list — and that difference
affects both composition and saving. See the plots chapter.
workspace
| Call | Purpose |
|---|---|
workspace$config$update(root, max.cores, max.memory, oversubscribe, verbosity, execution.status, palette) |
configuration; rebuilds the executor when needed |
workspace$catalogs$genomeBuilds |
supported assemblies and aliases |
workspace$catalogs$referencePanels |
reference panels |
workspace$catalogs$liftoverChains |
liftover chains |
workspace$catalogs$variantSpaces |
named variant sets |
workspace$catalogs$ldBlocks |
approximately independent LD blocks |
workspace$setup$install(...) |
download a tool stack, or register one you have |
workspace$setup$check() |
print what is present |
workspace$setup$status() |
the same, returned silently as a data frame |
install() with no arguments does nothing.
Called directly
These have no accessor home.
| Call | Purpose |
|---|---|
PolyGeniusStudy(name, library, genotypes, samples, sample.pairs, uns, ...) |
construct one cohort's study object |
PGS(variants, name, build, gwas, generation, ...) |
construct a model from a variant table |
GenotypeSource(name, path, files, format, build, samples) |
point at genotype files |
GenotypeSourceSet(...) |
combine genotypes as distinct sample blocks |
savePolyGenius(data, path) |
write a study, model, PGS library, association or evaluation to a .pgd file |
loadPolyGenius(path, genotypes = NULL) |
read a .pgd file back, in full; genotypes points filesets at new directories |
align(value, by = NULL) |
match a table's rows to a study's samples by an ID column when assigning it |
as.PGS(x) |
convert a PGSLibraryView into an owned, portable PGS |
outcome(...), surv(time, event) |
declare an outcome |
liftover(x, to.build) |
convert coordinates between builds |
provenance(x) |
the record of what produced x — call, arguments, and what was resolved |
artifacts(x), diagnostics(x) |
the derived tables and the counts that go with a result |
artifacts(x, field) |
one artifact, with its identity columns rejoined |
Conventions that hold everywhere
Argument and function names use dots, never underscores.
Outcomes, covariates and predictors are given unquoted and resolved against the cohort object. Naming a matrix-valued slot expands every one of its columns.
scores.layer defaults to X, which matters if you standardised into a different layer.
Adjusted p-values are computed per call, never across calls.
Results are typed objects with results, artifacts, diagnostics and metadata;
associations add fits.