Skip to content
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

Update RNAIntegration.R #2178

Open
wants to merge 7 commits into
base: dev
Choose a base branch
from
Open

Conversation

ZhangFuchang
Copy link

when running addGeneIntegrationMatrix function, it will occur this error: "Error in slot(object = object, name = "features")[[layer]] <- features : \n more elements supplied than there are to replace\n"

After repeated testing, I finally know the answer to this question: This error occurred in the RNAIntegration.R of the ArchR package This code in the RNAIntegration.R file: seuratATAC <- Seurat::CreateSeuratObject(counts = mat[head(seq_len(nrow(mat)), 5), , drop = FALSE]) The Seurat::CreateSeuratObject function requires that the rownames of mat must be vector, not matrix. But the rownames passed to mat in the previous code was actually a matrix, so you only need to add a command line before this code, this will cast the rownames of mat to a vector: rownames(mat) <- as.character(rownames(mat))
And then this error was completely eliminated.

rcorces and others added 7 commits April 14, 2023 06:05
when running addGeneIntegrationMatrix function, it will occur this error:
"Error in slot(object = object, name = \"features\")[[layer]] <- features : \n  more elements supplied than there are to replace\n"

After repeated testing, I finally know the answer to this question:
This error occurred in the RNAIntegration.R of the ArchR package This code in the RNAIntegration.R file: seuratATAC <- Seurat::CreateSeuratObject(counts = mat[head(seq_len(nrow(mat)), 5), , drop = FALSE])
The Seurat::CreateSeuratObject function requires that the rownames of mat must be vector, not matrix. But the rownames passed to mat in the previous code was actually a matrix, so you only need to add a command line before this code, this will cast the rownames of mat to a vector:
rownames(mat) <- as.character(rownames(mat))
And then this error was completely eliminated.
Copy link

@halaszlaszlo halaszlaszlo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works and tested with: Seurat_5.1.0, SeuratObject_5.0.2

@immanuelazn immanuelazn changed the base branch from master to dev November 23, 2024 01:31
@immanuelazn
Copy link
Collaborator

Hi ZhangFuchang, thanks for this! I've been noticing this was breaking tests starting at R 4.2/4.3 or so. I'll merge in, but do you mind setting your local upstream as the dev branch? I would like to provide you credit for this, but I do not want the changes from autocomment.yml. Otherwise, I can do this myself if you give me access to your fork.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants