Hello, geneslator developers!
As you correctly pointed out, the problem of association geneID and symbol name is very complex. Do you use in your database HGNC gene names aliases databases?
EMBL list:
https://ftp.ebi.ac.uk/pub/databases/genenames/hgnc/tsv/hgnc_complete_set.txt
and NCBI list:
ftp://ftp.ncbi.nlm.nih.gov/gene/DATA/GENE_INFO/Mammalia/Homo_sapiens.gene_info.gz
The problem with the gene names in human genome is even more serious: after EMBL annotation v.29 (if I remember correctly) a lot of symbol names of IDs were removed, so if we need to compile the most full database of gene names and IDs it should be something like to compiling a dictionary
GENETABLE <- as.data.frame(read.table("names.v112.txt", sep = "\t", header = T, stringsAsFactors = FALSE, row.names = NULL, comment.char="", quote=""))
GENETABLE <- rename(GENETABLE, GeneID = gene_id)
GENESV29 <- as.data.frame(read.table("names.v29.txt", sep = "\t", header = T, stringsAsFactors = FALSE, row.names = NULL, comment.char="", quote=""))
GENESV29 <- GENESV29 %>% dplyr::select(GeneID, gene_name)
# reading all aliases from HGNC converted database
ALIASES <- as.data.frame(read.table("Homo_sapiens.converted", sep = "\t", header = T, stringsAsFactors = FALSE, row.names = NULL, comment.char="", quote=""))
ALIASES <- rename(ALIASES, gene_name = GeneName)
# here we're binding the full list. All source DFs must have the columns with the same names
DICT <- dplyr::bind_rows(list(GENETABLE, GENESV29, ALIASES)) %>% distinct()
And then use function like
names2IDs <- function (dframe) {
final <- dplyr::left_join(dframe, DICT, by = c("Genes" = "gene_name"),multiple = "all") %>%
dplyr::mutate (GeneID = coalesce(GeneID, Genes)) %>%
dplyr::rename (gene_id = GeneID)
return (final)
}
in general case to get all IDs that matches names list. Please, clarify your approach in the documentation - what kind of aliases do you employ, and how do you treat gene names that were discarded (but still present in many databases/publications)? How do you process cases when one geneID -> many gene names (what gene name do you select in that case?) and rare cases of gene copies when one gene name -> many geneIDs?
Probably, you can contact with genecards.org and get from them aliases database.
Also it would be excellent if you will provide in the vignette the example how to convert all gene IDs/names from the specific column of dataframe/data.table objects. Option "all" or "any" is very important for wet biologists and should be the option of matching function.
EMBL list:
https://ftp.ebi.ac.uk/pub/databases/genenames/hgnc/tsv/hgnc_complete_set.txt
and NCBI list:
ftp://ftp.ncbi.nlm.nih.gov/gene/DATA/GENE_INFO/Mammalia/Homo_sapiens.gene_info.gz
The problem with the gene names in human genome is even more serious: after EMBL annotation v.29 (if I remember correctly) a lot of symbol names of IDs were removed, so if we need to compile the most full database of gene names and IDs it should be something like to compiling a dictionary
And then use function like
in general case to get all IDs that matches names list. Please, clarify your approach in the documentation - what kind of aliases do you employ, and how do you treat gene names that were discarded (but still present in many databases/publications)? How do you process cases when one geneID -> many gene names (what gene name do you select in that case?) and rare cases of gene copies when one gene name -> many geneIDs?
Probably, you can contact with genecards.org and get from them aliases database.
Also it would be excellent if you will provide in the vignette the example how to convert all gene IDs/names from the specific column of dataframe/data.table objects. Option "all" or "any" is very important for wet biologists and should be the option of matching function.