ScaleData not saving into SCE object
1
0
Entering edit mode
12 days ago
Samantha • 0

Hello,

I'm working with a SCE object and trying to scale data to create my clusters. I am able to normalize the data to create the assay seuratNormData but when I try to do the same with scaled data it shows the following output that seuratScaledData is saving under AltExp. However then when I try to find this data in my object afterwards it doesn't exist in AltExp or under Assays. No errors are popping up but it seems like it just doesn't actually apply the code to the object?

runSeuratScaleData(inSCE = sce, useAssay = "seuratNormData", scaledAssayName = "seuratScaledData")
Centering and scaling data matrix
  |=====================================================================================================================| 100%
class: SingleCellExperiment 
dim: 36601 243692 
metadata(4): sctk assayType findMarker seurat
assays(3): counts decontXcounts seuratNormData
rownames(36601): MIR1302-2HG FAM138A ... AC007325.4 AC007325.2
rowData names(14): feature_ID feature_name ... var.features.rank hvf
colnames(243692): k1049_AAACCTGAGCCTTGAT-1 k1049_AAACCTGAGGCATGGT-1 ... sli202_TTTGTCAGTTGTGGAG-1
  sli202_TTTGTCATCCTTGACC-1
colData names(25): cell_barcode column_name ... scds_hybrid_call cellSubtype
reducedDimNames(43): PCA UMAP ... seuratUMAP doubletFinder_UMAP
mainExpName: NULL
altExpNames(1): seuratScaledData

altExpNames(sce)
character(0)
SCE scaledata • 234 views
ADD COMMENT
0
Entering edit mode
11 days ago

I'm assuming you're using the package singleCellTK.

This is the code of the function you are running:

runSeuratScaleData <- function(inSCE,
                               useAssay = "seuratNormData",
                               scaledAssayName = "seuratScaledData",
                               model = "linear",
                               scale = TRUE,
                               center = TRUE,
                               scaleMax = 10,
                               verbose = TRUE) {
  seuratObject <- convertSCEToSeurat(inSCE, useAssay)
  seuratObject <- Seurat::ScaleData(
    seuratObject,
    features = getSeuratVariableFeatures(inSCE),
    model.use = model,
    do.scale = scale,
    do.center = center,
    scale.max = as.double(scaleMax),
    verbose = verbose
  )
  inSCE <-
    .updateAssaySCE(inSCE, seuratObject, scaledAssayName, "scale.data")
  inSCE <- .addSeuratToMetaDataSCE(inSCE, seuratObject)
  # inSCE@metadata$seurat$scaledAssay <- scaledAssayName
  # inSCE <- expSetDataTag(inSCE = inSCE, assayType = "scaled",
  #                        assays = scaledAssayName)
  return(inSCE)
}

It looks like the bit that sets the altExpName() is commented out:

...
# inSCE <- expSetDataTag(inSCE = inSCE, assayType = "scaled",
#                        assays = scaledAssayName)
...

I have no experience with this package and it seems like it wraps a bunch of code around Seurat and scater/scran. My advice would be to use the code above to manually run each step in the function and see what the output you get is. If you find any function not found errors you can use tripple colon eg. singleCellTK:::.addSeuratToMetaDataSCE(). I'd also recommend you post on their Gtihub compbiomed/singleCellTK

ADD COMMENT

Login before adding your answer.

Traffic: 2599 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6