BioMart Ensembl id imperfect retrieval
The genes that are missed are probably not official mgi symbols.

You might wanna look them up at mgi:

cd45 -&gt; Ptprc 

cd11b -&gt; Itgam 

p2ry12 -&gt; P2ry12 (?) (CAPS sensitive?)    

glast -&gt; Slc1a3 

s100a -&gt; S100a1 

pecam -&gt; Pecam1 (?)


I suspect biomaRt is not the problem here, the only better way I can come up with is to download the ENSEMBL annotation (GTF) file, and get the symbol out of this annotation with AWK or in R.

Here an example in R, since you don't want to use AWK:

file &lt;- read.table("Mus_musculus.GRCm38.78.gtf", sep = "\t", comment.char = "#")

exons &lt;- subset(file, V3 == 'exon')

V9 &lt;- file[,"V9"]

ensembl_names &lt;- sub("gene_id ","",V9)

split &lt;- strsplit(ensembl_names, ";")

splitting &lt;- sapply(split, function(x) x[1])

split_symbol &lt;- strsplit(ensembl_names, "gene_name ")

splitting_symbol &lt;- sapply(split_symbol, function(x) x[2])

splitting_symbol2 &lt;- strsplit(splitting_symbol, "; ")

symbol_names &lt;- sapply(splitting_symbol2, function(x) x[1])

ensemble_symbol_big &lt;- cbind(splitting, symbol_names)

ensembl_symbol &lt;- unique(ensemble_symbol_big)

colnames(ensembl_symbol) &lt;- c("ENSEMBL", "Symbol")

write.table(ensembl_symbol, "ensembl_symbol.txt", sep = "\t", row.names = F)