-
Notifications
You must be signed in to change notification settings - Fork 890
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PrepSCTIntegration Error in scale.data[anchor.features, ] : subscript out of bounds #8216
Comments
features <- SelectIntegrationFeatures(object.list = Prep_healthy, nfeatures = 3000) expects that |
Each name in the "Prep_healthy" list is a Seurat object
|
Ahh, I see. This is related to #8203. My suggestion for now would be to create a "RNA" assay, by copying the "Spatial" assay and doing everything on the "RNA" assay. object[["RNA"]] <- object[["Spatial"]] |
Perfect! That works, thank you so much! |
Hi all, thanks for all of your amazing hard work! By setting
I was using Also not sure whether this may be related to #8561. |
Hi,
I'm fairly new to R and Seurat, so I hope this will be an easy fix. I've a list of 7 Seurat objects from 10X spatial datasets, and ran SCTransform on them. The list is "Prep_Healthy". Running this code:
Prep_Healthy<- SCTransform(Prep_Healthy, vst.flavor = "v2", assay="Spatial")
features <- SelectIntegrationFeatures(object.list = Prep_healthy, nfeatures = 3000)
Prep_healthy <- PrepSCTIntegration(object.list = Prep_healthy, anchor.features = features)
But running this I get the error code "| 0 % ~calculating Error in scale.data[anchor.features, ] : subscript out of bounds"
If I set the nfeatures lower, then it works, the highest is nfeatures = 690 after which the error occurs. So it seems that the list for the anchor.features is too long, not sure if it's a memory thing but I've tried it on 2 computers.
I also tried merging and splitting the list as in #3085 and also tried to use intersect in case some names were missing across the datasets as in #6707. I'm at a bit of a loss, any help would be greatly appreciated.
"
Healthy_Samples <- list(HEALTHY.Male.s1, HEALTHY.Male.s2,
HEALTHY.Female1.s1, HEALTHY.Female1.s2.clean,
HEALTHY.Female1.s3, HEALTHY.Female2.s1, HEALTHY.Female2.s2)
#Filter for counts greater than 200
i <- 1
while(i <= length(Healthy_Samples)){
filtered_data <- st_filter_by_genes(st.data = Healthy_Samples[[i]],x = 200)
Healthy_Samples[[i]] <- filtered_data
i <- i+1
}
st_SCT <- function(data.list){
for (i in 1:length(data.list)) {
data.list[[i]] <- SCTransform(data.list[[i]], vst.flavor = "v2", verbose = T,assay="Spatial")}
data.list[[i]] <- UpdateSeuratObject(data.list[[i]])
return(data.list)
}
Prep_healthy <- st_SCT(Healthy_Samples)
features <- SelectIntegrationFeatures(object.list = Prep_healthy, nfeatures = 3000)
Prep_healthy <- PrepSCTIntegration(object.list = Prep_healthy, anchor.features = features)
The text was updated successfully, but these errors were encountered: