This is a test version of Biostars. For the public version, visit https://www.biostars.org.
scType on Xenium Spatial Transcriptomics

Hi! I am trying to run scType to annotate a total of 18 clusters obtained following Xenium Spatial Transcriptomics (tissue type is pituitary). I am running the script however I keep encountering the following error (code included):

#Annotating via scType
#Step 1: Call packages via library function
library(dplyr)
library(Seurat)
library(HGNChelper)
library(openxlsx)

#Step 2: Install scType source files 
source("https://raw.githubusercontent.com/IanevskiAleksandr/sc-type/master/R/gene_sets_prepare.R")
source("https://raw.githubusercontent.com/IanevskiAleksandr/sc-type/master/R/sctype_score_.R")
source("https://raw.githubusercontent.com/IanevskiAleksandr/sc-type/master/R/sctype_wrapper.R")

#Loading in custom markers
# Read the marker file
markers <- read.xlsx("scTypeDB_short.xlsx")
head(markers)

#Step 3: Run scType on Seurat object
# Run scType with your Seurat object and custom markers
xen <- run_sctype(xen, 
                  assay = "Xenium", 
                  scaled = TRUE, 
                  known_tissue_type = "Pituitary", 
                  custom_marker_file = "scTypeDB_short.xlsx", 
                  name = "sctype_classification")

[1] "Using Seurat v5 object"
Error in (function (cond)  : 
  error in evaluating the argument 'x' in selecting a method for function 'rowSums': subscript out of bounds
In addition: There were 50 or more warnings (use warnings() to see the first 50)

I'm still new to this so would appreciate any help. Thanks!

spatial xenium sctype

1 answer

First you have to make sure the xenium object is SCT normalised. Then try this

source("https://raw.githubusercontent.com/kris-nader/sp-type/main/sp-type.R")


 xen <- run_sctype(xen, known_tissue_type="Pituitary", slot="SCT")

Log in to answer this question.