Contents
PolyGeniusSchema
Schema definition for PolyGenius result tables
Constructs the column and artifact contract for the result table produced by one analysis type. Each analysis type registers exactly one schema, used for column validation and coercion, default plot dispatch, meta-analysis eligibility and federation disclosure.
Usage
PolyGeniusSchema(
name,
required.cols = list(),
optional.cols = list(),
required.artifacts = character(),
optional.artifacts = character(),
minimal.artifacts = character(),
federation.safe.artifacts = character(),
allowed.plots = character(),
default.plot = NA_character_,
meta.keys = character(),
meta.counts = character(),
meta.means = character()
)Arguments
| Argument | Description |
|---|---|
name | Character scalar. Canonical schema identifier (e.g. "lm", "cox", "auc", "calibration"). Must be non-empty. |
required.cols | Named list of zero-length typed prototypes, default list(). Columns that must always be present in the results table. |
optional.cols | Named list of zero-length typed prototypes, default list(). Columns that may be present. |
required.artifacts | Character vector, default character(). Artifact names the analysis must produce. |
optional.artifacts | Character vector, default character(). Artifact names the analysis may produce. |
minimal.artifacts | Character vector, default character(). Artifact names retained when the caller requests artifacts = "minimal", typically cheap per-fit scalar summaries. The default drops every artifact for this schema under "minimal". |
federation.safe.artifacts | Character vector, default character(). Allowlist of artifact names that are aggregate over the fitted sample -- no row corresponds to one observation -- and so may leave a study site under federate(). Evaluated default-deny: a name absent from this vector is unsafe even when declared elsewhere on the schema. It is a disclosure dial, orthogonal to the cost dial the other artifact arguments form, and every name given must also appear in required.artifacts, optional.artifacts or minimal.artifacts. |
allowed.plots | Character vector, default character(). Registered plot types that can render this schema. |
default.plot | Character scalar, default NA_character_. Plot type used when plot() is called on a result object carrying this schema. |
meta.keys | Character vector, default character(). Columns that define one meta-analysis cell for this analysis type; a non-empty value marks the schema meta-eligible and associate$meta() groups on these columns. Empty means results of this schema cannot be pooled. |
meta.counts | Character vector, default character(). Columns summed across the studies contributing to a meta-analysis cell (e.g. sample sizes, event counts). |
meta.means | Character vector, default character(). Columns pooled as a sample-size-weighted mean across studies (e.g. effect-allele frequency) rather than summed. |
Value
A PolyGeniusSchema object: a named list carrying one element per argument --
name, required.cols, optional.cols, required.artifacts, optional.artifacts,
minimal.artifacts, federation.safe.artifacts, allowed.plots, default.plot,
meta.keys, meta.counts, meta.means -- with class "PolyGeniusSchema".
Details
Aborts when name is not a single non-empty string, and when federation.safe.artifacts
names an artifact that none of the other artifact arguments declares.
Examples
PolyGeniusSchema(
name = "example",
required.cols = list(model = character(), estimate = numeric(), pval = numeric()),
allowed.plots = "forest",
default.plot = "forest",
meta.keys = c("model", "outcome"),
meta.counts = "n.samples"
)