BioMart returns one more item I am supplying 30 ensembl ids into BioMart, but somehow it returns 31 result. What is going wrong here?
Here you can see the code:

library('biomaRt')
mart &lt;- useDataset("mmusculus_gene_ensembl", useMart("ensembl"))
genes &lt;- rownames(mat)
G_list &lt;- getBM(filters= "ensembl_gene_id", attributes= 
c("ensembl_gene_id","entrezgene", 
"mgi_symbol","description"),values=genes,mart= mart)


genes list is the following one: 

[1] "ENSMUSG00000097971" "ENSMUSG00000097582" "ENSMUSG00000061808" "ENSMUSG00000097206"
[5] "ENSMUSG00000022425" "ENSMUSG00000094708" "ENSMUSG00000095937" "ENSMUSG00000032484"
[9] "ENSMUSG00000060550" "ENSMUSG00000073409" "ENSMUSG00000026822" "ENSMUSG00000056071"
[13] "ENSMUSG00000035299" "ENSMUSG00000045932" "ENSMUSG00000006154" "ENSMUSG00000032496"
[17] "ENSMUSG00000040809" "ENSMUSG00000032690" "ENSMUSG00000055322" "ENSMUSG00000066443"
[21] "ENSMUSG00000005089" "ENSMUSG00000073489" "ENSMUSG00000005800" "ENSMUSG00000034855"
[25] "ENSMUSG00000029417" "ENSMUSG00000029561" "ENSMUSG00000021843" "ENSMUSG00000020108"
[29] "ENSMUSG00000037849" "ENSMUSG00000066861"


As you can see I have here 30 genes, but BioMart returns:

&gt; G_list$mgi_symbol
[1] "Slc1a2"  "Mmp8"    "Eps8l1"  "Ddit4"   "Ktn1"    "Enpp2"   "Lcn2"    "Cxcl9"  
[9] "Oasl2"   "Ngp"     "Ltf"     "Oas2"    "Cxcl10"  "Mid1"    "Ifi206"  "Chil3"  
[17] "Ifit2"   "Tns1"    "S100a9"  "H2-Q7"   "H2-Q7"   "Ttr"     "Gm10163" "Oas1g"  
[25] "H2-Q6"   "Ifi204"  "Gm10359" "Gm12671" "Gm26699" "Gm26527" "Gm26917"
If you print G_list, you'll see this half way down:

1 ENSMUSG00000060550      15018      H2-Q7      Mus musculus histocompatibility 2, Q region locus 9 (H2-Q9), mRNA. [Source:RefSeq mRNA;Acc:NM_001201460]
2 ENSMUSG00000060550     110558      H2-Q7      Mus musculus histocompatibility 2, Q region locus 9 (H2-Q9), mRNA. [Source:RefSeq mRNA;Acc:NM_001201460]


So there are two entrez ids that map to the same Ensembl id. One of them maps to an alt locus.

If you exclude "entrezgene" from the query, you'll get 30 results.