diff --git a/R/read_mzml.R b/R/read_mzml.R index 004df4e..934c8d5 100644 --- a/R/read_mzml.R +++ b/R/read_mzml.R @@ -26,8 +26,8 @@ read_mzml <- function(path, format_out = c("matrix", "data.frame"), data_format = c("long","wide"), - parser=c("RaMS","mzR"), - what=c("MS1","MS2", "BPC", "TIC", "DAD", + parser = c("RaMS","mzR"), + what = c("MS1","MS2", "BPC", "TIC", "DAD", "chroms", "metadata", "everything"), verbose = FALSE, ...){ @@ -35,10 +35,11 @@ read_mzml <- function(path, format_out = c("matrix", "data.frame"), format_out <- match.arg(format_out, c("matrix", "data.frame")) data_format <- match.arg(data_format, c("long","wide")) what <- match.arg(what, c("MS1","MS2", "BPC", "TIC", "DAD", - "chroms", "metadata", "everything"), several.ok = TRUE) + "chroms", "metadata", "everything"), + several.ok = TRUE) if (all(c("MS1","MS2", "BPC", "TIC", "DAD", "chroms", "metadata", "everything") %in% what)){ - what <- grep("everything",what, invert = TRUE,value = TRUE) + what <- grep("everything", what, invert = TRUE, value = TRUE) } if (parser == "RaMS"){ data <- RaMS::grabMSdata(path, grab_what = what, verbosity = verbose, ...) diff --git a/R/read_thermoraw.R b/R/read_thermoraw.R index 4112dc9..5d87d3f 100644 --- a/R/read_thermoraw.R +++ b/R/read_thermoraw.R @@ -103,20 +103,23 @@ configure_thermo_parser <- function(reconfigure = FALSE, check = FALSE){ exists <- file.exists(path_parser) if (!exists & !check){ warning("ThermoRawFileParser not found!", immediate. = TRUE) - path_parser <- readline(prompt="Please provide path to `ThermoRawFileParser.exe`):") + path_parser <- readline(prompt = "Please provide path to `ThermoRawFileParser.exe`):") path_parser <- gsub("/", "\\\\", path_parser) - writeLines(path_parser, con=system.file('shell/path_parser.txt', package='chromConverter')) + writeLines(path_parser, con = system.file('shell/path_parser.txt', + package = 'chromConverter')) } } else { - shell_script <- readLines(system.file('shell/thermofileparser.sh', package='chromConverter')) + shell_script <- readLines(system.file('shell/thermofileparser.sh', + package = 'chromConverter')) path_parser <- strsplit(shell_script[2]," ")[[1]] path_parser <- path_parser[grep(".exe", path_parser)] exists <- file.exists(path_parser) if (!exists & !check){ warning("ThermoRawFileParser not found!", immediate. = TRUE) - path_parser <- readline(prompt="Please provide path to `ThermoRawFileParser.exe`):") + path_parser <- readline(prompt = "Please provide path to `ThermoRawFileParser.exe`):") shell_script[2] <- paste0("mono ", path_parser, ' "$@"') - writeLines(shell_script, con = system.file('shell/thermofileparser.sh', package='chromConverter')) + writeLines(shell_script, con = system.file('shell/thermofileparser.sh', + package = 'chromConverter')) } } if (check){