grimbough / biomaRt

R package providing query functionality to BioMart instances like Ensembl
https://bioconductor.org/packages/biomaRt/
32 stars 13 forks source link

`.listMarts` not working when host argument changes #64

Closed LiNk-NY closed 2 years ago

LiNk-NY commented 2 years ago

Hi Mike, @grimbough

I'm getting an error in GenomicFeatures because the example is using useEnsembl with a different host argument.

Internally, the .listMarts function returns this cached data:

               biomart                version
1 ENSEMBL_MART_ENSEMBL      Ensembl Genes 106
2   ENSEMBL_MART_MOUSE      Mouse strains 106
3     ENSEMBL_MART_SNP  Ensembl Variation 106
4 ENSEMBL_MART_FUNCGEN Ensembl Regulation 106

when the input is:

useEnsembl(biomart="fungi_mart", host="https://fungi.ensembl.org")

leading to the error:

Error in useEnsembl(biomart = "fungi_mart", host = "https://fungi.ensembl.org") : 
  Incorrect BioMart name, use the listMarts function to see which BioMart databases are available

It should either add to the cache or find that there is no cached data based on the host (or not cache at all when the host input changes).

packageVersion("biomaRt")
[1] '2.53.1'

Best regards, Marcel

grimbough commented 2 years ago

Thanks for the report. I didn't check this behaviour because I would use useEnsemblGenomes() to connect to the fungi mart e.g. useEnsemblGenomes(biomart = "fungi_mart"). That should still work, but I'll tidy this up so the alternative host approach works again.

LiNk-NY commented 2 years ago

Ah thanks for the tip! I'll switch to that one.

Update: Some of the code in the examples for GenomicFeatures can be adapted to use useEnsemblGenomes but in functions such as makeTxDbFromBiomart, it would be better to have .listMarts be flexible to alternative host arguments.

Best, Marcel

grimbough commented 2 years ago

Hopefully this is fixed in version 2.53.2

library(biomaRt)
packageVersion("biomaRt")
#> [1] '2.53.2'
useEnsembl(biomart="fungi_mart", host="https://fungi.ensembl.org")
#> Object of class 'Mart':
#>   Using the fungi_mart BioMart database
#>   No dataset selected.