ktrns / scrnaseq

Workflow for single-cell RNA-seq analysis using Seurat
MIT License
37 stars 15 forks source link

Check online ressources at the start #25

Closed andpet0101 closed 4 years ago

andpet0101 commented 4 years ago

Check online ressources at the beginning of the script and fail if a ressource is not available

ktrns commented 4 years ago

Any idea how to do this? E.g. for enrichR?

ktrns commented 4 years ago

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.

https://github.com/wjawaid/enrichR/issues/25

tglomb commented 4 years ago

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()
andpet0101 commented 4 years ago

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

ktrns commented 4 years ago

@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?

ktrns commented 4 years ago

Solved with PR #34