Skip to content
Snippets Groups Projects
Unverified Commit b340de9a authored by Todor Kondic's avatar Todor Kondic
Browse files

Clearer error messages

* R/api.R(vrfy_conf): Clearer file.exist messages.
parent 94710796
No related branches found
No related tags found
No related merge requests found
...@@ -128,13 +128,13 @@ vrfy_conf <- function(conf) { ...@@ -128,13 +128,13 @@ vrfy_conf <- function(conf) {
all_sets<-unique(df_sets$set) all_sets<-unique(df_sets$set)
fn_data <- conf$data fn_data <- conf$data
assertthat::assert_that(file.exists(fn_data),msg=paste("Data table cannot be read:",fn_data)) assertthat::assert_that(file.exists(fn_data),msg=paste("Data table does not exist:",fn_data))
mzml <- file2tab(fn_data) mzml <- file2tab(fn_data)
no_files <- which(mzml[,!file.exists(Files)]) no_files <- which(mzml[,!file.exists(Files)])
no_modes <- which(mzml[,!(mode %in% names(MODEMAP))]) no_modes <- which(mzml[,!(mode %in% names(MODEMAP))])
no_sets <- which(mzml[,!(set %in% all_sets)]) no_sets <- which(mzml[,!(set %in% all_sets)])
assertthat::assert_that(length(no_files)==0,msg = paste("Unreadable data files at rows:",paste(no_files,collapse = ','), "of",fn_data)) assertthat::assert_that(length(no_files)==0,msg = paste("Non-existent data files at rows:",paste(no_files,collapse = ','), "of",fn_data))
assertthat::assert_that(length(no_modes)==0,msg = paste("Unrecognised modes at rows:",paste(no_modes,collapse = ','), "of", fn_data)) assertthat::assert_that(length(no_modes)==0,msg = paste("Unrecognised modes at rows:",paste(no_modes,collapse = ','), "of", fn_data))
assertthat::assert_that(length(no_sets)==0,msg = paste("Unknown sets at rows:",paste(no_sets,collapse = ','),"of", fn_data)) assertthat::assert_that(length(no_sets)==0,msg = paste("Unknown sets at rows:",paste(no_sets,collapse = ','),"of", fn_data))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment