Skip to contents

Uses emconnect upload_cell_annotations to upload metadata column(s) to the Enable Portal. At a minimum, requires an initialized Portal connection, but if you don't know the segmentation version or study id (and it's not in the projectMetadata of your object), it will also need an initialized DB connection.

Usage

uploadCellMetadata(
  object,
  metadata_names,
  uploaded_name = NULL,
  data_type = c("categorical", "numerical", "vector"),
  cell_id_column = "cell_id",
  quietly = FALSE,
  study_id = NULL,
  segmentation_versions = NULL,
  biomarker_expression_versions = NULL,
  annotation_id = NULL,
  annotation_description = NULL,
  annotation_type = "cell_type_classification",
  cell_type_annotation_id = NULL,
  quality_filter_id = NULL,
  connection = con,
  schema = "CORE_DATA",
  tmp_dir = "~/tmp_anno/",
  create_explorer_output = TRUE,
  dry_run = FALSE,
  ...
)

Arguments

object

A SpatialMap object

metadata_names

The name of the metadata column to be uploaded

uploaded_name

Optional - An alternate name for the metadata column to be displayed on the Portal

data_type

This can be "categorical", "numerical", or "vector".

cell_id_column

The name of the metadata column that corresponds to Enable Medicine Portal cell ids, likely cell_id

quietly

Whether to print output or not

study_id

The study ID in Enable DB

segmentation_versions

A list of segmentation versions, one per Region (Enable database parameter)

biomarker_expression_versions

Biomarker expression versions, one per Region (Enable database parameter)

annotation_id

Optional id corresponding to annotation_id of cell_annotation_details object if one already exists to associate with

annotation_description

Optional description of the annotation

annotation_type

Can be "cell_type_classification" or "cell_neighborhood_classification" or "cell_quality_classification"

cell_type_annotation_id

Only to be used when annotation_type = "cell_neighborhood_classification". The annotation_id for the cell type feature used to generate cell neighborhoods. See @details for more.

quality_filter_id

Optional. The annotation_id for the QC result filter associated with the annotation. See @details for more.

connection

An Enable DB connection from emconnect. No longer required when using SDA.

schema

The Enable DB Schema name from emconnect. No longer required when using SDA.

tmp_dir

The temporary directory that annotations will be written to prior to upload. Most users won't need this.

create_explorer_output

Whether to create an explorer or not

dry_run

Whether this should be a dry run (files are prepared but not uploaded with emconnect::upload_cell_annotations; useful for debugging)

...

Arguments reserved for additional emconnect upload functionality

Details

cell_type_annotation_id is printed upon successful upload of "cell_type_classification" data, or can be found using emconnect::list_cell_annotations. It's also available in the Analysis Version Metadata table on the Portal.

See vignette("Tutorial_Annotations_to_Portal") or the analysis guide vignettes for example workflows that make use of this function.

See also

Scroll to top