spatialrefinery.download_visium_study#
- spatialrefinery.download_visium_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 Visium / CytAssist study’s raw asset bundle.
- Parameters:
source (
str|Path|Iterable[str]) – Path to a manifest file ofcurl -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 underoutdir/<study>/<filename>, withspatial/,analysis/anddeconvolution/unpacked beside them.studies (
list[str] |None(default:None)) – Restrict to these study names. Default: all studies insource.kinds (
list[str] |None(default:None)) – Restrict to these asset kinds (e.g.["spatial", "filtered_matrix"]). 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 unpack.tar.gzassets in place after downloading. The two*_feature_bc_matrix.tar.gzarchives are always skipped, being MTX copies of the.h5files. 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.partfile using an HTTPRangerequest 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. Bundle verification is skipped, there being nothing on disk to verify. Default False.
- Return type:
list[DownloadResult]- Returns:
list[DownloadResult] One result per selected asset. Each result’s
.statusis one of"downloaded","cached"(already present,overwrite=False),"skipped"(excluded bydry_run), or"failed";.okis a bool convenience property, and.errorholds the exception message for failed downloads. An asset whose bytes arrived but whose required archive would not unpack is"failed"with.pathstill set.