Skip to contents

Create a SpatialExperiment object (used in the same manner as SingleCellExperiment) that will store all of the project data.

Usage

create_object(
  x,
  expression_cols = NULL,
  metadata_cols = NULL,
  skip_cols = NULL,
  clean_names = TRUE,
  transformation = NULL,
  out_dir = NULL
)

Arguments

x

A data frame or a path to a file (can be gzipped).

expression_cols

Column names of markers/antibody expression as a vector or a grep pattern. Auto-detected if not specified.

metadata_cols

Column names of cell metadata (not markers/antibodies) as a vector or a grep pattern. Auto-detected if not specified.

skip_cols

Column names to ignore (such as bad antibodies) as a vector or a grep pattern.

clean_names

A logical scalar. Clean the data frame column names to remove problematic characters and make them unique.

transformation

A character string indicating which transformation method should be used. See transform().

out_dir

Name of the output analysis directory. If specified, the object and the corresponding plots will be saved there.

Value

A SpatialExperiment object.

Examples

tonsil_csv <- system.file("extdata", "tonsil-akoya-2018-500.csv", package = "phenomenalist")
tonsil_spe <- create_object(tonsil_csv, skip_cols = "DAPI|Blank", transformation = "z")
#> number of input table rows: 500
#> number of input table columns: 42
#> 
#> skipped columns: cyc001_ch001:DAPI1, cyc001_ch002:Blank, cyc001_ch003:Blank, cyc001_ch004:Blank, cyc002_ch001:DAPI2, cyc003_ch001:DAPI3, cyc004_ch001:DAPI4, cyc005_ch001:DAPI5, cyc006_ch001:DAPI6, cyc007_ch001:DAPI7, cyc008_ch001:DAPI8, cyc008_ch002:Blank, cyc008_ch003:Blank, cyc008_ch004:Blank
#> number of expression columns: 18
#> number of metadata columns: 10
#> 
#> expression columns: Actin, CD11c, CD14, CD15, CD20, CD21, CD3e, CD4, CD44, CD45, CD57, CD68, CD8, IDO1, Ki67, Pancytokeratin, SMA, Vimentin
#> metadata columns: cell_id, reg, tile_num, x, y, z, x_tile, y_tile, size, homogeneity