-
Notifications
You must be signed in to change notification settings - Fork 908
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
Using the scVI method of Integration in Seurat v5 #7164
Comments
Same issue here. |
Fastmnn also doesnt work despite being in the documentation. |
Hi all,
|
Hello Gesmira, |
And have you loaded it in with |
Sorry Gesmira, is v 0.3.1 of SeuratWrapppers the correct one? |
Also, when I try But it seems I installed it with |
I just updated the version number so it is now 0.3.19. Can you repeat the installation with |
I got this
|
I managed to get fastmnn working in my fork of the repository. |
Hello @inofechm, scanpy 1.9.3 pypi_0 pypi These are all the packages in my scvi environment: Name Version Build Channelabsl-py 1.4.0 pyhd8ed1ab_0 conda-forge |
@inofechm thanks for addressing the fix! Would you be able to open a PR to seurat-wrappers with your changes? Thanks! |
@mdu4003 Yes, seems to be an error with the environment and likely reticulate. Are you pointing to the correct conda environment in the |
I've made a PR. Thanks for developing these exciting new features, they've been awesome in my hands! |
Great, it's merged now! Glad to hear it! |
Hi! |
Can you share all the code you ran before IntegrateLayers()? |
Hello @Gesmira, library(Seurat) #Integrative analysis in Seurat v5 #Layers in the Seurat v5 object load datasetFU_I_d1_T1_counts <- read.csv(file = "/Users/diazmeco/MoscatDiazMecoLab Dropbox/Moscat Lab/0.OMICS_WCM/Z.Z.COLLABORATIONS/NGS_Luxembourg_ElizabethLetellier_feb2023/seurat_GSE134255_GSE199999/GSE199999/GSE199999_RAW/GSM6001734_281_d1_1.csv.gz", header = TRUE, row.names = 1) FU_I_d1_T1 <- CreateSeuratObject(counts = t(FU_I_d1_T1_counts), project = "d1_1", min.cells = 3, min.features = 200) An object of class Seurat |
Do you then split this object into multiple layers for doing integration? Like in the vignette: |
Sorry @Gesmira. I have 4 objects (different collection times) This is the full code: library(Seurat) #Integrative analysis in Seurat v5 #Layers in the Seurat v5 object load datasetFU_I_d1_T1_counts <- read.csv(file = "/Users/diazmeco/MoscatDiazMecoLab Dropbox/Moscat Lab/0.OMICS_WCM/Z.Z.COLLABORATIONS/NGS_Luxembourg_ElizabethLetellier_feb2023/seurat_GSE134255_GSE199999/GSE199999/GSE199999_RAW/GSM6001734_281_d1_1.csv.gz", header = TRUE, row.names = 1) FU_I_d1_T1 <- CreateSeuratObject(counts = t(FU_I_d1_T1_counts), project = "d1_1", min.cells = 3, min.features = 200) obj<-merge(x = FU_I_d1_T1, y = list(FU_I_d1_T2,FU_I_d3,FU_I_d6)) obj <- NormalizeData(GSE199999) visualize by batch and cell type annotationcell type annotations were previously added by Azimuth (I SKIPPED)#Perform streamlined (one-line) integrative analysis obj_SCVI<-IntegrateLayers(object=obj, orig.reduction = "pca", method=scVIIntegration, new.reduction='integrated.scvi', conda_env="/Users/diazmeco/.conda/envs/scvi-env", group.by = "orig.ident") I think it is running ok now.
|
Ok nice, if it's running I believe you can ignore the warnings for now. Let me know if it finishes running! |
Only 1 more question. |
Happy to help @mdu4003! Yep, you can save the seurat object with saveRDS as usual. |
Thanks for that @Gesmira I no longer get the same error, after I installed SeuratWrapper. However, I now get a different error, something to do with ''mach-o file''
Have you any idea how to solve that? |
Hi, I continue getting the same error as @mdu4003, even after splitting the object and converting to a v5 assay. |
The error changed when I split the object using the "SCT" assay or if I ran the IntegrateLayers() function to the "RNA" assay (splitting based on the "RNA" slot) as below: |
Hi @joaoufrj. The initial error you included implied you are calling JoinLayers on an assay that is not "Assay5". Can you confirm that |
Hi, after splitting the object there was a message saying the assays were originally v3 but were converted to v5.
Cheers,
Joao
…On 27 Apr 2023 at 9:05 PM +0100, gesmira ***@***.***>, wrote:
Hi @joaoufrj. The initial error you included implied you are calling JoinLayers on an assay that is not "Assay5". Can you confirm that inherits(obj[["RNA"]], "Assay5") returns TRUE?
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
I have the same issue: see below.,
|
Hey @joaolsf , I am assuming you were trying to integrate a sctransformed seurat object with scVI. Were you successful in doing this? |
Hey, were you able to integrate a SCTransformed seurat object using SCVI in Seurat V5?. I am facing the same problems as you! |
I encountered the same issue with seuratwrappers, and I resolved it using the following steps: Assuming 'Data' is your Seurat V5 object with multiple layers.Ensure the "RNA" layer is treated as an AssayData[["RNA"]] <- as(object = Data[["RNA"]], Class = "Assay") Convert to anndata formatData <- convertFormat(Data, from = "seurat", to = "anndata", main_layer = "counts", drop_single_values = FALSE) Set up and train the scvi modelYou can include your categorical or continuous covariatesscvi$model$SCVI$setup_anndata(Data, categorical_covariate_keys = c("group", "sex"), continuous_covariate_keys = c("nCount_RNA", "percent.mt")) Retrieve the latent representationlatent <- model.get_latent_representation() Prepare data frames and matricesx <- as.data.frame(colnames(Data)) Create a new dimension reduction object with scvi embeddingsData[["scvi"]] <- CreateDimReducObject(embeddings = latent_matrix, key = "scvi_", assay = DefaultAssay(Data)) Run FindNeighbors, FindClusters, and RunUMAP with reduction = "scvi" |
@hassansaei Thank you for your input. I ended up using scVI in Python. |
@hassansaei Hi, sorry to bother you! when I run here:
An error occurred as following: GPU available: False, used: False ── Python Exception Message ───────────────────────────────────────────────────────────── ── R Traceback ──────────────────────────────────────────────────────────────────────────
I can't figure out, could you please give any suggestions? Thanks for your attention. |
Hi, what are your installed scvi-tools and PyTorch Lightning versions? Upgrading to the latest scvi-tools (1.0.4) and lightning (2.1.3) might fix the problem. |
hey, thanks for your answer. I'll try it. |
Hi, I reinstalled seurat-wrappers and tried IntegrateLayers with sc-vi and I am getting the below error: seurs = IntegrateLayers( Error in py_module_import(module, convert = convert) : To note torchmetrics all its dependencies are installed in my scvi-env. Thanks
Matrix products: default locale: time zone: America/Toronto attached base packages: other attached packages: loaded via a namespace (and not attached): |
Hi @ggruenhagen3 , I ran into an error while performing
Thanks, |
@alicekao1118 I had the same issue. I've made a pull request to fix this problem. While waiting for it to be merge you can install directly like this:
|
It works perfectly with SCT transformed data now, thanks @GreenGilad! |
I am comparing Integration methods using the
IntegrateLayers()
function and am running into an Error when trying to use the scVI method. The other methods (harmony, rpca and cca) I have tried work fine.I am pointing to an anaconda environment with scvi tools installed. I believe the Error is related to the ''method='' argument in the function call. The package notes does not list the scVI method as an integration method (?IntegrateLayers) however the Integrative analysis vignette uses this method just fine.
Error in is_quosure(x = method) : object 'scVIIntegration' not found
https://satijalab.org/seurat/articles/seurat5_integration.html#layers-in-the-seurat-v5-object
The text was updated successfully, but these errors were encountered: