Giotto import functionalities for Visium HD datasets. This function generates a `VisiumHDReader` instance that has convenient reader functions for converting individual pieces of Visium HD data into Giotto-compatible representations when the param `visiumHD_dir` is provided. A function that creates the full `giotto` object is also available. These functions should have all param values provided as defaults, but can be flexibly modified to do things such as look in alternative directories or paths.

importVisiumHD(
  visiumHD_dir = NULL,
  expression_source = "raw",
  gene_column_index = 2,
  barcodes = NULL,
  array_subset_row = NULL,
  array_subset_col = NULL,
  pxl_subset_row = NULL,
  pxl_subset_col = NULL,
  shape = "hexagon",
  shape_size = 400
)

Arguments

visiumHD_dir

Visium HD output directory (e.g. square_016um)

expression_source

character. Raw or filter expression data. Defaults to "raw"

gene_column_index

numeric. Expression column to use for gene names 1 = Ensembl and 2 = gene symbols

barcodes

character vector. (optional) Use if you only want to load a subset of the pixel barcodes

array_subset_row

numeric vector. (optional) Vector with min and max values to subset based on array rows

array_subset_col

numeric vector. (optional) Vector with min and max values to subset based on array columns

pxl_subset_row

numeric vector. (optional) Vector with min and max values to subset based on row pixels

pxl_subset_col

numeric vector. (optional) Vector with min and max values to subset based on column pixels

Value

VisiumHDReader object

Details

Loading functions are generated after the `visiumHD_dir` is added.

Examples

if (FALSE) { # \dontrun{
# Create a `VisiumHDReader` object
reader <- importVisiumHD()

# Set the visiumHD_dir
reader$visiumHD_dir <- "path to visium HD dir"
readerHD$visiumHD_dir <- visiumHD_dir

# Load tissue positions or create cell metadata
tissue_pos <- readerHD$load_tissue_position()
metadata <- readerHD$load_metadata()

# Load matrix or create expression object
matrix <- readerHD$load_matrix()
expression_obj <- readerHD$load_expression()

# Load transcript data (cell metadata, expression object, and transcripts
# per pixel)
my_transcripts <- readerHD$load_transcripts(
    array_subset_row = c(500, 1000),
    array_subset_col = c(500, 1000)
)

# Create a `giotto` object and add the loaded data
# TODO
} # }