| Title: | Access Open 'NeMO Archive' Datasets |
|---|---|
| Description: | Provides helpers for discovering, planning, and downloading open-access datasets from the Neuroscience Multi-Omic Archive ('NeMO'; <https://nemoarchive.org/>). The package builds reproducible file manifests that record search parameters, file metadata, download URLs, checksums, and local file paths. It supports exploratory 'NeMO' metadata queries and provides first-pass bridges from downloaded files into 'SingleCellExperiment' and 'Seurat' workflows. |
| Authors: | Maciej Pietrzak [aut, cre] (ORCID: <https://orcid.org/0000-0001-5768-7884>), AbdElrahman Amer [aut] |
| Maintainer: | Maciej Pietrzak <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.99.3 |
| Built: | 2026-07-07 09:01:11 UTC |
| Source: | https://github.com/cran/nemoR |
Returns values from file.file_access. Use access = "open" in search and
fetch workflows when you want files that can be downloaded without
controlled-access authorization.
nemo_access_types(...)nemo_access_types(...)
... |
Filters passed to |
A tibble of access categories and counts.
# Queries the external NeMO Data Portal; not run during package checks. ## Not run: nemo_access_types(file_format = "h5ad") ## End(Not run)# Queries the external NeMO Data Portal; not run during package checks. ## Not run: nemo_access_types(file_format = "h5ad") ## End(Not run)
Dispatches from manifest file paths to the supported reader for the first
compatible file. H5AD files are preferred over 10x HDF5 files when both are
present. NeMO provenance from the manifest is attached to the returned object
when S4Vectors is available.
nemo_as_sce(manifest, ...)nemo_as_sce(manifest, ...)
manifest |
Manifest with a populated |
... |
Additional reader arguments. |
A SingleCellExperiment object.
# Loading a single-cell dataset requires local downloaded .h5ad or # 10x .h5 files, so this code is not run in examples. ## Not run: downloaded <- nemo_read_manifest("nemo_downloads/nemo_manifest.tsv") sce <- nemo_as_sce(downloaded) ## End(Not run)# Loading a single-cell dataset requires local downloaded .h5ad or # 10x .h5 files, so this code is not run in examples. ## Not run: downloaded <- nemo_read_manifest("nemo_downloads/nemo_manifest.tsv") sce <- nemo_as_sce(downloaded) ## End(Not run)
Thin wrapper around Seurat::as.Seurat() used by nemo_load() when
format = "Seurat". Seurat is optional and must be installed separately.
nemo_as_seurat(object)nemo_as_seurat(object)
object |
SingleCellExperiment object. |
A Seurat object.
# Requires optional Seurat conversion and is not run in examples. ## Not run: if (requireNamespace("SingleCellExperiment", quietly = TRUE) && requireNamespace("Seurat", quietly = TRUE) && requireNamespace("Matrix", quietly = TRUE)) { mat <- Matrix::Matrix(c(1, 0, 2, 0, 3, 0), nrow = 3, sparse = TRUE) rownames(mat) <- paste0("gene", seq_len(nrow(mat))) colnames(mat) <- paste0("cell", seq_len(ncol(mat))) sce <- SingleCellExperiment::SingleCellExperiment( list(counts = mat, logcounts = mat) ) seurat_obj <- nemo_as_seurat(sce) dim(seurat_obj) } ## End(Not run)# Requires optional Seurat conversion and is not run in examples. ## Not run: if (requireNamespace("SingleCellExperiment", quietly = TRUE) && requireNamespace("Seurat", quietly = TRUE) && requireNamespace("Matrix", quietly = TRUE)) { mat <- Matrix::Matrix(c(1, 0, 2, 0, 3, 0), nrow = 3, sparse = TRUE) rownames(mat) <- paste0("gene", seq_len(nrow(mat))) colnames(mat) <- paste0("cell", seq_len(ncol(mat))) sce <- SingleCellExperiment::SingleCellExperiment( list(counts = mat, logcounts = mat) ) seurat_obj <- nemo_as_seurat(sce) dim(seurat_obj) } ## End(Not run)
Returns values from sample.assay, optionally filtered by organism,
technique, modality, file format, or other search arguments.
nemo_assays(...)nemo_assays(...)
... |
Filters passed to |
A tibble of assays and counts.
# Queries the external NeMO Data Portal; not run during package checks. ## Not run: nemo_assays(taxon = "house mouse") ## End(Not run)# Queries the external NeMO Data Portal; not run during package checks. ## Not run: nemo_assays(taxon = "house mouse") ## End(Not run)
Returns values from sample.anatomies, which can be used as the anatomy
or brain_region filter in search and fetch functions.
nemo_brain_regions(...)nemo_brain_regions(...)
... |
Filters passed to |
A tibble of anatomical regions and counts.
# Queries the external NeMO Data Portal; not run during package checks. ## Not run: nemo_brain_regions(taxon = "house mouse") ## End(Not run)# Queries the external NeMO Data Portal; not run during package checks. ## Not run: nemo_brain_regions(taxon = "house mouse") ## End(Not run)
Returns the default directory used by nemo_download() when destdir is not
supplied. The location can be overridden with the NEMOR_CACHE_DIR
environment variable.
nemo_cache_dir()nemo_cache_dir()
Path to the cache directory. The directory is created if needed.
nemo_cache_dir()nemo_cache_dir()
Retrieves one collection record from the NeMO Assets API by collection
identifier. Use nemo_files() to list file records attached to a collection.
nemo_collection(id)nemo_collection(id)
id |
NeMO collection identifier, such as |
Parsed collection metadata from the Assets API.
# Queries the external NeMO Assets API; not run during package checks. ## Not run: nemo_collection("nemo:col-rmf5gdy") ## End(Not run)# Queries the external NeMO Assets API; not run during package checks. ## Not run: nemo_collection("nemo:col-rmf5gdy") ## End(Not run)
The public NeMO Assets API is currently identifier-based. This helper returns documented example public collections that are useful for API tests and demonstrations. It is not intended to be a complete collection catalog.
nemo_collections(...)nemo_collections(...)
... |
Reserved for future use. |
A tibble with name, collection_id, and api_url columns.
nemo_collections()nemo_collections()
Returns values from file.data_type, such as processed counts, parameters,
raw data, or analysis outputs, depending on what NeMO records match the
filters.
nemo_data_types(...)nemo_data_types(...)
... |
Filters passed to |
A tibble of file data types and counts.
# Queries the external NeMO Data Portal; not run during package checks. ## Not run: nemo_data_types(taxon = "house mouse", file_format = "h5ad") ## End(Not run)# Queries the external NeMO Data Portal; not run during package checks. ## Not run: nemo_data_types(taxon = "house mouse", file_format = "h5ad") ## End(Not run)
Downloads each row of a NeMO manifest to a local folder and returns the same
manifest with local_path, download_status, and checksum_verified
updated. Existing files are skipped unless overwrite = TRUE.
NeMO datasets can contain large raw or processed files. Use
nemo_download_plan() and the max_size_gb guard before downloading, and
increase max_size_gb only when the transfer is intentional.
nemo_download( manifest, destdir = nemo_cache_dir(), overwrite = FALSE, max_size_gb = 2, verify_checksum = FALSE, quiet = FALSE )nemo_download( manifest, destdir = nemo_cache_dir(), overwrite = FALSE, max_size_gb = 2, verify_checksum = FALSE, quiet = FALSE )
manifest |
Manifest tibble or data frame produced by
|
destdir |
Destination directory for downloaded files. |
overwrite |
Whether to overwrite existing local files with the same basename. |
max_size_gb |
Maximum total manifest size to download, in gigabytes.
Set to |
verify_checksum |
Whether to verify MD5 checksums after download when checksums are available in the manifest. |
quiet |
Whether to suppress progress messages from |
Updated manifest tibble. download_status is set to values such as
"downloaded", "skipped_existing", "failed", or
"failed_missing_url". checksum_verified is TRUE, FALSE, or NA.
source_file <- tempfile() writeLines("small local file", source_file) manifest <- nemo_manifest_from_urls( paste0("file://", normalizePath(source_file)), collection_id = "local-example" ) manifest$size <- file.info(source_file)$size nemo_download_plan(manifest, max_size_gb = 1) # Downloads write files to disk and may transfer large external data. ## Not run: destdir <- tempfile() dir.create(destdir) downloaded <- nemo_download(manifest, destdir = destdir, quiet = TRUE) downloaded[, c("file_name", "download_status", "local_path")] ## End(Not run)source_file <- tempfile() writeLines("small local file", source_file) manifest <- nemo_manifest_from_urls( paste0("file://", normalizePath(source_file)), collection_id = "local-example" ) manifest$size <- file.info(source_file)$size nemo_download_plan(manifest, max_size_gb = 1) # Downloads write files to disk and may transfer large external data. ## Not run: destdir <- tempfile() dir.create(destdir) downloaded <- nemo_download(manifest, destdir = destdir, quiet = TRUE) downloaded[, c("file_name", "download_status", "local_path")] ## End(Not run)
Use this before downloading to check how many files will be downloaded and how large they are. The summary includes file formats, data types, known total size, whether the size guard would pass, and how many rows have checksums available.
nemo_download_plan(manifest, max_size_gb = 2)nemo_download_plan(manifest, max_size_gb = 2)
manifest |
Manifest tibble or data frame. |
max_size_gb |
Maximum allowed known total size in gigabytes. |
A one-row tibble with columns n_files, total_size_gb,
largest_file_gb, unknown_size_files, within_size_limit,
file_formats, data_types, access, download_statuses, and
files_with_checksum.
manifest <- nemo_manifest_from_urls( "https://example.com?file=sample.h5ad", collection_id = "example" ) manifest$size <- 1024^2 nemo_download_plan(manifest, max_size_gb = 1) nemo_download_plan(manifest, max_size_gb = 0.0001)manifest <- nemo_manifest_from_urls( "https://example.com?file=sample.h5ad", collection_id = "example" ) manifest$size <- 1024^2 nemo_download_plan(manifest, max_size_gb = 1) nemo_download_plan(manifest, max_size_gb = 0.0001)
These identifiers are small, stable examples useful for documentation, smoke tests, and learning the identifier-based Assets API. They are not a complete catalog of NeMO collections; use the portal search functions for broad discovery.
nemo_example_collections()nemo_example_collections()
A named character vector of public collection identifiers from the NeMO Assets API documentation.
nemo_example_collections()nemo_example_collections()
This is the general discovery helper behind convenience functions such as
nemo_species() and nemo_platforms(). It asks the NeMO Data Portal for
aggregation buckets, so it is useful for learning valid filter values before
running nemo_search() or nemo_fetch().
nemo_facet_values( facets, target = c("files", "samples"), organism = NULL, taxon = NULL, species = NULL, technique = NULL, modality = NULL, assay = NULL, brain_region = NULL, anatomy = NULL, specimen_type = NULL, study = NULL, project = NULL, program = NULL, lab = NULL, file_format = NULL, data_type = NULL, access = NULL, filters = NULL, size = 1 )nemo_facet_values( facets, target = c("files", "samples"), organism = NULL, taxon = NULL, species = NULL, technique = NULL, modality = NULL, assay = NULL, brain_region = NULL, anatomy = NULL, specimen_type = NULL, study = NULL, project = NULL, program = NULL, lab = NULL, file_format = NULL, data_type = NULL, access = NULL, filters = NULL, size = 1 )
facets |
Character vector of portal fields, such as |
target |
Portal target to aggregate over: |
organism, taxon, species
|
Optional organism/taxon filter. |
technique |
Optional sample technique/platform filter. |
modality |
Optional sample modality filter. |
assay |
Optional sample assay filter. |
brain_region, anatomy
|
Optional anatomical region filter. |
specimen_type |
Optional specimen type filter. |
study, project
|
Optional study/grant filter. |
program |
Optional program filter. |
lab |
Optional lab filter. |
file_format |
Optional file format filter. |
data_type |
Optional file data type filter. |
access |
Optional file access filter. |
filters |
Optional raw portal filter object. |
size |
Number of records to request with the aggregation query. The
default is |
A tibble with facet, value, and count columns. value is a
usable filter value and count is the number of matching portal records in
the requested target.
# Queries the external NeMO Data Portal; not run during package checks. ## Not run: nemo_facet_values("subject.taxon") nemo_facet_values("file.format", taxon = "house mouse", access = "open") ## End(Not run)# Queries the external NeMO Data Portal; not run during package checks. ## Not run: nemo_facet_values("subject.taxon") nemo_facet_values("file.format", taxon = "house mouse", access = "open") ## End(Not run)
nemo_fetch() is the highest-level data fetching helper. It searches the
NeMO Data Portal, builds a manifest, checks the planned download size, and
downloads files to a selected folder. Use dry_run = TRUE to inspect the
matching files and attached download plan without downloading anything.
Downloading real NeMO files can transfer large external datasets, so examples
that perform downloads are wrapped in \dontrun{}. Inspect a dry run and
adjust max_size_gb before starting a download.
nemo_fetch( destdir, organism = NULL, taxon = NULL, species = NULL, technique = NULL, modality = NULL, assay = NULL, brain_region = NULL, anatomy = NULL, specimen_type = NULL, study = NULL, project = NULL, program = NULL, lab = NULL, file_format = NULL, data_type = NULL, access = "open", file_name = NULL, file_id = NULL, sample_id = NULL, filters = NULL, max_files = 100, max_size_gb = 2, overwrite = FALSE, verify_checksum = FALSE, quiet = FALSE, dry_run = FALSE, save_manifest = TRUE, manifest_name = "nemo_manifest.tsv", ... )nemo_fetch( destdir, organism = NULL, taxon = NULL, species = NULL, technique = NULL, modality = NULL, assay = NULL, brain_region = NULL, anatomy = NULL, specimen_type = NULL, study = NULL, project = NULL, program = NULL, lab = NULL, file_format = NULL, data_type = NULL, access = "open", file_name = NULL, file_id = NULL, sample_id = NULL, filters = NULL, max_files = 100, max_size_gb = 2, overwrite = FALSE, verify_checksum = FALSE, quiet = FALSE, dry_run = FALSE, save_manifest = TRUE, manifest_name = "nemo_manifest.tsv", ... )
destdir |
Folder where files should be downloaded and where
|
organism, taxon, species
|
Optional organism/taxon filter. These are
aliases for the portal field |
technique |
Optional sample technique/platform filter, for example
|
modality |
Optional sample modality filter, for example
|
assay |
Optional sample assay filter. |
brain_region, anatomy
|
Optional anatomical region filter. |
specimen_type |
Optional specimen type filter. |
study, project
|
Optional study/grant filter. |
program |
Optional program filter. |
lab |
Optional lab filter. |
file_format |
Optional file format filter, such as |
data_type |
Optional file data type filter, such as |
access |
File access filter. Defaults to |
file_name |
Optional exact file name filter. |
file_id |
Optional file identifier filter. |
sample_id |
Optional sample identifier filter. |
filters |
Optional raw portal filter object created by
|
max_files |
Maximum number of matching files to fetch. |
max_size_gb |
Maximum total manifest size to download, in gigabytes. |
overwrite |
Whether to overwrite existing local files. |
verify_checksum |
Whether to verify MD5 checksums after download when checksums are available in the manifest. |
quiet |
Whether to suppress progress messages from |
dry_run |
Whether to return the manifest and download plan without downloading files. |
save_manifest |
Whether to write a manifest TSV into |
manifest_name |
File name for the saved manifest. |
... |
Additional query parameters passed to |
A manifest tibble. For downloads, local_path, download_status,
and checksum_verified describe local file state. For dry runs,
download_status is "dry_run" and the planned summary is stored in the
"download_plan" attribute.
# Searches external NeMO services; not run during package checks. ## Not run: preview <- nemo_fetch( destdir = tempdir(), taxon = "house mouse", file_format = "h5ad", access = "open", max_files = 1, dry_run = TRUE ) attr(preview, "download_plan") # Downloads real external data; inspect the dry-run plan first. manifest <- nemo_fetch( destdir = "nemo_downloads", taxon = "house mouse", file_format = "h5ad", access = "open", max_files = 1, max_size_gb = 2 ) ## End(Not run)# Searches external NeMO services; not run during package checks. ## Not run: preview <- nemo_fetch( destdir = tempdir(), taxon = "house mouse", file_format = "h5ad", access = "open", max_files = 1, dry_run = TRUE ) attr(preview, "download_plan") # Downloads real external data; inspect the dry-run plan first. manifest <- nemo_fetch( destdir = "nemo_downloads", taxon = "house mouse", file_format = "h5ad", access = "open", max_files = 1, max_size_gb = 2 ) ## End(Not run)
Retrieves one file record from the NeMO Assets API. The response can include file format, size, checksum, access level, collection membership, and available manifest URLs.
nemo_file(id)nemo_file(id)
id |
NeMO file identifier, such as |
Parsed file metadata from the Assets API.
# Queries the external NeMO Assets API; not run during package checks. ## Not run: nemo_file("nemo:fil-328dskg") ## End(Not run)# Queries the external NeMO Assets API; not run during package checks. ## Not run: nemo_file("nemo:fil-328dskg") ## End(Not run)
Returns values from file.format, such as "h5ad", "h5", "fastq",
"bam", "json", "csv", or "mtx", depending on the current filters.
nemo_file_formats(...)nemo_file_formats(...)
... |
Filters passed to |
A tibble of file formats and counts.
# Queries the external NeMO Data Portal; not run during package checks. ## Not run: nemo_file_formats(taxon = "house mouse", access = "open") ## End(Not run)# Queries the external NeMO Data Portal; not run during package checks. ## Not run: nemo_file_formats(taxon = "house mouse", access = "open") ## End(Not run)
Uses the NeMO Assets API to list file records for a known collection ID. For
broad discovery by species, assay, file type, or access level, use
nemo_search(target = "files") or nemo_search_manifest().
nemo_files(collection_id, page = 1, page_size = 100, ...)nemo_files(collection_id, page = 1, page_size = 100, ...)
collection_id |
NeMO collection identifier. |
page |
Results page to retrieve from the Assets API. |
page_size |
Number of file records per page. |
... |
Additional API query parameters passed to the Assets API. |
A tibble of file metadata returned by the Assets API.
# Queries the external NeMO Assets API; not run during package checks. ## Not run: nemo_files("nemo:col-rmf5gdy", page_size = 2) ## End(Not run)# Queries the external NeMO Assets API; not run during package checks. ## Not run: nemo_files("nemo:col-rmf5gdy", page_size = 2) ## End(Not run)
Returns values from study.labs, optionally narrowed by species, technique,
modality, file format, or other filters.
nemo_labs(...)nemo_labs(...)
... |
Filters passed to |
A tibble of labs and counts.
# Queries the external NeMO Data Portal; not run during package checks. ## Not run: nemo_labs(taxon = "house mouse") ## End(Not run)# Queries the external NeMO Data Portal; not run during package checks. ## Not run: nemo_labs(taxon = "house mouse") ## End(Not run)
Uses the local file paths recorded in a NeMO manifest to create a
SingleCellExperiment or Seurat object. This function assumes the files have
already been downloaded and currently supports the first compatible .h5ad
or 10x .h5 file in the manifest.
nemo_load(manifest, format = c("SingleCellExperiment", "Seurat"), ...)nemo_load(manifest, format = c("SingleCellExperiment", "Seurat"), ...)
manifest |
Manifest returned by |
format |
Output format: |
... |
Additional arguments passed to readers or converters. |
A SingleCellExperiment object by default, or a Seurat object when
format = "Seurat".
# Loading a single-cell dataset requires local downloaded .h5ad or # 10x .h5 files, so this code is not run in examples. ## Not run: downloaded <- nemo_read_manifest("nemo_downloads/nemo_manifest.tsv") sce <- nemo_load(downloaded) ## End(Not run)# Loading a single-cell dataset requires local downloaded .h5ad or # 10x .h5 files, so this code is not run in examples. ## Not run: downloaded <- nemo_read_manifest("nemo_downloads/nemo_manifest.tsv") sce <- nemo_load(downloaded) ## End(Not run)
Builds a manifest from a known NeMO collection and its Assets API file records. A manifest is the package's reproducibility table: it records file identifiers, names, formats, sizes, checksums, download URLs, local paths, query provenance, and download status.
nemo_manifest( collection_id, files = NULL, pattern = NULL, file_format = NULL, data_type = NULL, max_files = NULL )nemo_manifest( collection_id, files = NULL, pattern = NULL, file_format = NULL, data_type = NULL, max_files = NULL )
collection_id |
NeMO collection identifier. |
files |
Optional precomputed file table, usually from |
pattern |
Optional regular expression used to filter file names and download URLs. |
file_format |
Optional file format filter, such as |
data_type |
Optional file data type filter, such as |
max_files |
Optional maximum number of files to keep after filtering. |
A manifest tibble suitable for nemo_download() and
nemo_write_manifest().
files <- data.frame( file_id = "file-1", file_name = "sample.h5ad", file_format = "h5ad", data_type = "counts", size = 1024, md5 = "abc", download_url = "https://example.com?file=sample.h5ad" ) nemo_manifest("example-collection", files = files)files <- data.frame( file_id = "file-1", file_name = "sample.h5ad", file_format = "h5ad", data_type = "counts", size = 1024, md5 = "abc", download_url = "https://example.com?file=sample.h5ad" ) nemo_manifest("example-collection", files = files)
Use this for public files discovered through the NeMO HTTP browser, such as
processed .h5ad files, when an Assets API collection is not yet known.
nemo_manifest_from_urls(urls, collection_id = "direct-url", file_id = NULL)nemo_manifest_from_urls(urls, collection_id = "direct-url", file_id = NULL)
urls |
Character vector of HTTP or HTTPS URLs to downloadable files. |
collection_id |
Optional collection, dataset, or analysis label stored
in the manifest |
file_id |
Optional file identifiers. Defaults to generated URL-derived
IDs of the form |
A manifest tibble with one row per URL.
manifest <- nemo_manifest_from_urls( "https://example.com?file=sample.h5ad", collection_id = "example" ) manifestmanifest <- nemo_manifest_from_urls( "https://example.com?file=sample.h5ad", collection_id = "example" ) manifest
Returns values from sample.modality, such as transcriptomic or epigenomic
measurement categories, optionally filtered by organism, technique, file
type, or other search arguments.
nemo_modalities(...)nemo_modalities(...)
... |
Filters passed to |
A tibble of modalities and counts.
# Queries the external NeMO Data Portal; not run during package checks. ## Not run: nemo_modalities(taxon = "house mouse", access = "open") ## End(Not run)# Queries the external NeMO Data Portal; not run during package checks. ## Not run: nemo_modalities(taxon = "house mouse", access = "open") ## End(Not run)
In NeMO portal metadata, platform-like values are represented by
sample.technique, for example "10x chromium 3' v2 sequencing".
nemo_platforms(...)nemo_platforms(...)
... |
Filters passed to |
A tibble of techniques/platforms and counts.
# Queries the external NeMO Data Portal; not run during package checks. ## Not run: nemo_platforms(taxon = "house mouse") ## End(Not run)# Queries the external NeMO Data Portal; not run during package checks. ## Not run: nemo_platforms(taxon = "house mouse") ## End(Not run)
Retrieves one project record from the NeMO Assets API by project identifier. This is a low-level wrapper for users who already know the NeMO project ID.
nemo_project(id)nemo_project(id)
id |
NeMO project identifier. |
Parsed project metadata from the Assets API.
# Queries the external NeMO Assets API; not run during package checks. ## Not run: nemo_project("nemo:proj-example") ## End(Not run)# Queries the external NeMO Assets API; not run during package checks. ## Not run: nemo_project("nemo:proj-example") ## End(Not run)
Reads a 10x-style .h5 count file and returns the object produced by
DropletUtils::read10xCounts(). This is intended for processed count
matrices rather than raw sequencing reads.
nemo_read_10x_h5(path, ...)nemo_read_10x_h5(path, ...)
path |
Path to a 10x |
... |
Additional arguments passed to |
A SingleCellExperiment object.
# Requires a local 10x HDF5 single-cell file; not run in examples. ## Not run: sce <- nemo_read_10x_h5("nemo_downloads/sample_10x.h5") ## End(Not run)# Requires a local 10x HDF5 single-cell file; not run in examples. ## Not run: sce <- nemo_read_10x_h5("nemo_downloads/sample_10x.h5") ## End(Not run)
Reads an .h5ad file downloaded from NeMO or supplied manually and returns
the object produced by zellkonverter::readH5AD(). This function does not
search or download data; use nemo_fetch() or nemo_download() first.
nemo_read_h5ad(path, ...)nemo_read_h5ad(path, ...)
path |
Path to an |
... |
Additional arguments passed to |
A SingleCellExperiment object.
# Requires a local H5AD file, typically after running nemo_download(). ## Not run: sce <- nemo_read_h5ad("nemo_downloads/sample.h5ad") ## End(Not run)# Requires a local H5AD file, typically after running nemo_download(). ## Not run: sce <- nemo_read_h5ad("nemo_downloads/sample.h5ad") ## End(Not run)
Reads a manifest previously written by nemo_write_manifest().
nemo_read_manifest(path)nemo_read_manifest(path)
path |
Manifest |
Manifest tibble.
manifest <- nemo_manifest_from_urls("https://example.com?file=sample.h5ad") path <- tempfile(fileext = ".tsv") nemo_write_manifest(manifest, path) nemo_read_manifest(path)manifest <- nemo_manifest_from_urls("https://example.com?file=sample.h5ad") path <- tempfile(fileext = ".tsv") nemo_write_manifest(manifest, path) nemo_read_manifest(path)
Finds matrix.mtx or matrix.mtx.gz in a directory and reads it with
Matrix::readMM(). This first-pass reader currently returns only the sparse
matrix; barcode and feature annotation files are not yet attached.
nemo_read_mtx(path)nemo_read_mtx(path)
path |
Directory containing |
A sparse matrix read from the Matrix Market file.
if (requireNamespace("Matrix", quietly = TRUE)) { dir <- tempfile() dir.create(dir) mat <- Matrix::Matrix(c(1, 0, 2, 0), nrow = 2, sparse = TRUE) Matrix::writeMM(mat, file.path(dir, "matrix.mtx")) nemo_read_mtx(dir) }if (requireNamespace("Matrix", quietly = TRUE)) { dir <- tempfile() dir.create(dir) mat <- Matrix::Matrix(c(1, 0, 2, 0), nrow = 2, sparse = TRUE) Matrix::writeMM(mat, file.path(dir, "matrix.mtx")) nemo_read_mtx(dir) }
This function uses the NeMO Data Portal API for faceted metadata discovery.
Use target = "files" to find downloadable files, target = "samples" to
find biospecimen/library records, and target = "projects" to summarize
studies/grants. Routine users can use biological argument names such as
taxon, technique, and brain_region rather than internal portal field
names.
nemo_search( organism = NULL, taxon = NULL, species = NULL, technique = NULL, modality = NULL, assay = NULL, brain_region = NULL, anatomy = NULL, specimen_type = NULL, study = NULL, project = NULL, program = NULL, lab = NULL, file_format = NULL, data_type = NULL, access = NULL, file_name = NULL, file_id = NULL, sample_id = NULL, target = c("files", "samples", "projects"), fields = NULL, facets = NULL, filters = NULL, size = 100, from = 0, sort = NULL, ... )nemo_search( organism = NULL, taxon = NULL, species = NULL, technique = NULL, modality = NULL, assay = NULL, brain_region = NULL, anatomy = NULL, specimen_type = NULL, study = NULL, project = NULL, program = NULL, lab = NULL, file_format = NULL, data_type = NULL, access = NULL, file_name = NULL, file_id = NULL, sample_id = NULL, target = c("files", "samples", "projects"), fields = NULL, facets = NULL, filters = NULL, size = 100, from = 0, sort = NULL, ... )
organism, taxon, species
|
Optional organism/taxon filter. These are
aliases for |
technique |
Optional sample technique filter, for example
|
modality |
Optional sample modality filter, for example
|
assay |
Optional sample assay filter. |
brain_region, anatomy
|
Optional sample anatomical region filter. |
specimen_type |
Optional sample specimen type filter. |
study, project
|
Optional study/grant name filter. |
program |
Optional study program filter. |
lab |
Optional study lab filter. |
file_format |
Optional file format filter, for example |
data_type |
Optional file data type filter, for example |
access |
Optional file access filter, for example |
file_name |
Optional exact file name filter. |
file_id |
Optional file identifier filter. |
sample_id |
Optional sample identifier filter. |
target |
Search endpoint: |
fields |
Character vector of fields to return. If |
facets |
Optional character vector of fields to aggregate. |
filters |
Optional raw portal filter object. If supplied, it is combined with filters generated from the arguments. |
size |
Number of records to return. Pagination metadata is stored in the
|
from |
Zero-based result offset. |
sort |
Sort string, such as |
... |
Additional query parameters passed to the portal API. |
A tibble of matching portal records. Column names are portal field
names such as file.file_id, file.name, or subject.taxon.
Pagination metadata is stored in the "pagination" attribute and
aggregation metadata in the "aggregations" attribute when requested.
# Queries the external NeMO Data Portal; not run during package checks. ## Not run: results <- nemo_search( taxon = "house mouse", file_format = "h5ad", access = "open", target = "files", size = 1 ) results attr(results, "pagination") ## End(Not run)# Queries the external NeMO Data Portal; not run during package checks. ## Not run: results <- nemo_search( taxon = "house mouse", file_format = "h5ad", access = "open", target = "files", size = 1 ) results attr(results, "pagination") ## End(Not run)
Retrieves field metadata from the NeMO portal mapping endpoint. This is most
useful when constructing advanced fields, facets, or raw filters
arguments.
nemo_search_fields(target = NULL)nemo_search_fields(target = NULL)
target |
Optional field group: |
A tibble of portal fields and metadata returned by the mapping endpoint.
# Queries the external NeMO Data Portal; not run during package checks. ## Not run: nemo_search_fields("files") ## End(Not run)# Queries the external NeMO Data Portal; not run during package checks. ## Not run: nemo_search_fields("files") ## End(Not run)
This function connects discovery to download. It searches the NeMO Data Portal
for file records, enriches those file IDs through the NeMO Assets API, and
returns a manifest that can be passed to nemo_download(). It is usually the
best entry point when you want a reproducible list of open NeMO files before
downloading them.
nemo_search_manifest( organism = NULL, taxon = NULL, species = NULL, technique = NULL, modality = NULL, assay = NULL, brain_region = NULL, anatomy = NULL, specimen_type = NULL, study = NULL, project = NULL, program = NULL, lab = NULL, file_format = NULL, data_type = NULL, access = "open", file_name = NULL, file_id = NULL, sample_id = NULL, filters = NULL, max_files = 100, enrich = TRUE, require_download_url = TRUE, sort = "file.file_id:asc", ... )nemo_search_manifest( organism = NULL, taxon = NULL, species = NULL, technique = NULL, modality = NULL, assay = NULL, brain_region = NULL, anatomy = NULL, specimen_type = NULL, study = NULL, project = NULL, program = NULL, lab = NULL, file_format = NULL, data_type = NULL, access = "open", file_name = NULL, file_id = NULL, sample_id = NULL, filters = NULL, max_files = 100, enrich = TRUE, require_download_url = TRUE, sort = "file.file_id:asc", ... )
organism, taxon, species
|
Optional organism/taxon filter. These are
aliases for |
technique |
Optional sample technique/platform filter. |
modality |
Optional sample modality filter. |
assay |
Optional sample assay filter. |
brain_region, anatomy
|
Optional anatomical region filter. |
specimen_type |
Optional specimen type filter. |
study, project
|
Optional study/grant filter. |
program |
Optional program filter. |
lab |
Optional lab filter. |
file_format |
Optional file format filter, such as |
data_type |
Optional file data type filter, such as |
access |
File access filter. Defaults to |
file_name |
Optional exact file name filter. |
file_id |
Optional file identifier filter. |
sample_id |
Optional sample identifier filter. |
filters |
Optional raw portal filter object created by
|
max_files |
Maximum number of portal file records to include. |
enrich |
Whether to query the Assets API for download URLs, checksums, and collection IDs. |
require_download_url |
Whether to keep only records with HTTP download URLs after enrichment. |
sort |
Portal sort string. |
... |
Additional query parameters passed to |
A tibble manifest suitable for nemo_download(). The manifest
includes search metadata such as taxon, technique, study,
query_parameters, retrieved_at, and download fields such as
download_url, download_status, and checksum_verified.
# Queries external NeMO services; not run during package checks. ## Not run: manifest <- nemo_search_manifest( taxon = "house mouse", file_format = "h5ad", access = "open", max_files = 1 ) manifest ## End(Not run)# Queries external NeMO services; not run during package checks. ## Not run: manifest <- nemo_search_manifest( taxon = "house mouse", file_format = "h5ad", access = "open", max_files = 1 ) manifest ## End(Not run)
Returns values from the portal field subject.taxon, such as "house mouse"
or "human", optionally after applying filters passed through ....
nemo_species(...)nemo_species(...)
... |
Filters passed to |
A tibble of species/taxa and counts.
# Queries the external NeMO Data Portal; not run during package checks. ## Not run: nemo_species() nemo_species(file_format = "h5ad", access = "open") ## End(Not run)# Queries the external NeMO Data Portal; not run during package checks. ## Not run: nemo_species() nemo_species(file_format = "h5ad", access = "open") ## End(Not run)
Returns values from study.study_name, optionally narrowed by species,
technique, modality, file format, or other filters.
nemo_studies(...)nemo_studies(...)
... |
Filters passed to |
A tibble of study names and counts.
# Queries the external NeMO Data Portal; not run during package checks. ## Not run: nemo_studies(taxon = "house mouse") ## End(Not run)# Queries the external NeMO Data Portal; not run during package checks. ## Not run: nemo_studies(taxon = "house mouse") ## End(Not run)
Alias for nemo_species().
nemo_taxa(...)nemo_taxa(...)
... |
Filters passed to |
A tibble of taxa and counts.
# Queries the external NeMO Data Portal; not run during package checks. ## Not run: nemo_taxa() ## End(Not run)# Queries the external NeMO Data Portal; not run during package checks. ## Not run: nemo_taxa() ## End(Not run)
Alias for nemo_platforms().
nemo_techniques(...)nemo_techniques(...)
... |
Filters passed to |
A tibble of techniques and counts.
# Queries the external NeMO Data Portal; not run during package checks. ## Not run: nemo_techniques(taxon = "house mouse") ## End(Not run)# Queries the external NeMO Data Portal; not run during package checks. ## Not run: nemo_techniques(taxon = "house mouse") ## End(Not run)
Checks that a table has the minimum columns needed by the download and load workflow. This validates structure only; it does not check that URLs are reachable or local files exist.
nemo_validate_manifest(manifest)nemo_validate_manifest(manifest)
manifest |
Manifest tibble or data frame. |
Invisibly returns manifest.
manifest <- nemo_manifest_from_urls("https://example.com?file=sample.h5ad") nemo_validate_manifest(manifest)manifest <- nemo_manifest_from_urls("https://example.com?file=sample.h5ad") nemo_validate_manifest(manifest)
Writes a manifest to a tab-separated file for reproducibility. Saved
manifests can be restored with nemo_read_manifest() and passed back to
nemo_download() or loading helpers.
nemo_write_manifest(manifest, path)nemo_write_manifest(manifest, path)
manifest |
Manifest tibble or data frame. |
path |
Output |
Invisibly returns path.
manifest <- nemo_manifest_from_urls("https://example.com?file=sample.h5ad") path <- tempfile(fileext = ".tsv") nemo_write_manifest(manifest, path)manifest <- nemo_manifest_from_urls("https://example.com?file=sample.h5ad") path <- tempfile(fileext = ".tsv") nemo_write_manifest(manifest, path)