Skip to content

Commit

Permalink
fixes #95
Browse files Browse the repository at this point in the history
  • Loading branch information
xec-cm committed Sep 19, 2023
1 parent 9d4dd21 commit 1b3cbbe
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
3 changes: 2 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ Imports:
stringr,
tibble,
tidyr,
UpSetR
UpSetR,
waldo
Depends:
R (>= 4.2.0)
LazyData: false
Expand Down
8 changes: 7 additions & 1 deletion R/misc.R
Original file line number Diff line number Diff line change
Expand Up @@ -224,8 +224,14 @@ dot <- function() {
#' ## Export to json file
#' export_steps(rec, tempfile(fileext = ".json"))
export_steps <- function(rec, file_name) {

inp <- rec@steps
if (is(rec, "prep_recipe")) {
inp <- c(rec@steps, rec@bakes)
}

to_cat <-
c(rec@steps, rec@bakes) %>%
inp %>%
purrr::map_chr(~ {
params <-
names(.x) %>%
Expand Down
8 changes: 5 additions & 3 deletions R/read_data.R
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ read_data <- function(data_path) {

taxa_df <-
files %>%
purrr::discard(~ setequal(.x, counts_df)) %>%
purrr::discard(~ waldo::compare(.x, counts_df) %>% length() == 0) %>%
purrr::map_dfr(~ {
if (all(counts_df[[1]] %in% .x[[1]])) {
.x
Expand All @@ -71,8 +71,10 @@ read_data <- function(data_path) {

metadata_df <-
files %>%
purrr::discard(~ setequal(.x, counts_df) |
setequal(.x, taxa_df)) %>%
purrr::discard(
~ waldo::compare(.x, counts_df) %>% length() == 0 |
waldo::compare(.x, taxa_df) %>% length() == 0
) %>%
purrr::pluck(1) %>%
validate_sample_data()

Expand Down

0 comments on commit 1b3cbbe

Please sign in to comment.