2

Here is my code that I used to try to connect to the hsapiens dataset:

 > mart <- biomaRt::useMart(biomart = "ENSEMBL_MART_ENSEMBL",
 +                          dataset = "hsapiens_gene_ensembl",
 +                          host = "www.ensembl.org")

This is the error message that appears in the console:

 Error in useDataset(mart = mart, dataset = dataset, verbose = verbose) : 
 The given dataset:  
 hsapiens_gene_ensembl , is not valid.  
 Correct dataset  names can be obtained with the listDatasets function.

I am confused as to why I am getting this error because it is saying that this dataset is an invalid dataset but I checked and it is indeed valid.

1 Answers1

3

You need to use the host = "http://www.ensembl.org" argument:

mart <- biomaRt::useMart(biomart = "ENSEMBL_MART_ENSEMBL",
                         dataset = "hsapiens_gene_ensembl",
                         host = "http://www.ensembl.org")

str(mart)
#     Formal class 'Mart' [package "biomaRt"] with 8 slots
#   ..@ biomart   : chr "ENSEMBL_MART_ENSEMBL"
#   ..@ host      : chr "http://www.ensembl.org:80/biomart/martservice"
#   ..@ vschema   : chr "default"
#   ..@ version   : chr(0) 
#   ..@ dataset   : chr "hsapiens_gene_ensembl"
# ... 
Marco Sandri
  • 23,289
  • 7
  • 54
  • 58
  • Thank you! It seemed to work itself out. Sometimes it will work and sometimes not. I also found that it has recently been working most of the time after I have updated R and Rstudio. – ScottSchumacker Jan 02 '18 at 19:54