Skip to content

Commit

Permalink
added missing argument output_dir to export_matches call
Browse files Browse the repository at this point in the history
removed some debug lines, attempting to load default .RDS files from inst/extdata

once again trying to get .rds files to be used

debug line
  • Loading branch information
calstevemart committed Sep 28, 2022
1 parent c3eaa2c commit fefcd41
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
14 changes: 7 additions & 7 deletions R/hurricane.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
#' 4] visualisation [in progress in upstream repository]
#' Also saves to RDS outputs from statistical decomposition
#' A default params.yaml file will be used if none is supplied.
#' The params file looks like this:
#'
#' @param params_loc location of the params.yaml file containing
#' pipeline run parameters.
#' @return N/A but .RDS and .TSV files are saved, see description.
Expand All @@ -26,7 +28,8 @@ hurricane <- function(params_loc) {
# it may be that a user supplies their own params file but it
# is not complete. What do we do then? Fill in any missing fields
# with the corresponding values from default params?
if (default == TRUE) {
if (isTRUE(default)) {
message("hit the if block")
peaks_path <- system.file(
"extdata", "peaks.RDS", package="ImperialNMRTool")
spec_path <- system.file(
Expand All @@ -35,11 +38,7 @@ hurricane <- function(params_loc) {
"extdata", "hmdb_spectra_28FEB2022.RDS", package="ImperialNMRTool")

peaks <- readRDS(peaks_path)
# spec <- readRDS(spec_path)
spec <- readRDS("inst/extdata/spec.RDS")
if (is.null(spec)) {
message("it was null")
}
spec <- readRDS(spec_path)
refdb <- readRDS(refdb_path)
} else {
peaks <- readRDS(run_params$general_pars$peaks_location)
Expand Down Expand Up @@ -70,6 +69,7 @@ hurricane <- function(params_loc) {
exportMatches(
matches = matches,
X = spec,
rankLimit = run_params$am_pars$rank_limit)
rankLimit = run_params$am_pars$rank_limit,
output_dir = run_params$general_pars$output_dir)

}
1 change: 0 additions & 1 deletion R/stat_decomp.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ stat_decomp <- function(peaks, spec, params) {

# Do the STOCSY deconvolution
message("\nRunning STOCSY on all provided peaks...")
message(stringr::str_c("hello", paste(nrow(spec))))
target <- pbapply::pblapply(
peaks, function(x) stocsydec(spec, x, params$sd_pars$cutoff)
)
Expand Down

0 comments on commit fefcd41

Please sign in to comment.