different results coming from biomart online and biomaRt R library I am playing with biomart in order to get the list of genes associated to a specific gene ontology (GO) term.

So, if I use the webservice as in this query:

I get at least 50 genes. If I download the file I can gen an exact count of them:

$ cat mart_export.txt | wc -l
347


Now, I can do the same operation by using the R library biomaRt. Specifically:

&gt; ensembl &lt;- useEnsembl(biomart="ENSEMBL_MART_ENSEMBL", dataset='hsapiens_gene_ensembl')
&gt; gene &lt;- getBM(attributes = c('external_gene_name'), filters = 'go', values = 'GO:0030098', mart = ensembl)
&gt; unique(gene)
  external_gene_name
1               SPI1
2              PRKDC
3                TOX
4               LY6D
5               CBFB
6              IKZF1
7               RELB
8             FLT3LG


By doing so, these are all the genes I retrieve. The two results are totally different and I don't know why it. All these eight genes are found in the biomart file (I grepped it, to be sure).

I believe this is not an issue related to databases versions since I checked:

&gt;listMarts()
               biomart               version
1 ENSEMBL_MART_ENSEMBL      Ensembl Genes 94
2   ENSEMBL_MART_MOUSE      Mouse strains 94
3     ENSEMBL_MART_SNP  Ensembl Variation 94
4 ENSEMBL_MART_FUNCGEN Ensembl Regulation 94


and:

&gt;listDatasets(ensembl)
...
38 Human genes (GRCh38.p12)
...


Both are the same version used by biomart online.

What is going on? Is it possible that biomart online is considering GO relations that are not specified in the R version?
Sorry, this was my mistake in the last question. To search down the ontology, rather than just for the specific association with a term, biomaRt needs a different filter: 'go_parent_term'.

Try:

gene &lt;- getBM(attributes = c('external_gene_name'), filters = 'go_parent_term', values = 'GO:0030098', mart = ensembl)