| Title: | VeloMetrix R Client |
|---|---|
| Description: | A native R client for the VeloMetrix REST API (vmx-api). Wraps the treatment-to-simulation analysis workflow in ergonomic, pipe-friendly verbs that block-and-poll for asynchronous server jobs and return native R objects (tibbles and typed S3 objects). The package orchestrates server-side jobs; it holds no business logic of its own. Targets API 0.2.x and 0.3 / CLI 0.6.x. |
| Authors: | Eric Novik [aut, cre], Juho Timonen [ctb], Generable [cph, fnd] |
| Maintainer: | Eric Novik <[email protected]> |
| License: | Apache License (>= 2) |
| Version: | 0.3.0 |
| Built: | 2026-10-27 08:26:51 UTC |
| Source: | https://github.com/generable/vmxr |
A sentinel for an explicit "All specimens" selection. Pass it as
pk_specimen to vmx_nca(), vmx_modeling_options() or
vmx_model_build() to pool PK observations across every specimen, or as the
specimen of vmx_pd_marker() to pool one PD marker across its specimens.
vmx_all_specimens()vmx_all_specimens()
All specimens is never a default; a call that needs a specimen and gets none fails rather than choosing one.
A vmx_all_specimens object.
vmx_all_specimens()vmx_all_specimens()
GET /studies/{std_id}/analysis-log — the complete unified newest-first
event feed, with a kind discriminator per row.
vmx_analysis_log( study, kind = NULL, event_type = NULL, outcome = NULL, severity = NULL, since = NULL, resource = NULL, client = vmx_client(), event_code = NULL, requires_staff_review = NULL )vmx_analysis_log( study, kind = NULL, event_type = NULL, outcome = NULL, severity = NULL, since = NULL, resource = NULL, client = vmx_client(), event_code = NULL, requires_staff_review = NULL )
study |
A study id ( |
kind |
Optional kind filter. |
event_type |
Optional event-type filter. |
outcome |
Optional outcome filter. |
severity |
Optional severity filter. |
since |
Optional lower time bound: a |
resource |
Optional resource id (or object) to scope to. |
client |
A |
event_code |
Optional event-code filter. |
requires_staff_review |
Optional staff-review filter. |
A tibble containing all matching events, newest first.
Resolves connection config with the precedence: explicit args ->
VMX_API_BASE_URL / VMX_API_TOKEN environment variables -> ~/.Renviron
-> a classed error. The token is stored on the object but redacted in
print() and never logged.
vmx_client(base_url = NULL, token = NULL, ...)vmx_client(base_url = NULL, token = NULL, ...)
base_url |
API base URL. Defaults to |
token |
Authentik personal access token (PAT). Defaults to
|
... |
Reserved for future options (timeouts, retries, user agent). |
When no token is supplied (neither token= nor VMX_API_TOKEN), the client
auto-authenticates via OIDC: it reads the token cached by vmx_login()
(~/.config/vmx/oidc-token.json), refreshing it silently when expired, and
– in an interactive session – running vmx_login() if there is no usable
cached token. This requires VMX_OIDC_ISSUER + VMX_OIDC_CLIENT_ID to be
set; otherwise a vmx_auth_error names both auth methods.
The bearer token is resolved per request, not frozen at construction: a
PAT is constant, but an OIDC access token is short-lived (~5-10 min), so a
long-lived con <- vmx_client() re-resolves each request and silently
refreshes from the cached refresh token when the access token is near expiry.
This lets a reused client keep working across a full analysis session without
re-login (GEN-2344).
An object of class vmx_client.
Fetch one data version
vmx_data_version(id, client = vmx_client())vmx_data_version(id, client = vmx_client())
id |
A data-version id ( |
client |
A |
A vmx_data_version.
Archive a data version
vmx_data_version_archive(dv, reason = NULL, client = vmx_client())vmx_data_version_archive(dv, reason = NULL, client = vmx_client())
dv |
A data-version id or |
reason |
Optional free-text reason. |
client |
A |
The updated vmx_data_version.
Starts a format job over an explicit upload composition
(POST /datasets/{ds_id}/data-versions). Returns the in-flight prep-status;
poll it with vmx_wait().
vmx_data_version_create( dataset, uploads, prior_config = NULL, client = vmx_client() )vmx_data_version_create( dataset, uploads, prior_config = NULL, client = vmx_client() )
dataset |
A dataset id ( |
uploads |
Character vector of upload ids ( |
prior_config |
Optional prior data-version ( |
client |
A |
A vmx_prep_status for the new job.
Fetches the export envelope (GET /data-versions/{id}/export). Pass dest
to obtain the bundle: it is streamed to that path via the server's signed
download URL. That URL is short-lived — its life is measured in seconds — and
is not returned. Without dest, the parsed envelope is returned with its
download_url removed, leaving the export's details (its size, its file list,
its data version).
vmx_data_version_export(dv, dest = NULL, client = vmx_client())vmx_data_version_export(dv, dest = NULL, client = vmx_client())
dv |
A data-version id or |
dest |
Optional local file path to stream the bundle to. Pass it to obtain the bundle; without it no download link is returned. |
client |
A |
Without dest, the export envelope (list) minus its short-lived
download_url. With dest, dest invisibly once the bundle is streamed.
GET /data-versions/{id}/tables/{domain} — returns the formatter's prepared
domain table as a tibble (columns typed per the server's column metadata,
which is attached as the "columns" attribute). gen_subject_uuid is the
canonical subject join key.
vmx_data_version_table( dv, domain = c("subjects", "pk", "dosing", "pd", "labs", "covariates"), time_basis = NULL, client = vmx_client() )vmx_data_version_table( dv, domain = c("subjects", "pk", "dosing", "pd", "labs", "covariates"), time_basis = NULL, client = vmx_client() )
dv |
A data-version id ( |
domain |
One of |
time_basis |
Optional time basis name (e.g. |
client |
A |
API 0.3 projects every analytical table on a time basis and requires the
time_basis query parameter. When time_basis is NULL, the
DataVersion's recommended basis is used (fetching the DataVersion first if
only an id was given). A v0.3 DataVersion with no recommended basis (no
basis has PK-eligible subjects) needs an explicit time_basis; only a
DataVersion without a time_bases map (an API 0.2 server) is fetched
without the parameter.
A tibble. The selected basis is attached as the "time_basis"
attribute when one was requested or echoed.
Unarchive a data version
vmx_data_version_unarchive(dv, client = vmx_client())vmx_data_version_unarchive(dv, client = vmx_client())
dv |
A data-version id or |
client |
A |
The updated vmx_data_version.
The modeling-eligibility filter maps onto whichever query param the served
API contract accepts. The 0.2.2 API filters on a single basis-agnostic
eligible_for_modeling boolean; the 0.3 API replaced it with the
basis-scoped pk_eligible_for_modeling_after_qc filter, which requires a
companion time_basis (api-contract §5.4). Because a 0.3 server
silently drops the unknown 0.2.2 param and returns the full unfiltered
list, the served shape is detected first — from /health's
api_contract_version (§5.13) — and the filter is mapped accordingly; a
0.3 server asked to filter without a time_basis errors rather than
returning an unfiltered list.
vmx_data_versions( treatment = NULL, study = NULL, include_archived = FALSE, eligible_for_modeling = NULL, client = vmx_client(), time_basis = NULL )vmx_data_versions( treatment = NULL, study = NULL, include_archived = FALSE, eligible_for_modeling = NULL, client = vmx_client(), time_basis = NULL )
treatment |
Optional treatment filter. |
study |
Optional study filter. |
include_archived |
Include archived versions. |
eligible_for_modeling |
Optional modeling-eligibility filter ( |
time_basis |
Optional time basis: one of |
client |
A |
A tibble containing all matching data versions.
Fetch one dataset
vmx_dataset(id, client = vmx_client())vmx_dataset(id, client = vmx_client())
id |
A dataset id ( |
client |
A |
A vmx_dataset.
POST /datasets/{ds_id}/cancel — terminates the format job and mints a
cancelled DataVersion.
vmx_dataset_cancel(dataset, client = vmx_client())vmx_dataset_cancel(dataset, client = vmx_client())
dataset |
A dataset id or |
client |
A |
The updated vmx_prep_status.
Not implemented: the API's dataset-files listing does not expose per-file
download URLs. Use vmx_data_version_export() to pull a curated bundle.
vmx_dataset_download(dataset, dest = ".", client = vmx_client())vmx_dataset_download(dataset, dest = ".", client = vmx_client())
dataset |
A dataset id or |
dest |
Destination directory. |
client |
A |
Not yet implemented.
List the files in a dataset
vmx_dataset_files(dataset, client = vmx_client())vmx_dataset_files(dataset, client = vmx_client())
dataset |
A dataset id or |
client |
A |
A tibble containing all files in the dataset.
Returns the dataset's allowlisted tag map as a two-column (key, value)
tibble. Reads the tags off a vmx_dataset object when given one, else
fetches the dataset.
vmx_dataset_tags(dataset, client = vmx_client())vmx_dataset_tags(dataset, client = vmx_client())
dataset |
A dataset id or |
client |
A |
A tibble with key and value columns.
List datasets
vmx_datasets(study = NULL, treatment = NULL, client = vmx_client())vmx_datasets(study = NULL, treatment = NULL, client = vmx_client())
study |
Optional study filter. |
treatment |
Optional treatment filter. |
client |
A |
A tibble containing all matching datasets.
Dosing events table
vmx_dosing(dv, time_basis = NULL, client = vmx_client())vmx_dosing(dv, time_basis = NULL, client = vmx_client())
dv |
A data-version id or |
time_basis |
Optional time basis; see |
client |
A |
A tibble.
POST /model-fits/{mf_id}/simulation-dosing-inputs.
vmx_dosing_input( fit, dosing_text, scenario_name, client = vmx_client(), wait = FALSE, ... )vmx_dosing_input( fit, dosing_text, scenario_name, client = vmx_client(), wait = FALSE, ... )
fit |
A fit id ( |
dosing_text |
The dosing regimen text. |
scenario_name |
One or more scenario names. |
client |
A |
wait |
If |
... |
Polling controls forwarded to |
A vmx_dosing_input (carries dosing_input_id).
Dosing-input status
vmx_dosing_input_status(dosing_input, client = vmx_client())vmx_dosing_input_status(dosing_input, client = vmx_client())
dosing_input |
A dosing-input id or |
client |
A |
A vmx_dosing_input.
One row per estimate, preserving the server-selected point statistic, interval kind, interval level, and tagged estimate metadata.
vmx_fit_global_estimates(fit, client = vmx_client())vmx_fit_global_estimates(fit, client = vmx_client())
fit |
A fit id or |
client |
A |
A tibble.
Reshapes the PK block into one row per observation. The returned prediction
columns retain the server-selected point statistic and interval semantics.
A named list of equivalently reshaped PD-marker tibbles is attached as the
"pd_markers" attribute; units and marker references remain attributes on
their respective tibbles.
vmx_fit_obs_vs_pred(fit, client = vmx_client())vmx_fit_obs_vs_pred(fit, client = vmx_client())
fit |
A fit id or |
client |
A |
A tibble (one row per PK observation).
One row per subject x estimate. value_statistic, interval_kind, and
interval_level preserve the server-selected estimate semantics;
interval_lower and interval_upper are the corresponding bounds. Tagged
estimate metadata is retained as columns rather than interpreted by vmxr.
vmx_fit_subject_estimates(fit, client = vmx_client())vmx_fit_subject_estimates(fit, client = vmx_client())
fit |
A fit id or |
client |
A |
A tibble.
Returns the parsed Visual Predictive Check artifact. Its subject and dose-group channels contain model-implied response trajectories with the server-provided point statistic and interval. The nested wire shape is retained verbatim.
vmx_fit_vpc(fit, client = vmx_client())vmx_fit_vpc(fit, client = vmx_client())
fit |
A fit id or |
client |
A |
A list (the parsed artifact).
Calls GET /health.
vmx_health(client = vmx_client())vmx_health(client = vmx_client())
client |
A |
Invisibly, a vmx_health object (status, version,
api_contract_version, engine, engine_version); raises a classed error
if the API is unreachable or unhealthy.
Runs the OIDC device-code flow (RFC 8628, via httr2::oauth_flow_device())
against the workspace's Authentik provider and caches the resulting token so
later vmx_client() calls authenticate automatically. Endpoints are resolved
from the issuer's .well-known/openid-configuration discovery document; the
flow uses a public client (no secret, no PKCE) and requests
offline_access so Authentik issues a refresh token.
vmx_login(issuer = NULL, client_id = NULL, scopes = NULL, cache_path = NULL)vmx_login(issuer = NULL, client_id = NULL, scopes = NULL, cache_path = NULL)
issuer |
OIDC issuer base URL. Defaults to |
client_id |
Public OIDC client id. Defaults to |
scopes |
Space-separated scopes. Defaults to |
cache_path |
Where to cache the token. Defaults to the CLI-shared
|
The token is written as plain JSON to ~/.config/vmx/oidc-token.json (the
same path and shape the vmx CLI uses, with 0600 permissions), so one
vmx_login() serves both R and the terminal CLI and the session survives a
fresh R process or workspace pod restart. Because the refresh token is
persisted on the home PVC, you log in once per provider-configured
refresh-token lifetime.
Configuration is read from environment variables (matching the CLI):
VMX_OIDC_ISSUER, VMX_OIDC_CLIENT_ID, and optionally VMX_OIDC_SCOPES.
Workspace deployments provision the issuer and client id; vmxr does not
assume values from a different workspace or environment.
Invisibly, the cached token (a list; the access/refresh tokens are secret and never printed).
Reads the selections the API accepted for a resource
(GET .../marker-selection). These are what the analysis actually used and
are never recomputed from the data version's current metadata.
vmx_nca_marker_selection(nca, client = vmx_client()) vmx_model_build_marker_selection(run, client = vmx_client()) vmx_model_fit_marker_selection(fit, client = vmx_client())vmx_nca_marker_selection(nca, client = vmx_client()) vmx_model_build_marker_selection(run, client = vmx_client()) vmx_model_fit_marker_selection(fit, client = vmx_client())
nca |
An NCA id ( |
client |
A |
run |
A build-run id ( |
fit |
A fit id ( |
vmx_nca_marker_selection() returns list(pk_specimen).
vmx_model_build_marker_selection() returns list(pk_specimen, pd_markers), where each PD entry carries gen_uuid, either
specimen_type or all_specimens = TRUE, and direction. A run
accepted before PD specimens were selectable may report only gen_uuid
and direction.
vmx_model_fit_marker_selection() returns list(pk_specimen, pd_marker);
pd_marker is NULL for a PK fit, and for a fit saved before specimen
selection it may carry only gen_uuid.
pk_specimen is list(specimen_type = "...") or
list(all_specimens = TRUE). An analysis accepted before PK specimens were
selectable reports all specimens.
A named list, as described above.
pk_specimen is required: one PK specimen type (for example "plasma") or
vmx_all_specimens(). vmxr never fills it in, not even from the data
version's recommendation; a call without it fails and lists the specimens
available. Each PD marker is a vmx_pd_marker() naming one specimen or all
specimens, with its direction. Two specimens of one marker may be selected
as separate entries. Read the accepted selections back with
vmx_model_build_marker_selection().
vmx_model_build( data_version, time_basis, pk_specimen, pd_marker = NULL, covariate = NULL, idempotency_key = NULL, retried_from = NULL, wait = FALSE, ..., client = vmx_client() )vmx_model_build( data_version, time_basis, pk_specimen, pd_marker = NULL, covariate = NULL, idempotency_key = NULL, retried_from = NULL, wait = FALSE, ..., client = vmx_client() )
data_version |
A data-version id or |
time_basis |
Time basis. |
pk_specimen |
One PK specimen type string, or |
pd_marker |
|
covariate |
Optional covariate name(s). |
idempotency_key |
Optional idempotency key. |
retried_from |
Optional prior run to retry from. |
wait |
If |
... |
Polling controls forwarded to |
client |
A |
A vmx_model_build_run.
Download build-run artifacts
vmx_model_build_artifacts(run, dest = ".", client = vmx_client())vmx_model_build_artifacts(run, dest = ".", client = vmx_client())
run |
A build-run id or object. |
dest |
Destination directory. |
client |
A |
Not yet implemented.
Cancel a build run
vmx_model_build_cancel(run, client = vmx_client())vmx_model_build_cancel(run, client = vmx_client())
run |
A build-run id or object. |
client |
A |
A vmx_model_build_run.
Build-run events (SSE stream)
vmx_model_build_events(run, client = vmx_client())vmx_model_build_events(run, client = vmx_client())
run |
A build-run id or object. |
client |
A |
Not yet implemented.
Markdown export of a build run
vmx_model_build_export(run, client = vmx_client())vmx_model_build_export(run, client = vmx_client())
run |
A build-run id or object. |
client |
A |
The export markdown as a length-1 character vector.
Build-run logs
vmx_model_build_logs(run, client = vmx_client(), order = c("desc", "asc"))vmx_model_build_logs(run, client = vmx_client(), order = c("desc", "asc"))
run |
A build-run id or object. |
client |
A |
order |
Newest-first ( |
A tibble containing all log lines in the requested order.
Build-run report status (signed HTML report URL when ready)
vmx_model_build_report(run, client = vmx_client())vmx_model_build_report(run, client = vmx_client())
run |
A build-run id or object. |
client |
A |
A list with status and, when ready, url.
POST /model-build-runs/{run_id}/report queues HTML report generation.
vmx_model_build_report_create( run, subject_plot_mode = c("all", "none"), client = vmx_client() )vmx_model_build_report_create( run, subject_plot_mode = c("all", "none"), client = vmx_client() )
run |
A build-run id or object. |
subject_plot_mode |
One of |
client |
A |
A list with report status.
Build-run results
vmx_model_build_results(run, client = vmx_client())vmx_model_build_results(run, client = vmx_client())
run |
A build-run id or object. |
client |
A |
A list (fits summary, modeling population, PK structure selection).
Run and fit reads request the API's marker-scopes representation, so runs
that select a PD marker across all specimens are listed and readable, and PD
selections report specimen_type or all_specimens.
vmx_model_build_runs( data_version = NULL, study = NULL, treatment = NULL, status = NULL, client = vmx_client() )vmx_model_build_runs( data_version = NULL, study = NULL, treatment = NULL, status = NULL, client = vmx_client() )
data_version, study, treatment, status
|
Optional filters. |
client |
A |
A tibble containing all matching model-build runs.
Build-run status
vmx_model_build_status(run, client = vmx_client())vmx_model_build_status(run, client = vmx_client())
run |
A build-run id ( |
client |
A |
A vmx_model_build_run.
GET /model-catalog returns categories of models; this flattens them into
one tibble with a category column.
vmx_model_catalog(data_version = NULL, client = vmx_client())vmx_model_catalog(data_version = NULL, client = vmx_client())
data_version |
Optional data-version to tailor the catalog to. |
client |
A |
A tibble.
Returns a vmx_model_data bundle with $subjects, $pk, $dosing, $pd,
$labs and $covariates (each a tibble, or NULL when the DataVersion has
no such prepared table), and $meta (units, time bases, the selected
time_basis, PD-marker manifest, subject count) read from the DataVersion.
Only domains flagged in the DV's table_availability are fetched, so absent
optional tables don't 404. Every table is projected on the same time basis.
vmx_model_data(dv, time_basis = NULL, client = vmx_client())vmx_model_data(dv, time_basis = NULL, client = vmx_client())
dv |
A data-version id or |
time_basis |
Optional time basis; defaults to the DataVersion's
recommended basis. See |
client |
A |
A vmx_model_data object.
Describe a model
vmx_model_describe(model_name, client = vmx_client())vmx_model_describe(model_name, client = vmx_client())
model_name |
Catalog model name. |
client |
A |
A named list.
Fetch one model fit's details
vmx_model_fit(id, client = vmx_client())vmx_model_fit(id, client = vmx_client())
id |
A fit id ( |
client |
A |
A vmx_model_fit (metadata / model / inference).
Model-fit postprocessor status
vmx_model_fit_postprocessor_status(fit, client = vmx_client())vmx_model_fit_postprocessor_status(fit, client = vmx_client())
fit |
A fit id or |
client |
A |
A list with postprocessor status.
Requests the marker-scopes representation, so fits of a PD marker selected
across all specimens are listed and each PD marker reports its specimen
scope.
vmx_model_fits( run = NULL, data_version = NULL, model_type = NULL, marker_name = NULL, status = NULL, client = vmx_client(), treatment = NULL, study = NULL, source_pk_model_fit = NULL )vmx_model_fits( run = NULL, data_version = NULL, model_type = NULL, marker_name = NULL, status = NULL, client = vmx_client(), treatment = NULL, study = NULL, source_pk_model_fit = NULL )
run |
Optional model-build run filter. |
data_version |
Optional data-version filter. |
model_type |
Optional model-type filter. |
marker_name |
Optional marker-name filter. |
status |
Optional model-fit status filter. |
client |
A |
treatment |
Optional treatment filter. |
study |
Optional study filter. |
source_pk_model_fit |
Optional source PK model-fit filter. |
A tibble containing all matching model fits.
POST /modeling-options previews the modeling population and available
covariates for one PK specimen scope, a set of PD marker selections and a
time basis. Nothing is persisted.
vmx_modeling_options( data_version, time_basis, pk_specimen, pd_marker = NULL, covariate = NULL, client = vmx_client() )vmx_modeling_options( data_version, time_basis, pk_specimen, pd_marker = NULL, covariate = NULL, client = vmx_client() )
data_version |
A data-version id or |
time_basis |
Time basis. |
pk_specimen |
One PK specimen type string, or |
pd_marker |
|
covariate |
Optional covariate name(s). |
client |
A |
pk_specimen is required: one PK specimen type (for example "plasma") or
vmx_all_specimens(). vmxr never fills it in, not even from the data
version's recommendation; a call without it fails and lists the specimens
available. Each PD marker is a vmx_pd_marker() naming one specimen or all
specimens; any direction on it is ignored here, so the same selections can
be passed on to vmx_model_build().
A list (the selection preview).
Creates the analysis (POST /nca-analyses) and, by default, blocks until it
settles. time_basis is one of "observed", "nominal",
"nominal_from_observed_dose", or "observed_from_predose_pk" (validated
server-side against the DataVersion's available bases).
vmx_nca( data_version, time_basis, pk_specimen, idempotency_key = NULL, retried_from = NULL, wait = TRUE, ..., client = vmx_client() )vmx_nca( data_version, time_basis, pk_specimen, idempotency_key = NULL, retried_from = NULL, wait = TRUE, ..., client = vmx_client() )
data_version |
A data-version id ( |
time_basis |
The time basis to compute on. |
pk_specimen |
One PK specimen type string, or |
idempotency_key, retried_from
|
Optional create fields. |
wait |
If |
... |
Polling controls forwarded to |
client |
A |
pk_specimen is required: name one PK specimen (for example "plasma") or
pass vmx_all_specimens() to pool every specimen. vmxr never chooses one for
you, not even the data version's recommended specimen; a call without it
fails and lists the specimens the data version offers. A named specimen needs
the data version's per-specimen marker analysis. Read the accepted selection
back with vmx_nca_marker_selection().
A vmx_nca_analysis.
List NCA analyses
vmx_nca_analyses( data_version = NULL, study = NULL, treatment = NULL, status = NULL, time_basis = NULL, client = vmx_client() )vmx_nca_analyses( data_version = NULL, study = NULL, treatment = NULL, status = NULL, time_basis = NULL, client = vmx_client() )
data_version |
Optional data-version ( |
study |
Optional study ( |
treatment |
Optional treatment ( |
status |
Optional status filter ( |
time_basis |
Optional time-basis filter. |
client |
A |
A tibble containing all matching analyses.
Fetch one NCA analysis
vmx_nca_get(id, client = vmx_client())vmx_nca_get(id, client = vmx_client())
id |
An NCA id ( |
client |
A |
A vmx_nca_analysis.
Reads the NCA result and returns a tidy tibble of point estimates, handling both server shapes transparently:
vmx_nca_result(nca, client = vmx_client())vmx_nca_result(nca, client = vmx_client())
nca |
An NCA id or |
client |
A |
API 0.3 returns a cursor-paged collection whose items[] are
NcaResultItems — one per result interval of interest. Every page is
followed to the end via next_cursor and the items are assembled without
truncation. Each row is one subject within one interval, and the per-interval
dimension is carried in the item_index, label, interval_start_hours,
and interval_end_hours columns (the two *_hours columns are NA when the
server did not resolve a time interval for that subject).
API 0.2.2 returns a single flat object with top-level per-subject
parallel arrays and one point_estimates map. Each row is one subject (there
is no per-interval dimension, so the interval columns are absent).
In both shapes the point_estimates map (metric -> per-subject values,
parallel to gen_subject_uuid) becomes one column per PK quantity, and
not_estimable_reasons — the per-subject map of metric -> reason strings — is
surfaced as the not_estimable_reasons list-column, so a null point estimate
carries its reason. Quantity metadata (display names, units, explanations) is
attached as the "quantities" attribute and the compact unit lookup as
"units"; for 0.3 these are the de-duplicated union across items.
A tibble.
Assembles one event table from a DataVersion's prepared pk, dosing,
subjects, covariates and (optionally) pd tables, in the layout nlmixr2
and rxode2 consume directly: one row per dose event and per observation,
ordered by subject and time.
vmx_nlmixr_data( dv, analyte = NULL, time_basis = NULL, eligibility = c("after_qc", "before_qc", "all"), pd_markers = NULL, cmt = NULL, replicate = FALSE, client = vmx_client(), pk_specimen = NULL )vmx_nlmixr_data( dv, analyte = NULL, time_basis = NULL, eligibility = c("after_qc", "before_qc", "all"), pd_markers = NULL, cmt = NULL, replicate = FALSE, client = vmx_client(), pk_specimen = NULL )
dv |
A data-version id ( |
analyte |
PK analyte to assemble, matched against |
time_basis |
Time basis to project on (e.g. |
eligibility |
Which modeling-eligibility flag admits a row:
|
pd_markers |
PD markers to include as additional observation endpoints:
|
cmt |
Named integer vector mapping dosing routes and |
replicate |
If |
client |
A |
pk_specimen |
PK specimen to assemble: one recorded specimen name (e.g.
|
Rows are ordered by subject and time; ties on TIME are ordered dose
before observation, which is how rxode2 and nlmixr2 resolve them, so a
pre-dose sample that shares its time with an IV bolus into the observation
compartment must carry its own earlier time in the source data.
Observations that share a subject, endpoint and time are always emitted in a
deterministic order — by the measurement uuid (gen_measurement_uuid, the
row identity on the pk/pd tables) and then source-row order — whether or not
the replicate index is requested. With replicate = TRUE the layout also
carries a REPLICATE column: the 1-based rank of each observation within its
(ID, DVID, TIME) group in that order, NA on dose rows and 1 for an
observation with no same-time partner. The index is derived here in R and is
deliberately not part of the DataVersion.
rxode2 and nlmixr2 treat any extra column as a covariate, and REPLICATE is
NA on dose rows, so drop it (dplyr::select(-REPLICATE)) before passing the
table to a fit unless the model uses it explicitly.
Columns: ID (dense integer per subject with admitted rows), TIME (hours on the selected
time basis), DV, AMT (mg), EVID (0 observation / 1 dose), MDV, CMT,
RATE (mg/h, > 0 for infusions), II, ADDL, SS (always 0 — the
DataVersion already expands doses per administration), CENS / LIMIT
(censoring: CENS = 1 with DV = lloq and LIMIT = 0 for BLQ rows,
CENS = -1 with DV = uloq and LIMIT = Inf for ALQ rows), DVID
(only when PD markers are included: 1 = PK, 2.. = one per PD endpoint, and
dose rows carry 1), subject_id, specimen_type (only when the DataVersion
records specimens: each observation's own recorded specimen, also inside a
pooled endpoint, and NA on dose rows), and one column per subject-level
covariate.
A marker measured in more than one specimen (plasma and serum, say) is one
marker with one input per specimen. The specimen is always the caller's
choice: with more than one PK specimen, pk_specimen is required, and a PD
marker with more than one specimen needs its specimens named in
pd_markers. The DataVersion's recommended PK specimen is never used as an
implicit choice. Each selection is admitted by the DataVersion's recorded
eligibility verdict for that scope on the selected basis: the specimen's own
verdict (by marker and specimen), or the All-specimens verdict when pooled.
A scope verdict that is not on the DataVersion itself is read from its
marker-analysis metadata. Pooling specimens that do not share one explicitly
known unit is an error that names the units found.
A DataVersion that predates specimens (no specimen_type column) is
assembled exactly as before.
Only rows the DataVersion marks as eligible for modeling are kept; the
after-QC flag is the contract's mandatory admission filter, and the result
is analysis-ready only under that default. before_qc and all are review
modes: they warn, mark the result analysis_ready = FALSE, and drop (with a
count) any retained-ineligible row that cannot be encoded — a null time, a
dose without canonical mass, a route outside the compartment map, an infusion
without a canonical rate. Every dropped-row count is on the "vmx" attribute
so nothing disappears silently.
A tibble in NONMEM layout. The "vmx" attribute is a list with
data_version_id, time_basis, units, analyte, pk_specimen (the
accepted PK scope, list(specimen_type = ) or list(all_specimens = TRUE),
or NULL when no specimen is recorded), eligibility, analysis_ready,
cmt, endpoints (a tibble of dvid, name, cmt, unit,
has_repeated_times — whether the endpoint carries any observation that
shares its time — and, when the DataVersion records specimens,
specimen_type (NA for a pooled endpoint) and all_specimens),
dropped (named integer counts), and n_subjects. With replicate = TRUE
the layout gains a REPLICATE column (see the argument).
vmx_model_data() for the underlying tidy tables.
vmx_nlmixr_data()
Extravascular routes (po, sc, im) dose into compartment 1 (depot);
intravenous routes (iv-bolus, iv-infusion) dose into compartment 2
(central); PK observations are read from compartment 2. Override by passing
a named integer vector with the same names to cmt.
vmx_nlmixr_default_cmt()vmx_nlmixr_default_cmt()
PD observations table
vmx_pd(dv, time_basis = NULL, client = vmx_client())vmx_pd(dv, time_basis = NULL, client = vmx_client())
dv |
A data-version id or |
time_basis |
Optional time basis; see |
client |
A |
A tibble.
Builds one PD marker selection for vmx_modeling_options() and
vmx_model_build(). Each selection names the marker's gen_uuid and either
one specimen (for example "serum") or vmx_all_specimens(). Two specimens
of the same marker may be selected as two separate entries; selecting one
marker both in a named specimen and in all specimens is an error.
vmx_pd_marker(gen_uuid, specimen, direction = NULL)vmx_pd_marker(gen_uuid, specimen, direction = NULL)
gen_uuid |
The PD marker's |
specimen |
One specimen type string (a value of the marker's
|
direction |
The run-scoped response direction, |
A vmx_pd_marker object.
vmx_pd_marker("8ffb3792-8bc9-4d38-b123-fc3e2170f6ee", "serum", "decreasing") vmx_pd_marker( "8ffb3792-8bc9-4d38-b123-fc3e2170f6ee", vmx_all_specimens(), "decreasing" )vmx_pd_marker("8ffb3792-8bc9-4d38-b123-fc3e2170f6ee", "serum", "decreasing") vmx_pd_marker( "8ffb3792-8bc9-4d38-b123-fc3e2170f6ee", vmx_all_specimens(), "decreasing" )
PK observations table
vmx_pk(dv, time_basis = NULL, client = vmx_client())vmx_pk(dv, time_basis = NULL, client = vmx_client())
dv |
A data-version id or |
time_basis |
Optional time basis; see |
client |
A |
A tibble.
Answer prep questions and resume formatting
vmx_prep_answer( dataset, answers, client = vmx_client(), idempotency_key = NULL )vmx_prep_answer( dataset, answers, client = vmx_client(), idempotency_key = NULL )
dataset |
A dataset id or |
answers |
A named list mapping each prompt |
client |
A |
idempotency_key |
Optional idempotency key for safely repeating the submission. |
Questions raised by prep (when awaiting input)
vmx_prep_questions(dataset, client = vmx_client())vmx_prep_questions(dataset, client = vmx_client())
dataset |
A dataset id or |
client |
A |
A tibble of pending questions. Variable-shape values such as
options, default, and data_preview are retained as list-columns.
Calls GET /datasets/{ds_id}/prep-status.
vmx_prep_status(dataset, client = vmx_client())vmx_prep_status(dataset, client = vmx_client())
dataset |
A dataset id ( |
client |
A |
A vmx_prep_status (status, and data_version_id once settled).
Cancel a simulation job
vmx_sim_cancel(job, client = vmx_client())vmx_sim_cancel(job, client = vmx_client())
job |
A job id or |
client |
A |
A vmx_simulation_job.
POST /model-fits/{mf_id}/existing-subject-simulation-jobs.
vmx_sim_existing_subject( fit, dosing_input, subjects, idempotency_key = NULL, retried_from = NULL, min_timepoints = NULL, wait = FALSE, ..., client = vmx_client() )vmx_sim_existing_subject( fit, dosing_input, subjects, idempotency_key = NULL, retried_from = NULL, min_timepoints = NULL, wait = FALSE, ..., client = vmx_client() )
fit |
A fit id or |
dosing_input |
A dosing-input id or |
subjects |
Subjects to simulate: a data.frame/tibble with
|
idempotency_key, retried_from
|
Optional create fields. |
min_timepoints |
Optional minimum number of simulated timepoints. |
wait |
If |
... |
Polling controls forwarded to |
client |
A |
A vmx_simulation_job.
POST /model-fits/{mf_id}/existing-subject-simulation-jobs/from-text.
vmx_sim_existing_subject_from_text( fit, dosing_text, subjects, idempotency_key = NULL, retried_from = NULL, min_timepoints = NULL, wait = FALSE, ..., client = vmx_client() )vmx_sim_existing_subject_from_text( fit, dosing_text, subjects, idempotency_key = NULL, retried_from = NULL, min_timepoints = NULL, wait = FALSE, ..., client = vmx_client() )
fit |
A fit id or |
dosing_text |
The dosing regimen text. |
subjects |
Subjects to simulate: a data.frame/tibble with
|
idempotency_key, retried_from
|
Optional create fields. |
min_timepoints |
Optional minimum number of simulated timepoints. |
wait |
If |
... |
Polling controls forwarded to |
client |
A |
A vmx_simulation_job.
POST /model-fits/{mf_id}/hypothetical-subject-simulation-jobs.
vmx_sim_hypothetical_subject( fit, dosing_input, subjects, idempotency_key = NULL, retried_from = NULL, min_timepoints = NULL, wait = FALSE, ..., client = vmx_client() )vmx_sim_hypothetical_subject( fit, dosing_input, subjects, idempotency_key = NULL, retried_from = NULL, min_timepoints = NULL, wait = FALSE, ..., client = vmx_client() )
fit |
A fit id or |
dosing_input |
A dosing-input id or |
subjects |
A data.frame/tibble with a |
idempotency_key, retried_from
|
Optional create fields. |
min_timepoints |
Optional minimum number of simulated timepoints. |
wait |
If |
... |
Polling controls forwarded to |
client |
A |
A vmx_simulation_job.
POST /model-fits/{mf_id}/hypothetical-subject-simulation-jobs/from-text.
vmx_sim_hypothetical_subject_from_text( fit, dosing_text, subjects, idempotency_key = NULL, retried_from = NULL, min_timepoints = NULL, wait = FALSE, ..., client = vmx_client() )vmx_sim_hypothetical_subject_from_text( fit, dosing_text, subjects, idempotency_key = NULL, retried_from = NULL, min_timepoints = NULL, wait = FALSE, ..., client = vmx_client() )
fit |
A fit id or |
dosing_text |
The dosing regimen text. |
subjects |
A data.frame/tibble with a |
idempotency_key, retried_from
|
Optional create fields. |
min_timepoints |
Optional minimum number of simulated timepoints. |
wait |
If |
... |
Polling controls forwarded to |
client |
A |
A vmx_simulation_job.
List simulation jobs for a model fit
vmx_sim_jobs(fit, client = vmx_client())vmx_sim_jobs(fit, client = vmx_client())
fit |
A fit id or |
client |
A |
A tibble containing all simulation jobs for the fit.
POST /model-fits/{mf_id}/population-simulation-jobs.
vmx_sim_population( fit, dosing_input, scenario_name, idempotency_key = NULL, retried_from = NULL, min_timepoints = NULL, wait = FALSE, ..., client = vmx_client() )vmx_sim_population( fit, dosing_input, scenario_name, idempotency_key = NULL, retried_from = NULL, min_timepoints = NULL, wait = FALSE, ..., client = vmx_client() )
fit |
A fit id or |
dosing_input |
A dosing-input id or |
scenario_name |
The population scenario name. |
idempotency_key, retried_from
|
Optional create fields. |
min_timepoints |
Optional minimum number of simulated timepoints. |
wait |
If |
... |
Polling controls forwarded to |
client |
A |
A vmx_simulation_job.
POST /model-fits/{mf_id}/population-simulation-jobs/from-text.
vmx_sim_population_from_text( fit, dosing_text, scenario_name, idempotency_key = NULL, retried_from = NULL, min_timepoints = NULL, wait = FALSE, ..., client = vmx_client() )vmx_sim_population_from_text( fit, dosing_text, scenario_name, idempotency_key = NULL, retried_from = NULL, min_timepoints = NULL, wait = FALSE, ..., client = vmx_client() )
fit |
A fit id or |
dosing_text |
The dosing regimen text. |
scenario_name |
The population scenario name. |
idempotency_key, retried_from
|
Optional create fields. |
min_timepoints |
Optional minimum number of simulated timepoints. |
wait |
If |
... |
Polling controls forwarded to |
client |
A |
A vmx_simulation_job.
GET /simulation-jobs/{id}/result. Returns the parsed result payload
containing model-implied response trajectories with the server-provided
point statistic and interval. The nested wire shape is retained verbatim.
vmx_sim_result(job, grouping_variable = NULL, client = vmx_client())vmx_sim_result(job, grouping_variable = NULL, client = vmx_client())
job |
A job id or |
grouping_variable |
Optional server-side grouping. |
client |
A |
A list (the parsed result).
Simulation job status
vmx_sim_status(job, client = vmx_client())vmx_sim_status(job, client = vmx_client())
job |
A job id ( |
client |
A |
A vmx_simulation_job.
List studies for a treatment
vmx_studies( treatment = NULL, status = NULL, client = vmx_client(), created_since = NULL )vmx_studies( treatment = NULL, status = NULL, client = vmx_client(), created_since = NULL )
treatment |
A treatment id ( |
status |
Optional status filter. |
client |
A |
created_since |
Optional lower creation-time bound: a
|
A tibble containing all matching studies.
Fetch one study
vmx_study(id, client = vmx_client())vmx_study(id, client = vmx_client())
id |
A study id ( |
client |
A |
A vmx_study.
Create a study
vmx_study_create( treatment, name, study_type = "clinical", phase = NULL, ..., client = vmx_client() )vmx_study_create( treatment, name, study_type = "clinical", phase = NULL, ..., client = vmx_client() )
treatment |
A treatment id or |
name |
Study name. |
study_type |
Study type; defaults to |
phase |
Optional clinical phase. |
... |
Additional fields ( |
client |
A |
A vmx_study.
Only the fields you pass are changed (the server applies exclude_unset).
vmx_study_update(id, ..., client = vmx_client())vmx_study_update(id, ..., client = vmx_client())
id |
A study id or |
... |
Fields to update. |
client |
A |
A vmx_study.
Subjects table (one row per subject)
vmx_subjects(dv, time_basis = NULL, client = vmx_client())vmx_subjects(dv, time_basis = NULL, client = vmx_client())
dv |
A data-version id or |
time_basis |
Optional time basis; see |
client |
A |
A tibble.
Not yet implemented. The per-subject start[i]/end[i] index ranges and
iObs observation index must be derived and verified against real data
before shipping (this is the error-prone derivation the design flags); see
the package NEWS. When implemented it should reuse the event assembly in
vmx_nlmixr_data() (eligibility admission, basis selection, PK and PD
specimen selection, dose and censoring encoding) and only add the ragged
indexing on top.
vmx_torsten_data(dv, analyte = NULL, client = vmx_client())vmx_torsten_data(dv, analyte = NULL, client = vmx_client())
dv |
A data-version id or |
analyte |
Analyte to assemble. |
client |
A |
Not yet implemented.
Fetch one treatment
vmx_treatment(id, client = vmx_client())vmx_treatment(id, client = vmx_client())
id |
A treatment id ( |
client |
A |
A vmx_treatment.
Create a treatment
vmx_treatment_create( name, indication = NULL, description = NULL, client = vmx_client() )vmx_treatment_create( name, indication = NULL, description = NULL, client = vmx_client() )
name |
Treatment name. |
indication |
Optional indication. |
description |
Optional free-text description. |
client |
A |
A vmx_treatment.
Only the fields you pass are changed (the server applies exclude_unset).
vmx_treatment_update(id, ..., client = vmx_client())vmx_treatment_update(id, ..., client = vmx_client())
id |
A treatment id or |
... |
Fields to update ( |
client |
A |
A vmx_treatment.
List treatments
vmx_treatments(status = NULL, client = vmx_client())vmx_treatments(status = NULL, client = vmx_client())
status |
Optional status filter. |
client |
A |
A tibble containing all matching treatments.
Streamed multipart upload. With wait = TRUE, blocks through the prep
pipeline (see vmx_wait()).
vmx_upload( study, files, mode = c("initial", "incremental", "replacement"), treatment = NULL, config = NULL, wait = FALSE, client = vmx_client(), ... )vmx_upload( study, files, mode = c("initial", "incremental", "replacement"), treatment = NULL, config = NULL, wait = FALSE, client = vmx_client(), ... )
study |
A study id or |
files |
Character vector of local file paths. |
mode |
One of |
treatment |
Optional treatment; inferred from |
config |
Optional gecodata v2 |
wait |
If |
client |
A |
... |
Polling controls forwarded to |
A vmx_dataset (status "uploaded").
POST /datasets/{ds_id}/ignore-upload. Soft-ignores one delivery.
vmx_upload_ignore(dataset, upload, client = vmx_client())vmx_upload_ignore(dataset, upload, client = vmx_client())
dataset |
A dataset id or |
upload |
The upload id ( |
client |
A |
The updated vmx_prep_status.
POST /datasets/{ds_id}/unignore-upload.
vmx_upload_unignore(dataset, upload, client = vmx_client())vmx_upload_unignore(dataset, upload, client = vmx_client())
dataset |
A dataset id or |
upload |
The upload id ( |
client |
A |
The updated vmx_prep_status.
An S3 generic dispatching on the handle type. Each method has a sensible default terminal state. Terminal-but-unsuccessful states raise a classed error so scripts fail loudly rather than hang.
vmx_wait( x, until = NULL, timeout = 900, interval = 5, progress = interactive(), client = vmx_client(), ... )vmx_wait( x, until = NULL, timeout = 900, interval = 5, progress = interactive(), client = vmx_client(), ... )
x |
A pollable handle: a dataset / prep-status or an NCA analysis (more types as the API surface lands: model-build-run, simulation-job). |
until |
Target terminal state(s); a sensible default per type when
|
timeout |
Timeout in seconds. Resource methods use long-running defaults: 70 minutes for prep, NCA, and dosing input; 130 minutes for simulation; and 24 hours 10 minutes for model builds. The NCA/modeling worker defaults include a short persistence cushion beyond their execution ceilings; prep uses a client-side wait policy because its worker has no equivalent hard wall-clock ceiling. |
interval |
Positive poll interval in seconds (exponential backoff up to 30s). |
progress |
Show a progress message each poll; defaults to
|
client |
A |
... |
Passed to methods. |
The updated object, or a vmx_timeout_error.
Calls GET /me.
vmx_whoami(client = vmx_client())vmx_whoami(client = vmx_client())
client |
A |
A vmx_me object: user_id, email, name, workspace_id,
roles, and counts.