SPATA2
from platform VisiumHDinitiateSpataObjectVisiumHD.Rd
This function initiates a SPATA2
object with data generated
using the 10x Genomics VisiumHD
platform.
initiateSpataObjectVisiumHD(
sample_name,
directory_visium,
square_res = "16um",
mtr = "filtered",
img_active = "lowres",
img_ref = "lowres",
verbose = TRUE
)
Character. The name of the sample.
Character. The directory containing the Visium output files.
Character. The square resolution from which to load the data. One of *c('16um', '8um', '2um'). See details for more.
Character. Specifies which matrix to use, either "filtered" or "raw". Default is "filtered".
Character. The active image to use, either "lowres" or "hires". Default is "lowres".
Character. The reference image to use, either "lowres" or "hires". Default is "lowres".
Logical. If TRUE, progress messages are printed. Default is TRUE.
A SPATA2
object the VisiumHD platform.
The function requires a directory containing the output files from a 10x Genomics VisiumHD experiment
specified with the argument directory_visium
. This directory (below denoted as ~) must include the following
sub-directories:
~/binned_outputs: A folder with the following subdirectories.
~/binned_outputs/square_002um: The folder containing the data for square_res = '2um'
.
~/binned_outputs/square_008um: The folder containing the data for square_res = '8um'
.
~/binned_outputs/square_016um: The folder containing the data for square_res = '16um'
.
Depending on your input for square_res
only the corresponding subfolder is required. This subfolder should
contain the following files and sub-directories:
~/binned_outputs/<square_res>/filtered_feature_bc_matrix.h5 or ~/raw_feature_bc_matrix.h5: The HDF5 file containing the filtered or raw feature-barcode matrix, respectively.
~/binned_outputs/<square_res>/spatial/tissue_lowres_image.png or ~/spatial/tissue_hires_image.png: The low-resolution or high-resolution tissue image.
~/binned_outputs/<square_res>/spatial/scalefactors_json.json: A JSON file containing the scale factors for the images.
~/binned_outputs/<square_res>/spatial/tissue_position.parquet A .parguet file containing the tissue positions and spatial coordinates.
The function will check for these files and process them to create a SPATA2
object. It reads the count matrix, loads the spatial data,
and initializes the SPATA2
object with the necessary metadata and settings.
It is crucial to install the package arrow
in a way that arrow::read_parquet()
works. There
are several ways. Installing the package with install.packages('arrow', repos = 'https://apache.r-universe.dev')
worked reliably for us.