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

Error in seu[["gene"]]: #2

Open
jiansongatnih opened this issue Jun 18, 2024 · 2 comments
Open

Error in seu[["gene"]]: #2

jiansongatnih opened this issue Jun 18, 2024 · 2 comments

Comments

@jiansongatnih
Copy link

Hi, I wanted to convert a Seurat object built using mouse scRNA data to a new Seurat object with human orthologs. I would like to perform CellphoneDB analysis on the mouse data, but CellPhoneDB requires Human gene symbols (human orthologs). The seurat object for mouse has 'features', not 'gene', so I got the following error:

CODE: WT_human_colon <- convert_mouse_seu_to_human(WT_mouse_colon)

ERROR:
Error in seu[["gene"]]:
! ‘gene’ not found in this Seurat object

Backtrace:

  1. seuratTools::convert_mouse_seu_to_human(WT_mouse_colon)
  2. SeuratObject:::[[.Seurat(seu, "gene")

Thanks for your help!

@whtns
Copy link
Collaborator

whtns commented Jul 5, 2024

Hi,
Unfortunately this package has ended up largely being for our own internal use. Supporting conversion of symbols between species is not a priority at the moment. The error relates to an out-of-date format for handling seurat assays. You might be able to get what you need by replacing seu[["gene"]] with seu

@AmyOlex
Copy link

AmyOlex commented Aug 15, 2024

Hello @jiansongatnih,
I recently ran into the same issue trying to use CellPhoneDB as well. Extract the code for the function convert_mouse_seu_to_human() from this package, rename it, and put it at the top of your R script. Then change the seu[["gene"]] to seu[["RNA"]] everywhere in the function and then it works fine. Note you still need to load this library though because it uses another function from this package and loads the table named "human_to_mouse_homologs" for the conversion. Hope this helps!

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

3 participants