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

return NA for non-mappable genes #19

Open
fteufel opened this issue Mar 29, 2021 · 1 comment
Open

return NA for non-mappable genes #19

fteufel opened this issue Mar 29, 2021 · 1 comment

Comments

@fteufel
Copy link

fteufel commented Mar 29, 2021

Hi,

I'm trying to use homologene to rename the rows of a gene expression table. As indicated in the docs, queries for genes that cannot be mapped are not returned in the results

mapped_genes <- mouse2human(c('NoKnownHomolog1,'NoKnownHomolog2'))
## [1] mouseGene humanGene mouseID   humanID  
## <0 rows> (or 0-length row.names)

This means the resulting dataframe will be of a different length than the input vector, which prevents doing something like
new_rownames<- mouse2human(rownames(input_data))$humanGene, followed by dropping all NA rows from the df.
Is there any feature/best practice to apply homologene to this problem?

@oganm
Copy link
Owner

oganm commented Jun 24, 2022

Apologies, I have not seen this in time. In case it's still relevant, i often do

genes = c('NoKnownHomolog1','NoKnownHomolog2','Mog')
human_genes = mouse2human(genes)

human_genes$humanGene[match(genes,human_genes$mouseGene)]
[1] NA    NA    "MOG"

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