diff --git a/inst/NEWS.Rd b/inst/NEWS.Rd index b2c881d..1bf1bb4 100644 --- a/inst/NEWS.Rd +++ b/inst/NEWS.Rd @@ -3,6 +3,13 @@ \newcommand{\ghit}{\href{https://github.com/fgcz/rawrr/issues/#1}{##1}} +\section{Changes in version 1.11 (2023-11-01)}{ + \itemize{ + \item Fix index error \ghit{67}. + } +} + + \section{Changes in version 1.9.2 (2023-10-24)}{ \itemize{ \item Download RawFileReader DLL’s from \url{https://github.com/thermofisherlsms/RawFileReader} \ghit{66}. diff --git a/inst/rawrrassembly/rawrr.cs b/inst/rawrrassembly/rawrr.cs index f6cbfb8..945414a 100644 --- a/inst/rawrrassembly/rawrr.cs +++ b/inst/rawrrassembly/rawrr.cs @@ -373,7 +373,7 @@ public static void WriteTrailerValues(this IRawDataPlus rawFile, string label) return; } - for (int scanNumber = rawFile.RunHeaderEx.FirstSpectrum; scanNumber < rawFile.RunHeaderEx.LastSpectrum; scanNumber++) + foreach (int scanNumber in Enumerable.Range(rawFile.RunHeaderEx.FirstSpectrum, rawFile.RunHeaderEx.LastSpectrum)) { var scanTrailer = rawFile.GetTrailerExtraInformation(scanNumber); Console.WriteLine(scanTrailer.Values.ToArray()[idx]); diff --git a/tests/testthat/test-index.R b/tests/testthat/test-index.R index 04da4f3..0024806 100644 --- a/tests/testthat/test-index.R +++ b/tests/testthat/test-index.R @@ -9,7 +9,7 @@ test_that("check readIndex.", { rawrr::readIndex() |> rawrr::validate_rawrrIndex() - expect_equivalent(dim(x) == c(573, 9), + expect_equivalent(dim(x) == c(574, 9), c(TRUE, TRUE)) expect_true(is.data.frame(x)) IndexColNames <- c("scan", "scanType", "StartTime", "precursorMass",