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

Different features in new layer data than already exists for counts #173

Open
vertesy opened this issue Dec 17, 2023 · 1 comment
Open

Comments

@vertesy
Copy link

vertesy commented Dec 17, 2023

Hello,

This is a 2-in-1 issue (A, B).

I am trying to rename genes in Seurat. I know you principally disagree, however I need it.

For that end, I:

obj <- SetAssayData(obj, layer = layer.name, new.data = matrix_n) where matrix_n contains e.g. a single gene renamed.

Also tried SeuratObject::LayerData(assayobj, layer = layer.name) <- matrix_n , but same error

Expected

Matrix replaced.

Observed

  1. Warning
Warning: Different features in new layer data than already exists for counts
  1. Really scary behavior: it omits the gene renamed! so nrow becomes n-1!
    (A) At least this should be a "nrow !=" type of error! )

B) Question

  1. How can I rename genes in freshly created object in Seurat v5?
  2. I realized that names are also stored in obj@assays$RNA@features@.Data. Is there any other place that needs replacement? I guess if I replace rownames of @features@.Data, SetAssayData wont complain?
@SMP7UC
Copy link

SMP7UC commented Aug 28, 2024

Update: I could solve the problem by splitting object including scale.data as well, which was not included by default.

I am also getting a similar error message while scaling the data.

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

No branches or pull requests

2 participants