Skip to content

Commit

Permalink
- in execute(), when cache does already exist, make it clean before e…
Browse files Browse the repository at this point in the history
…xecuting

the pipeline steps (= preventing inconsistent cache upon crash/forced
interruption)
- bumped version to 1.3.4
  • Loading branch information
phauchamps committed Feb 7, 2024
1 parent 7e53f9e commit 0fe9f1a
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: CytoPipeline
Title: Automation and visualization of flow cytometry data analysis pipelines
Version: 1.3.3
Version: 1.3.4
Authors@R:
c(person(given = "Philippe",
family = "Hauchamps",
Expand Down
5 changes: 5 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# CytoPipeline 1.3

## CytoPipeline 1.3.4
- in execute(), when cache does already exist, make it clean before executing
the pipeline steps (= preventing inconsistent cache upon crash/forced
interruption)

## CytoPipeline 1.3.3
- added `collectNbOfRetainedEvents()` function

Expand Down
18 changes: 18 additions & 0 deletions R/CytoPipeline-functions.R
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,20 @@ showProcessingSteps <- function(x,
}
}

# internal function to remove ill-defined bfc entries ("type" col is NA)
# which could have been generated when a previous pipeline run
# either crashed or was manually forced to stop in the middle of a step
makeBFCClean <- function(bfc){
cacheInfo <- BiocFileCache::bfcinfo(bfc)
if (nrow(cacheInfo) > 0) {
toRemoveRids <- cacheInfo[is.na(cacheInfo$type),"rid"]
if (nrow(toRemoveRids) > 0) {
bfc <- BiocFileCache::bfcremove(bfc, toRemoveRids)
}
}
invisible(bfc)
}


#' @title executing CytoPipeline object
#' @description this function triggers the execution of the processing queues of
Expand Down Expand Up @@ -619,6 +633,10 @@ execute <- function(x,
bfc <- BiocFileCache::BiocFileCache(localCacheDir, ask = FALSE)
}
}

# for robustness-sake, clean bfc from potentially interrupted previous run
# (crash/manually forced interruption)
bfc <- makeBFCClean(bfc)

# checking consistency between to-be-run processing steps and cache
res <- checkCytoPipelineConsistencyWithCache(x, path = path)
Expand Down

0 comments on commit 0fe9f1a

Please sign in to comment.