ArchR icon indicating copy to clipboard operation
ArchR copied to clipboard

Error when using addClusters() on multiome data

Open klgoss opened this issue 2 years ago • 18 comments

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.

klgoss avatar Aug 24 '23 19:08 klgoss

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 avatar Aug 24 '23 19:08 rcorces

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

rcorces avatar Aug 25 '23 12:08 rcorces

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.

rcorces avatar Aug 25 '23 12:08 rcorces

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

bingy007 avatar Nov 07 '23 18:11 bingy007

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!

Qi-Qiao avatar Nov 21 '23 21:11 Qi-Qiao

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>


Sky970415 avatar Dec 08 '23 19:12 Sky970415

@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>

ZayaAyush avatar Dec 17 '23 02:12 ZayaAyush

Reverting to Seurat 4.3.0 fixes the problem with addClusters()

sylestiel avatar Dec 19 '23 21:12 sylestiel

Reverting to Seurat 4.3.0 fixes the problem with addClusters()

Thank you! It worked:))

ZayaAyush avatar Dec 29 '23 02:12 ZayaAyush

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

ShashTrip1 avatar Jan 17 '24 20:01 ShashTrip1

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

sylestiel avatar Jan 17 '24 21:01 sylestiel

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

heheige avatar Mar 19 '24 15:03 heheige

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.

colquittlab avatar Mar 20 '24 18:03 colquittlab

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)

ZayaAyush avatar Mar 20 '24 23:03 ZayaAyush

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 ?

shamer3 avatar Apr 15 '24 13:04 shamer3

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.

juliabelk avatar Aug 26 '24 20:08 juliabelk

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.

rcorces avatar Aug 26 '24 23:08 rcorces

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'))))

galib36 avatar Sep 11 '24 17:09 galib36

Will have this implemented, thanks!

immanuelazn avatar Jan 22 '25 02:01 immanuelazn

Fixed in dev branch!

immanuelazn avatar Jan 22 '25 04:01 immanuelazn