return NA for non-mappable genes
fteufel opened this issue · 1 comments
fteufel commented
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 commented
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"