strandai) provides the same surface as the Python SDK with
idiomatic R conventions: all functions are prefixed strand_* and results
can be returned as a SpatialExperiment
for downstream Bioconductor pipelines.
The package
strandai avoids a CRAN clash with the
unrelated strand package.Install
SpatialExperiment (recommended) you’ll also need:
Configuration
| Source | Argument / variable | Default |
|---|---|---|
| Arg | strand_client(api_key = ...) | reads env |
| Env | STRAND_API_KEY | required |
| Env | STRAND_BASE_URL | https://app.strandai.com |
End-to-end
Selecting a model
strand_predict() and strand_run() accept an optional model =. Live
Lattice versions:
"v0.4": 192-marker panel, original training."v0.5": 192-marker panel, retrained (current default).
model (or pass NULL) to let the platform pick the current default
("v0.5").
"v10", "v10-fullpanel", and "v10-fullpanel-v2" names are
still accepted as deprecated aliases with a warning(); pin the canonical
v0.X id to silence the warning and forward-protect against the 2026-12-01
alias sunset. The "v10" alias resolved to the now-sunset v0.3 and is
rejected by the server with 400 unknown_model.
Submit without waiting
A full pipeline run blocks for 15+ minutes. To kick a job off and continue with other work, passwait = FALSE, and strand_run() returns the
strand_job handle as soon as upload + submit complete:
wait = FALSE, the "wait" and "download" progress stages don’t
fire, and timeout_sec / poll_interval_sec / output_dir are ignored.
Function reference
| Function | What it does |
|---|---|
strand_client(api_key, base_url) | Construct a client handle. |
strand_upload_file(client, path, progress) | Resumable chunked upload of a WSI to GCS. |
strand_estimate(client, upload_id, markers) | Compute credit cost without reserving. |
strand_predict(client, upload_id, markers, model) | Submit a prediction; reserves credits. |
strand_run(client, image_path, markers, model, wait, ...) | Full pipeline; wait = FALSE returns a strand_job after submit. |
strand_job_get(client, job_id) | Refetch a job snapshot. |
strand_job_wait(job, progress, timeout) | Block until terminal status. |
strand_download_results(job) | Return results as SpatialExperiment. |
Error handling
Documented HTTP error codes map to typed conditions you can dispatch on:| HTTP | Condition class |
|---|---|
| 400 | strand_bad_request_error |
| 401 | strand_auth_error |
| 402 | strand_insufficient_credits_error (carries required) |
| 404 | strand_not_found_error |
| 429 | strand_rate_limit_error (carries retry_after) |
See also
- Quickstart: five-minute walkthrough.
- REST API overview: the underlying HTTP surface.
- Pricing: how credits map to slides × markers.