GreenleafLab / ArchR

ArchR : Analysis of Regulatory Chromatin in R (www.ArchRProject.com)
MIT License
388 stars 141 forks source link

Error when using addClusters() on multiome data #2011

Open klgoss opened 1 year ago

klgoss commented 1 year ago

Hello,

Thank you so much for creating such a great tool. I really appreciate how thorough you are in the manual and do a great job of explaining what you're doing/why you're doing it. I'm trying to use ArchR on 10X Multiome data. I'm following the tutorial here: https://greenleaflab.github.io/ArchR_2020/Ex-Analyze-Multiome.html and am getting an error on the addCluster() step.

Attach your log file ArchR-addClusters-f90d110034e1-Date-2023-08-24_Time-15-28-08.442722.log

Describe the bug I'm following the tutorial but get an error when I try to run addClusters(): <simpleError in validObject(.Object): invalid class “DimReduc” object: dimensions for ‘cell.embeddings’ must be in order>

Additional context I did remove some cells that I previously determined to be low quality, so I'm not sure if this is causing the issue or not.

rcorces commented 1 year ago

Hi @klgoss! Thanks for using ArchR! Please make sure that your post belongs in the Issues section. Only bugs and error reports belong in the Issues section. Usage questions and feature requests should be posted in the Discussions section, not in Issues.
It is worth noting that there are very few actual bugs in ArchR. If you are getting an error, it is probably something specific to your dataset, usage, or computational environment, all of which are extremely challenging to troubleshoot. As such, we require reproducible examples (preferably using the tutorial dataset) from users who want assistance. If you cannot reproduce your error, we will not be able to help. Before going through the work of making a reproducible example, search the previous Issues, Discussions, function definitions, or the ArchR manual and you will likely find the answers you are looking for. If your post does not contain a reproducible example, it is unlikely to receive a response.
In addition to a reproducible example, you must do the following things before we help you, unless your original post already contained this information: 1. If you've encountered an error, have you already searched previous Issues to make sure that this hasn't already been solved? 2. Did you post your log file? If not, add it now. 3.__ Remove any screenshots that contain text and instead copy and paste the text using markdown's codeblock syntax (three consecutive backticks). You can do this by editing your original post.

rcorces commented 1 year ago

https://github.com/satijalab/seurat/issues/3287

rcorces commented 1 year ago

Sorry - hit enter too soon. The above post is from a related post. You can see that this error is coming from Seurat because your object is not properly formatted. If you need additional help, this seems like a Seurat issue to me.

bingy007 commented 1 year ago

Hello,

Thank you so much for creating such a great tool. I really appreciate how thorough you are in the manual and do a great job of explaining what you're doing/why you're doing it. I'm trying to use ArchR on 10X Multiome data. I'm following the tutorial here: https://greenleaflab.github.io/ArchR_2020/Ex-Analyze-Multiome.html and am getting an error on the addCluster() step.

Attach your log file ArchR-addClusters-f90d110034e1-Date-2023-08-24_Time-15-28-08.442722.log

Describe the bug I'm following the tutorial but get an error when I try to run addClusters(): <simpleError in validObject(.Object): invalid class “DimReduc” object: dimensions for ‘cell.embeddings’ must be in order>

Additional context I did remove some cells that I previously determined to be low quality, so I'm not sure if this is causing the issue or not.

Hi klgoss,

Have you figured this out?

B

Qi-Qiao commented 1 year ago

Hello, Thank you so much for creating such a great tool. I really appreciate how thorough you are in the manual and do a great job of explaining what you're doing/why you're doing it. I'm trying to use ArchR on 10X Multiome data. I'm following the tutorial here: https://greenleaflab.github.io/ArchR_2020/Ex-Analyze-Multiome.html and am getting an error on the addCluster() step. Attach your log file ArchR-addClusters-f90d110034e1-Date-2023-08-24_Time-15-28-08.442722.log Describe the bug I'm following the tutorial but get an error when I try to run addClusters(): <simpleError in validObject(.Object): invalid class “DimReduc” object: dimensions for ‘cell.embeddings’ must be in order> Additional context I did remove some cells that I previously determined to be low quality, so I'm not sure if this is causing the issue or not.

Hi klgoss,

Have you figured this out?

B

Hi,

I have the same issue here. Any suggestions will be appreciated!

Sky970415 commented 11 months ago

I am having the same issue. Seurat recently made an update, I guess that might be relevant?


2023-12-08 14:22:58.983551 : ERROR Found in FindNeighbors for
LogFile = ArchRLogs/ArchR-addClusters-2fc412d3fa3b-Date-2023-12-08_Time-14-22-58.155241.log

<simpleError in validObject(.Object): invalid class “DimReduc” object: dimensions for ‘cell.embeddings’ must be in order>



2023-12-08 14:22:58.988674 : ERROR Found in runClusters for
LogFile = ArchRLogs/ArchR-addClusters-2fc412d3fa3b-Date-2023-12-08_Time-14-22-58.155241.log

<simpleError in .logError(e, fn = "FindNeighbors", info = "", errorList = errorList, logFile = logFile): Exiting See Error Above>


ZayaAyush commented 11 months ago

@rcorces @Sky970415 @Qi-Qiao @klgoss I have the same issue; could you figure it out?

<simpleError in validObject(.Object): invalid class “DimReduc” object: dimensions for ‘cell.embeddings’ must be in order>

sylestiel commented 11 months ago

Reverting to Seurat 4.3.0 fixes the problem with addClusters()

ZayaAyush commented 11 months ago

Reverting to Seurat 4.3.0 fixes the problem with addClusters()

Thank you! It worked:))

ShashTrip1 commented 10 months ago

I reverted to Seurat 4.3.0 and still getting the same error. Any ideas?

sylestiel commented 10 months ago

@ShashTrip1 Try devtools::install_github("GreenleafLab/ArchR", ref="release_1.0.2", repos = BiocManager::repositories(), force=TRUE).

heheige commented 8 months ago

I have the same problem after converting the seurat to 4.3.0. Any one figure it out? Many thank.

colquittlab commented 8 months ago

I'm having the same issue as well. I'm using Seurat v5 for other analyses, so an update in ArchR to accommodate these changes would be very much appreciated. Thanks.

ZayaAyush commented 8 months ago

Hi, I removed Seurat v5 and installed the packages below. Then it worked. I hope it will help.

Install the remotes package

install.packages('remotes')

Replace '4.3.0' with your desired version

remotes::install_version(package = 'Seurat', version = package_version('4.3.0')) library(Seurat) packageVersion("Seurat") remotes::install_version("Matrix", version = "1.6.3") packageVersion("Matrix") library(Matrix)

shamer3 commented 7 months ago

I have done both just Seurat downgraded to 4.3.0 and the combined Seurat and Matrix downgrade and I am still having issues. Anyone else found a fix ?

juliabelk commented 3 months ago

One option is to use addClusters(proj, method="scran", reducedDims = "LSI_Combined") to get around the Seurat issues. However I had trouble tuning the number of clusters (equivalent to resolution in Seurat) with scran, so I'm trying to downgrade Seurat as well.

rcorces commented 3 months ago

Credit to @catpetersen for looking into this. This problem presumably occurs here: https://github.com/GreenleafLab/ArchR/blob/65968a4068253783fe6b0918efcbf7d216a49ee7/R/Clustering.R#L439

Seurat won’t accept the embeddings matrix mat because the column names are not numbered perfectly in order. This only comes up in the multi-omic context where you run iterative LSI twice, so your column names are LSI1-30 and then LSI1-30 again. The fix should be simple but I dont have bandwidth to address it nor am I actively working with multiome data to test a fix.

In theory, all you need to do is add a line directly before the one that errors out that renumbers the column names from LSI1-60 instead or similar so that they are in order.

galib36 commented 2 months ago

Following code solved the problem for me

#Combined Dims
archrProj <- addCombinedDims(archrProj, reducedDims = c("LSI_ATAC", "LSI_RNA"), name =  "LSI_Combined")

colnames(archrProj@reducedDims$LSI_Combined$matRD) <- paste0('LSI',1:length(colnames(getReducedDims(archrProj,'LSI_Combined'))))