spatialrefinery.download_xenium_study

spatialrefinery.download_xenium_study#

spatialrefinery.download_xenium_study(source, outdir, *, studies=None, kinds=None, max_workers=8, retries=3, timeout=180, extract=True, overwrite=False, resume=True, dry_run=False)#

Download a Xenium study’s raw asset bundle.

Parameters:
  • source (str | Path | Iterable[str]) – Path to a manifest file of curl -O <url> lines (one per asset, as downloaded from 10x’s dataset pages), or an iterable of URLs.

  • outdir (str | Path) – Base directory; assets land under outdir/<study>/<filename>.

  • studies (list[str] | None (default: None)) – Restrict to these study names. Default: all studies in source.

  • kinds (list[str] | None (default: None)) – Restrict to these asset kinds (e.g. ["outs"]). Default: all kinds.

  • max_workers (int (default: 8)) – Parallel download workers. Default 8.

  • retries (int (default: 3)) – Number of retry attempts per asset on transient failure. Default 3.

  • timeout (int (default: 180)) – Per-request timeout in seconds. Default 180.

  • extract (bool (default: True)) – Whether to unzip .zip assets in place after downloading (*_xe_outs.zip is always skipped). Default True.

  • overwrite (bool (default: False)) – Re-download assets that already exist on disk. Default False.

  • resume (bool (default: True)) – Continue a partially-downloaded asset from its leftover .part file using an HTTP Range request instead of refetching it from the beginning. Default True.

  • dry_run (bool (default: False)) – Resolve and report what would be downloaded without any network activity. Default False.

Return type:

list[DownloadResult]

Returns:

list[DownloadResult] One result per selected asset. Each result’s .status is one of "downloaded", "cached" (already present, overwrite=False), "skipped" (excluded by dry_run), or "failed"; .ok is a bool convenience property, and .error holds the exception message for failed downloads.