Problem with sctransform after subset of integrated dataset #9678
Closed
dartagnan323
started this conversation in
General
Replies: 1 comment
-
issues resolved: |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi I am using seurat 5.2. (I did find some similar requests but did not seem to find a solution)
I have an object with 8 samples of single cell that I first merged then integrated using SCTransform and harmonyintegration parameter which I found to be best in my case.
After I did subset from clusters:
Endo <- subset(x = GCharm, idents = c("Endo1", "Endo2", "Endo3", "Endo4", "Endo5", "Endo6", "EndoAdipo", "EndoLymph")) DefaultAssay(object = Endo) <- "RNA" Endo <- PercentageFeatureSet(Endo, pattern = "^mt-", col.name = "percent.mt") Endo <- SCTransform(Endo, vars.to.regress = "percent.mt", verbose = FALSE)
for Sctransform, all the scaling that I need to redo after subsestting should be integrated so I guess it should be fine.
I did the same for another type of cells.
So in every case I get a message saying that SCT is different than the previous one it contained which apparently from another post I found is not important.
But for one of these 2 subsests I get 4 times:
Warning message: In size + sum(size_args, na. rm = FALSE) : NAs produced by integer overflow
is that a problem?
In addition for each one, I get an sct model list of only 1 whereas I had 8 satnding for my 8 conditions before in my original object. I don't know why it is not separate anymore. I did try to split layers in the RNA assay but it says they already are and I have 10 layers (including the 8 samples + counts and scale data).
Should I re-do my scaling and all on the RNA assay too? I don 't think it matters for SCTransform?
I could do PCA, UMAP, neighbors, clusters. It's fine for one subset but for the other where I have NA errors, I get a few dots (cells) spread out in the UMAP and the main clusters with 99% of cells are then in a small corner. It does not happen with the subset without NA errors.
Then, the fact that I have only 1 layer in SCTransform then generates (I think) an error in the step of integration. (I still have information of integration from the main object before subset, but I suppose it will be overwritten...?)
Note in harmony::HarmonyMatrix(data_mat = Embeddings(object = orig), :
HarmonyMatrix is deprecated and will be removed in the future from the API in the future
Error in
contrasts<-
(*tmp*
, value = contr.funs[1 + isOF[nn]]) :Contrasts can not be applied to factors with less than 2 levels
So I tried to apply split layers:
Endo[["SCT"]] <- split(Endo[["SCT"]], f = Endo$Sample)
I get:
Note : Input is a v3 assay and
split()
only works for v5 assays; converting to a v5 assayNote : Assay SCT changing from SCTAssay to Assay5
Also I note there are 24 layers which is not the 8 I expect (data x8 counts x8, scaledata x8)
then I try to integrate again
Endo <- IntegrateLayers(object = Endo, method = HarmonyIntegration, normalization.method = "SCT", verbose = F)
and I get another error message:
Error in
IntegrateLayers()
:! None of the features provided are found in this assay
Could you advise as to what I am doing wrong as all this code worked fine on the main object but does not work on subset object. I guess I don t subset properly or there is a step I miss after subsetting.
thanks a lot for any help,
Beta Was this translation helpful? Give feedback.
All reactions