diff --git a/DESCRIPTION b/DESCRIPTION index 617bea9..5c3fed9 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: chromConverter Title: Chromatographic File Converter -Version: 0.4.2 +Version: 0.4.3 Authors@R: c( person(given = "Ethan", family = "Bass", email = "ethanbass@gmail.com", role = c("aut", "cre"), diff --git a/NEWS.md b/NEWS.md index 24966c8..9873bc1 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,6 +1,10 @@ +## chromConverter 0.4.3 + +* Fixed bug in `chemstation_ch` parser ([#17](https://github.com/ethanbass/chromConverter/issues/17)) + ## chromConverter 0.4.2 -Added support for parsing "Waters" ascii (`.arw`) PDA files. +* Added support for parsing "Waters" ascii (`.arw`) PDA files. ## chromConverter 0.4.1 diff --git a/R/read_chemstation_ch.R b/R/read_chemstation_ch.R index 57443c4..e75ee85 100644 --- a/R/read_chemstation_ch.R +++ b/R/read_chemstation_ch.R @@ -58,6 +58,9 @@ read_chemstation_ch <- function(path, format_out = c("matrix","data.frame"), seek(f, offsets$intercept, "start") intercept <- readBin(f, "double", n = 1, endian = "big", size = 8) + if (is.na(intercept)){ + intercept <- 0 + } seek(f, offsets$scaling_factor, "start") scaling_factor <- readBin(f, "double", n = 1, endian = "big", size = 8) diff --git a/inst/CITATION b/inst/CITATION index e4ec4a8..88afb15 100644 --- a/inst/CITATION +++ b/inst/CITATION @@ -5,7 +5,7 @@ citEntry( title = "chromConverter: chromatographic file converter", author = "Ethan Bass", year = "2023", - version = "version 0.4.2", + version = "version 0.4.3", doi = "10.5281/zenodo.6792521", url = "https://ethanbass.github.io/chromConverter/", textVersion = paste("Bass, E. (2023).", diff --git a/man/sp_converter.Rd b/man/sp_converter.Rd index ad0789f..4109224 100644 --- a/man/sp_converter.Rd +++ b/man/sp_converter.Rd @@ -25,7 +25,8 @@ chromatogram.} A chromatogram in \code{data.frame} format (retention time x wavelength). } \description{ -Converts a single chromatogram from MassHunter \code{.sp} format to R \code{data.frame}. +Converts a single chromatogram from MassHunter \code{.sp} format to R +\code{data.frame}. } \details{ Uses the \href{https://github.com/bovee/aston}{Aston} file parser. diff --git a/man/uv_converter.Rd b/man/uv_converter.Rd index 1ec46f6..9062984 100644 --- a/man/uv_converter.Rd +++ b/man/uv_converter.Rd @@ -29,7 +29,8 @@ chromatogram.} A chromatogram in \code{data.frame} format (retention time x wavelength). } \description{ -Converts a single chromatogram from ChemStation \code{.uv} format to R \code{data.frame}. +Converts a single chromatogram from ChemStation \code{.uv} format to R +\code{data.frame}. } \details{ Uses the \href{https://github.com/bovee/aston}{Aston} file parser.