Skip to contents

This function helps Enable Medicine analysts and users get data from our ATLAS and bring it into the SpatialMap class.

Usage

spatialmap_from_db(
  connection = con,
  study_ids = NULL,
  study_names = NULL,
  acquisition_ids = NULL,
  expression.version = NULL,
  segmentation.version = NULL,
  explorer.version = NULL,
  annotation_ids = NULL,
  annotation_types = "all",
  vector_val_defaults = c(cell_quality_classification = "pass"),
  schema = "CORE_DATA",
  ds = -1,
  projectName = NULL,
  projectSummary = NULL,
  activeRegions = NULL,
  settings = NULL,
  sample_names = NULL,
  markers = NULL,
  neutral.markers = c("DAPI", "Blank", "Empty"),
  expand_metadata = T,
  show.progress = T
)

Arguments

connection

The database connection object

study_ids

Study IDs. Passed to emconnect::translate_inputs to determine regions and studies to pull.

study_names

The names of the studies you want to pull. Passed to emconnect::translate_inputs to determine regions and studies to pull.

acquisition_ids

Acquisition IDs. Passed to emconnect::translate_inputs to determine regions and studies to pull.

expression.version

The Portal expression version to pull. Optional. See Note below for more details.

segmentation.version

The Portal segmentation version to pull. Optional. See Note below for more details.

explorer.version

The Portal Explorer version to pull. Used for determining the segmentation.version and expression.version to pull--the versions associated with the indicated explorer will be used. Optional. See Note below for more details.

annotation_ids

Numeric vector used to specify which annotation_ids to get from ATLAS. By default (NULL), gets all appropriate annotation_ids. Passed through to emconnect::get_cell_annotations

annotation_types

Which type of annotations to pull. By default, all are included. More info on this argument is available at emconnect::get_cell_annotations. To skip pulling annotations, pass "none".

vector_val_defaults

The "default" value for any vector annotations that are pulled. More info on this argument is available at emconnect::get_cell_annotations

schema

The database schema name

ds

A date-stamp of today plus ds (an integer) is used to filter Snowflake queries.

projectName

Project name

projectSummary

A brief text summary of the project

activeRegions

The active Regions for this SpatialMap

settings

The list of settings

sample_names

Same as acquisition ids

markers

Which specific biomarkers to pull expression data for. By default (NULL), all will be included.

neutral.markers

These are the names of the markers that are distinct because they measure background or baseline signals. For example, DAPI, Blank, or Empty. These will be piped to bgData and excluded from main expression Data.

expand_metadata

A logical indicating whether sample-level metadata will be expanded to the cell level metadata as well. For example, the value for coverslip_label for Region_A will be copied to every cell in Region_A. This takes up more memory, but is more intuitive for most users.

show.progress

Whether to show a progress bar.

Value

A SpatialMap object

Details

See vignette("AnalysisGuide1_Loading_sm_object_from_ATLAS") for a representative workflow that uses this function.

Note

explorer.version, expression.version, and segmentation.version are all passed to emconnect::determine_data_versions for processing. By default, if all versions are NULL, then the highest expression.version and its associated segmentation.version are used. If multiple versions are given, then explorer > expression > segmentation is used to determine versions that are mutually compatible.

If different versions are needed from different regions, you should specify acquisition_ids and pass the versions as a named vector to explicitly map regions to versions (e.g. c("acqid1" = 2, "acqid2" = 4)).

Scroll to top