Closed andpet0101 closed 4 years ago
Any idea how to do this? E.g. for enrichR?
With regard to enrichR: it tests whether the website is online when we load the package:
> library(enrichR)
Welcome to enrichR
Checking connection ... EnrichR website not responding
It doesn't seem to throw an error though, just the message.
Somewhere in the script you have
dbs.all = listEnrichrDbs()
You could put this to the connection test chunk and use it as follows:
dbs.all = listEnrichrDbs()
if(is.null(dbs.all)) stopScripExecution()
For ensembl, I would suggest that we provide a list of mirror names and then use try catch to loop
foreach(m in c("www", "asia", "northwest") {
try({
annot_mart = biomaRt::useEnsembl("ensembl", dataset=param$mart_dataset, mirror=m)
annot_ensembl = biomaRt::getBM(mart=annot_mart, attributes=mart_attributes)
})
if(nrow(annot_ensembl)>0) last
}
This would help if one mirror is not available
@andpet0101 Yes, we should do this.
Initially you suggested to test right in the beginning whether online resources are there. Are you aware of a simple test for Ensembl, or do you consider the chunk read_annotation
still beginning?
Solved with PR #34
Check online ressources at the beginning of the script and fail if a ressource is not available