This is a test version of Biostars. For the public version, visit https://www.biostars.org.
IntegrateData orig.ident = "SeuratObject"

Hi,

I am working with spatial transcriptomics (Visium) data from 17 samples belonging to different genotypes. My workflow is:

Load each sample separately with Load10X_Spatial() and filtering.

Run the standard Seurat integration pipeline (SCT-based):

SCTransform()
SelectIntegrationFeatures()
PrepSCTIntegration()
FindIntegrationAnchors()
IntegrateData()

Before integration, each individual Seurat object correctly contains metadata identifying the sample. However, after integration, when I inspect the integrated object, I notice that:

spatial_integrated_filtered@meta.data$orig.ident = "SeuratProject" 
process_sample <- function(path, sample, genotype) {


  obj <- Load10X_Spatial(data.dir = path)
  obj$sample <- sample
  obj$genotype <- genotype
  obj <- PercentageFeatureSet(obj, pattern = "^mt-", col.name = "percent_mito")
  obj <- PercentageFeatureSet(obj, pattern = "^Hb.*-", col.name = "percent_hb")

  obj_filtered <- subset(
    obj,
    subset =
      nFeature_Spatial > 500 &
      nFeature_Spatial < 7500 &
      nCount_Spatial > 1000 &
      nCount_Spatial < 60000 &
      percent_mito < 10 &
      percent_hb < 5
  )

  obj_filtered@images[[genotype]] <- obj_filtered@images$slice1
  obj_filtered@images$slice1 <- NULL

  return(list(
    raw = obj,
    filtered = obj_filtered,
  ))
}

results <- list()

for (i in seq_along(folders)) {
  sample <- paste0("TS", i)
  genotype <- genotypes[i]
  path <- file.path(final_dir, folders[i], "outs")

  results[[sample]] <- process_sample(path, sample, genotype)
}

split_spatial <- lapply(results, `[[`, "filtered")

split_spatial <- PrepSCTIntegration(object.list = split_spatial, anchor.features = spatial_features,
                              verbose = FALSE)

spatial_anchors <- FindIntegrationAnchors(object.list = split_spatial, normalization.method = "SCT",
                                      verbose = FALSE, anchor.features = spatial_features)

spatial_integrated <- IntegrateData(anchorset = spatial_anchors, normalization.method = "SCT",
                                  verbose = FALSE)
integration seurat sctransform st

0 answers

No answers yet.

Log in to answer this question.