Skip to content

Commit

Permalink
fix: automatic file detection for directories
Browse files Browse the repository at this point in the history
  • Loading branch information
ethanbass committed Nov 14, 2024
1 parent 767f867 commit b5affc9
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: chromConverter
Title: Chromatographic File Converter
Version: 0.7.0
Version: 0.7.1
Authors@R: c(
person(given = "Ethan", family = "Bass", email = "[email protected]",
role = c("aut", "cre"),
Expand Down
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## chromConverter 0.7.1

* Fix automatic file detection for directories (e.g., Waters `.raw` and Agilent `.D`)

## chromConverter 0.7.0

### Major features
Expand Down
3 changes: 2 additions & 1 deletion R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,8 @@ format_to_extension <- function(format_in){
#' @noRd
find_files <- function(paths, pattern){
files <- unlist(lapply(paths, function(path){
files <- list.files(path = path, pattern = pattern,
dirs <- ifelse(pattern %in% c("\\.raw$", "\\.d$"), TRUE, FALSE)
files <- list.files(path = path, pattern = pattern, include.dirs = dirs,
full.names = TRUE, recursive = TRUE, ignore.case = TRUE)
if (length(files)==0){
if (!dir.exists(path)){
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ Thermo RAW files can be converted by calling the [ThermoRawFileParser](https://g

[OpenChrom](https://lablicate.com/platform/openchrom) is open source chromatography software, containing a large number of file parsers, which can now be conveniently accessed directly from R. Strangely, configuring OpenChrom for use on the command-line deactivates the graphical user interface (GUI). Thus, it is recommended to make a separate copy of OpenChrom if you'd still like to access the GUI. To use the OpenChrom parsers, follow the steps detailed below:

1) Download [OpenChrom](https://lablicate.com/platform/openchrom/download) (**version 1.4.x only**) and place it into a directory of your choice.
1) Download [OpenChrom](https://lablicate.com/platform/openchrom/download) (**version 1.4**) and place it into a directory of your choice.
2) If you intend to use the GUI in the future, it is recommended to make a separate copy of OpenChrom for command-line use.
3) Call `read_chroms` with `parser = "openchrom"`. The first time you call the parser, you may be asked to provide the path to your local installation of OpenChrom. The path will then be saved for future use. If the command-line interface is disabled, you will be given the option to automatically activate the command-line. Alternatively, the command-line option can be activated from R by calling `configure_openchrom(cli = "true")` or following the [instructions](https://github.com/OpenChrom/openchrom/wiki/CLI) to manually activate the CLI. This process can be reversed using the same function: e.g. `configure_openchrom(cli = "false"). To specify an OpenChrom executable in a non-standard location, call `configure_openchrom` with the `path` argument, e.g. `configure_openchrom(cli = "true", path = "path_to_openchrom_executable").

Expand Down
2 changes: 1 addition & 1 deletion inst/CITATION
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ bibentry(
title = "chromConverter: Chromatographic File Converter",
author = "Ethan Bass",
year = "2024",
version = "version 0.7.0",
version = "version 0.7.1",
doi = "10.5281/zenodo.6792521",
url = "https://ethanbass.github.io/chromConverter/",
textVersion = paste("Bass, E. (2024).",
Expand Down

0 comments on commit b5affc9

Please sign in to comment.