Skip to content

Commit

Permalink
style: whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
ethanbass committed Dec 25, 2023
1 parent 7885ccf commit 474effe
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
9 changes: 5 additions & 4 deletions R/read_mzml.R
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,20 @@

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,
...){
parser <- match.arg(parser, c("RaMS", "mzR"))
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, ...)
Expand Down
13 changes: 8 additions & 5 deletions R/read_thermoraw.R
Original file line number Diff line number Diff line change
Expand Up @@ -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){
Expand Down

0 comments on commit 474effe

Please sign in to comment.