neurogenomics / HPOExplorer

Functions for working with the Human Phenotype Ontology data
https://neurogenomics.github.io/HPOExplorer/
4 stars 1 forks source link

` SSL certificate problem: unable to get local issuer certificate` #15

Closed bschilder closed 3 years ago

bschilder commented 3 years ago

Might be an issue specific to my Linux-based Docker container, but i when i run this code in the main HPOExplorer vignette:

phenos = data.frame()
for (p in unique(Neuro_delay_descendants$Phenotype)) {
  id <- get_hpo_termID(p, phenotype_to_genes)
  ontLvl_geneCount_ratio <- (get_ont_level(hpo,p) + 1)/length(get_gene_list(p,phenotype_to_genes))
  description <- get_term_definition(id, line_length = 10)
  phenos <- rbind(phenos,
                  data.frame("Phenotype"=p,
                             "HPO_Id"=id,
                             "ontLvl_geneCount_ratio"=ontLvl_geneCount_ratio,
                             "description"=description))

I get the error:

Error in curl::curl_fetch_memory(url, handle = handle) : 
  SSL certificate problem: unable to get local issuer certificate
bschilder commented 3 years ago

Found a solution here.

Added a tryCatch within get_term_definition to handle this:

 hpo_termdetails <- tryCatch(expr = {
        httr::GET(paste0("hpo.jax.org/api/hpo/term/",
                         ontologyId))

    },
    error = function(e){
        httr::set_config(httr::config(ssl_verifypeer = FALSE))
        httr::GET(paste0("hpo.jax.org/api/hpo/term/",
                         ontologyId))
    })