Skip to main content
The R SDK (strandai) provides idiomatic R functions for owned and public samples, prediction jobs, and result downloads. Functions use the strand_* prefix. Prediction results can be returned as a SpatialExperiment for downstream Bioconductor pipelines.

Install

Install the released package from r-universe:
For the recommended SpatialExperiment result, install:

Configuration

Full pipeline

One blocking call runs upload, submit, wait, and download:
strand_run() returns a strand_predict_result list with job_id, status, credits_used, marker_outputs (one path per marker under output_dir), output_dir, and job (the underlying strand_job handle). A predict.strand_client S3 method dispatches to the same pipeline:
Pass on_progress = function(stage, fraction) ... to follow the four stages ("upload", "submit", "wait", "download").

Samples

strand_samples_list() exposes one cursor-paginated collection with three exact, case-sensitive scopes:
Every list item has ownership and canonical id. Owned and public fields remain distinct: Pass either branch’s id to strand_samples_get():
Owned detail contains up to the 50 newest inference jobs plus the uncapped job_count. Public detail contains geometry, live markers, and public asset URLs; jobs and job_count are absent. Update owned sample attributes with one patch. NULL omits a field, clear_name = TRUE restores the filename as the display name, and character(0) clears user-editable tags:

Cell segmentation

Segmentation belongs to the sample rather than to a prediction job, and it costs no credits. Uploads segment automatically unless the organization or the upload opts out; start or retry it explicitly with strand_segmentation_start():
The call is idempotent: completed or active work is returned unchanged, a failed layer is retried after the server’s 60-second cooldown, and public samples are read-only. The manifest describes the uint32 label-mask OME-Zarr, the per-cell geometry and morphology table, and per-marker expression tables. The tables join each other on instance_id, and each row ties back to the mask through local_label. The SpatialExperiment from strand_download_results() is a pixel-grid matrix of marker predictions, not per-cell expression.

End-to-end

To cancel an in-flight job and refund its reserved credits:

Selecting a model

strand_predict() and strand_run() accept an optional model =:
  • "v0.7": current dispatchable version and default.
Omit model (or pass NULL) to let the platform pick "v0.7". The older "v0.4" and "v0.5" labels can appear on historical jobs but are sunset for new submissions.
strand_predict_result$model (and the model field on strand_job_get() output) contain the canonical v0.X label the platform ran. Jobs from before the versioning rollout may surface as "v0.1", a sunset legacy label: readable on historical jobs, not dispatchable. The retired 2026 "v10*" ids were removed entirely and are rejected with a 400.

Submit without waiting

A full pipeline run blocks for 15+ minutes. To submit without waiting for results, pass wait = FALSE. strand_run() returns the strand_job handle as soon as upload and submission complete:
When wait = FALSE, the "wait" and "download" progress stages don’t fire, and timeout_sec / poll_interval_sec / output_dir are ignored.

Function reference

Error handling

Documented HTTP error codes map to typed conditions you can dispatch on:

See also