Skip to contents

Load coordinates from 'tissue_positions_list.csv' files and merge them into a tibble.

Usage

LoadSpatialCoordinates(
  coordinatefiles,
  remove_spots_outside_tissue = TRUE,
  verbose = TRUE
)

Arguments

coordinatefiles

Character vector of file paths. Paths should specify .csv files output by spaceranger

remove_spots_outside_tissue

Should spots outside the tissue be removed?

verbose

Print messages

Value

An object of class tbl containing spot coordinates

Details

The merging process makes sure that all genes detected are present in the merged output. This means that if a gene is missing in a certain dataset, the spots in that dataset will be assigned with 0 expression.

Examples


library(semla)

# Load and merge coordinates from two samples
coordinatefiles <-
  c(system.file("extdata/mousebrain/spatial",
                "tissue_positions_list.csv",
                package = "semla"),
    system.file("extdata/mousecolon/spatial",
                "tissue_positions_list.csv",
                package = "semla"))
coordinates <- LoadSpatialCoordinates(coordinatefiles)
#>  Loading coordinates:
#> →   Finished loading coordinates for sample 1
#> →   Finished loading coordinates for sample 2
#>  Collected coordinates for 5164 spots.