dataPrepFromSeurat: Data Preparation from Seurat Object

View source: R/dataPrep.R

dataPrepFromSeuratR Documentation

Data Preparation from Seurat Object

Description

This data preparation function creates a data.frame from a Seurat Object. It extracts the pixel information and cluster labels of each barcode from user's input Seurat Object and generate a data.frame with a certain format which is required for the algorithm. If the user has customized labels, this function will change the column name to "Cluster" when generating the data.frame to make it consistent to the required format.

Usage

dataPrepFromSeurat(SeuratObj, label)

Arguments

SeuratObj

input Seurat object that contains labels for each barcode

label

the column name of the label information in "meta.data"

Value

A data.frame contains the pixel information and cluster labels for each barcode the sample. The index contains barcodes, and at least three other columns that have these information are required and the column names should be the same as following: "imagerow": The row pixel coordinate of the center of the spot "imagecol": The column pixel coordinate of the center of the spot "Cluster": The label that corresponding to this barcode

Examples

fpath <- system.file("extdata", "SeuratBC.rda", package="stJoincount")
load(fpath)
df <- dataPrepFromSeurat(seuratBC, "Cluster")

Nina-Song/stJoincount documentation built on Nov. 24, 2024, 8:31 a.m.