I'm trying to get some `entrez` ids from some gene names using [biomaRt][1]

In my example below I have 2 genes `Igha` and `Mlc1` for mus musculus

My version of biomaRt is `biomaRt_2.38.0`

    library("biomaRt")
    mart <- useMart(biomart = "ensembl", dataset = "mmusculus_gene_ensembl")
    getBM(attributes=c("ensembl_gene_id","mgi_symbol","entrezgene"), values = c("Igha", "Mlc1"), bmHeader = T, filters = "mgi_symbol", mart = mart)
    #      Gene stable ID MGI symbol NCBI gene ID
    #1 ENSMUSG00000095079       Igha           NA
    #2 ENSMUSG00000035805       Mlc1       170790

I know that some Ensembl gene ID do not have Entrez gene ID https://www.biostars.org/p/275619/

But in this case, I'm able to find the Entrez gene ID from Ensembl

http://www.ensembl.org/Mus_musculus/Gene/Summary?db=core;g=ENSMUSG00000095079;r=12:113254830-113260236

Which is `Refseq Gene ID 238447`

Maybe https://www.biostars.org/u/7019/ will have an answer :)

  [1]: https://bioconductor.org/packages/release/bioc/html/biomaRt.html
Using https://www.biostars.org/u/18713/ 's comment

Here is my trick using [esearch][1]

    biomart_genes <- getBM(attributes = c("external_gene_name", "entrezgene"), filters = "mgi_symbol", values = gene_list, bmHeader = T, mart = mart)
    colnames(biomart_genes) <- c("hgnc_symbol","entrez_gene_id")

    for (i in 1:nrow(biomart_genes)){
        if (is.na(biomart_genes[i,"entrez_gene_id"])){
            term <- paste0(biomart_genes[i,"hgnc_symbol"]," [gene] and 10090 [taxID]")
            biomart_genes[i,"entrez_gene_id"] <- uid(esearch(term, db = "gene", rettype = "uilist", retmode = "xml", retmax = 1))
        }
    }


  [1]: https://www.rdocumentation.org/packages/reutils/versions/0.2.2/topics/esearch