Skip to content

Commit

Permalink
get rid of vroom for the moment
Browse files Browse the repository at this point in the history
  • Loading branch information
lgeistlinger committed Oct 28, 2023
1 parent ec37664 commit fed15c2
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 12 deletions.
3 changes: 1 addition & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Package: bugsigdbr
Version: 1.8.0
Version: 1.8.1
Title: R-side access to published microbial signatures from BugSigDB
Authors@R: c(
person(given = "Ludwig",
Expand All @@ -26,7 +26,6 @@ Depends: R (>= 4.1)
Imports:
BiocFileCache,
methods,
vroom,
utils
Suggests:
BiocStyle,
Expand Down
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ export(subsetByOntology)
export(writeGMT)
importFrom(methods,is)
importFrom(utils,browseURL)
importFrom(utils,read.csv)
importFrom(utils,relist)
12 changes: 7 additions & 5 deletions R/bugsigdb.R
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
#'
#' df <- importBugSigDB()
#'
#' @importFrom utils read.csv
#' @export
importBugSigDB <- function(version = "10.5281/zenodo.6468009", cache = TRUE)
{
Expand Down Expand Up @@ -82,11 +83,12 @@ importBugSigDB <- function(version = "10.5281/zenodo.6468009", cache = TRUE)

.getdf <- function(from, to)
{
dat <- suppressWarnings(vroom::vroom(from, skip = 1L,
altrep = FALSE,
progress = FALSE,
show_col_types = FALSE))
dat <- as.data.frame(dat)
# dat <- suppressWarnings(vroom::vroom(from, skip = 1L,
# altrep = FALSE,
# progress = FALSE,
# show_col_types = FALSE))
# dat <- as.data.frame(dat)
dat <- read.csv(from, skip = 1, check.names = FALSE)
dat[["MetaPhlAn taxon names"]] <- strsplit(dat[["MetaPhlAn taxon names"]], ",")
dat[["NCBI Taxonomy IDs"]] <- strsplit(dat[["NCBI Taxonomy IDs"]], ";")

Expand Down
5 changes: 3 additions & 2 deletions R/getSignatures.R
Original file line number Diff line number Diff line change
Expand Up @@ -491,8 +491,9 @@ writeGMT <- function(sigs, gmt.file, ...) {
mic_int = "microbiome_int",
env = "environment")
ma.url <- paste0(ma.url, lib, ".csv")
cont <- vroom::vroom(ma.url)
cont <- as.data.frame(cont)
#cont <- vroom::vroom(ma.url)
#cont <- as.data.frame(cont)
cont <- read.csv(ma.url, check.names = FALSE)
rel.cols <- c("name", "member", "abund_change")
cont <- cont[, rel.cols]

Expand Down
7 changes: 4 additions & 3 deletions tests/testthat/test-importBugSigDB.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ checkImport <- function(bsdb, url)
expect_gt(ncol(bsdb), 40)
expect_true(all(c("Study", "Study design", "PMID") %in% colnames(bsdb)[1:4]))

dat <- suppressWarnings(vroom::vroom(url, skip = 1L, progress = FALSE,
show_col_types = FALSE))
dat <- as.data.frame(dat)
#dat <- suppressWarnings(vroom::vroom(url, skip = 1L, progress = FALSE,
# show_col_types = FALSE))
#dat <- as.data.frame(dat)
dat <- read.csv(url, skip = 1, check.names = FALSE)
dat[["MetaPhlAn taxon names"]] <- strsplit(dat[["MetaPhlAn taxon names"]],
",")
dat[["NCBI Taxonomy IDs"]] <- strsplit(dat[["NCBI Taxonomy IDs"]], ";")
Expand Down

0 comments on commit fed15c2

Please sign in to comment.