Skip to contents

Returns a SpatialMap object with projectMetadata added to cellMetadata

Usage

mergeProjectMetadata(
  object,
  update_already_merged_columns = F,
  overwrite = F,
  analyze = "regions"
)

Arguments

object

A SpatialMap object

update_already_merged_columns

Whether to update any columns from projectMetadata that already exist in cellMetadata when merging. When FALSE (default), only merges columns that haven't been included yet. Useful to set to TRUE when values in projectMetadata have been updated since mergeProjectMetadata() was previously run. In this case, it is also recommended to set overwrite = TRUE. See Details section for further information on how this parameter is used.

overwrite

Whether to overwrite existing columns in case of a column name match

analyze

What to analyze (and how). The options are "regions", NULL (activeAnalysis), the name of a currently existing formal analysis, or the name of a column in object's projectMetadata (an "informal" analysis).

Details

Convenience function to explicitly add projectMetadata to cellMetadata for all Regions in a SpatialMap object. Works through .smapply and by default does this for all Regions.

Together, the arguments update_already_merged_columns and overwrite control this function's merging behavior. When these arguments are set to their default values (FALSE), mergeProjectMetadata first de-deduplicates and ignores any column names that match between projectMetadata and cellMetadata (most likely columns that were previously merged with this function). The remaining non-matching columns are then added to cellMetadata via addCellMetadata().

While this behavior prevents unintended duplication of columns from projectMetadata, it may prevent carrying through intentional updates in projectMetadata to cellMetadata, even when overwrite = TRUE.

If you would like to use mergeProjectMetadata to update any projectMetadata that was previously merged into cellMetadata (e.g., via updateProjectMetadata()), we recommend setting both of these arguments to TRUE to ensure that updates are properly reflected in the cellMetadata slot.

Scroll to top