From ddba1e67e158c9bdb19d55c9509ed42c4bb6c0fb Mon Sep 17 00:00:00 2001 From: chainsawriot Date: Thu, 23 Feb 2023 13:46:09 +0100 Subject: [PATCH] Get alpackages --- R/memo_misc.R | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/R/memo_misc.R b/R/memo_misc.R index f099a88..ac71391 100644 --- a/R/memo_misc.R +++ b/R/memo_misc.R @@ -34,10 +34,20 @@ NULL if (bioc_version != "release" && utils::compareVersion(bioc_version, "2.0") == -1) { stop("Bioconductor versions < 2.0 are not supported.", call. = FALSE) } - con <- url(paste0("http://bioconductor.org/packages/", bioc_version, "/bioc/VIEWS")) - pkgs <- read.dcf(con) - close(con) - as.data.frame(pkgs) + suffixes <- c("bioc", "data/annotation", "data/experiment", "workflow") + output <- data.frame() + for (suffix in suffixes) { + tryCatch({ + con <- url(paste0("http://bioconductor.org/packages/", bioc_version, "/", suffix, "/VIEWS")) + on.exit(close(con)) + raw_bioc_pkgs_metadata <- suppressWarnings(read.dcf(con)) + bioc_pkgs_metadata <- as.data.frame(raw_bioc_pkgs_metadata)[, c("Package", "Version", "Depends","LinkingTo","Imports","Suggests","Enhances")] + output <- rbind(output, bioc_pkgs_metadata) + }, error = function(e) { + #pass + }) + } + output } .memo_search_bioc <- memoise::memoise(.bioc_package_history, cache = cachem::cache_mem(max_age = 60 * 60))