@@ -218,7 +218,7 @@ test_that("read_chroms can write 'Agilent ChemStation' version 81 files to CDF",
218218
219219 xx <- read_chroms(fs :: path(path_out , " 5970_mix_10nG.cdf" ),
220220 progress_bar = FALSE )[[1 ]]
221- expect_equal(x , xx , ignore_attr = TRUE , tolerance = 1e-7 )
221+ expect_equal(x , xx , ignore_attr = TRUE , tolerance = 1e-7 )
222222 expect_equal(get_times(x ), get_times(xx ))
223223 fields <- c(" sample_name" , " detector" , " detector_id" , " detector_y_unit" ,
224224 " method" , " operator" , " time_interval" , " time_unit" , " run_datetime" )
@@ -628,7 +628,7 @@ test_that("read_chroms can read 'Agilent ACAML' files", {
628628 expect_s3_class(x2 , " tbl" )
629629})
630630
631- test_that(" read_agilent_amx works correctly" , {
631+ test_that(" read_agilent_amx works correctly, part 1 " , {
632632 skip_on_cran()
633633 skip_if_not_installed(" chromConverterExtraTests" )
634634 path <- system.file(" column_storage_ACN100.amx" ,
@@ -644,7 +644,11 @@ test_that("read_agilent_amx works correctly", {
644644 expect_equal(method1 $ dad $ peakwidth_nm , 4 )
645645 expect_equal(nrow(method1 $ pump $ gradient ), 0 )
646646 expect_equal(as.numeric(method1 $ metadata $ created ), 1767977263.0 )
647+ })
647648
649+ test_that(" read_agilent_amx works correctly, part 2" , {
650+ skip_on_cran()
651+ skip_if_not_installed(" chromConverterExtraTests" )
648652 path <- system.file(" Glucosinolates-XDB5.amx" ,
649653 package = " chromConverterExtraTests" )
650654 skip_if_not(file.exists(path ))
@@ -658,7 +662,7 @@ test_that("read_agilent_amx works correctly", {
658662 expect_equal(method2 $ dad $ peakwidth_nm , 4 )
659663 expect_equal(c(method2 $ dad $ spectra_from_nm , method2 $ dad $ spectra_to_nm ),
660664 c(190 ,400 ))
661- expect_shape(method2 $ pump $ gradient , dim = c(8 ,3 ))
665+ expect_shape(method2 $ pump $ gradient , dim = c(9 ,3 ))
662666 expect_equal(method2 $ column $ post_time_min , 6 )
663667 expect_equal(method2 $ column $ temp_controls $ temperature_C , c(40 , 40 ))
664668 expect_equal(method2 $ autosampler $ injection_volume_uL , 5 )
@@ -668,10 +672,34 @@ test_that("read_agilent_amx works correctly", {
668672 gradient_format = " long" )
669673 expect_s3_class(method_dt $ dad $ signals , " data.table" )
670674 expect_s3_class(method_dt $ pump $ gradient , " data.table" )
671- expect_shape(method_dt $ pump $ gradient , dim = c(16 , 3 ))
675+ expect_shape(method_dt $ pump $ gradient , dim = c(18 , 3 ))
672676
673677 method_tibble <- read_agilent_amx(path , format_out = " tibble" )
674678 expect_s3_class(method_tibble $ dad $ signals , " tbl" )
675679 expect_s3_class(method_tibble $ pump $ gradient , " tbl" )
676- expect_shape(method_tibble $ pump $ gradient , dim = c(8 ,3 ))
680+ expect_shape(method_tibble $ pump $ gradient , dim = c(9 , 3 ))
681+ })
682+
683+
684+ test_that(" read_agilent_amx works correctly, part 3" , {
685+ skip_on_cran()
686+ skip_if_not_installed(" chromConverterExtraTests" )
687+ path <- system.file(" flow_rate_example.amx" ,
688+ package = " chromConverterExtraTests" )
689+ skip_if_not(file.exists(path ))
690+ method3 <- read_agilent_amx(path )
691+ expect_equal(names(method3 $ metadata ),
692+ c(" method_name" , " version" , " status" , " created" , " created_by" ,
693+ " modified" , " modified_by" )
694+ )
695+ expect_equal(method3 $ dad $ peakwidth_nm , 4 )
696+ expect_equal(c(method3 $ dad $ spectra_from_nm , method3 $ dad $ spectra_to_nm ),
697+ c(190 ,400 ))
698+ expect_shape(method3 $ pump $ gradient , dim = c(10 ,4 ))
699+ expect_equal(method3 $ column $ post_time_min , 2.5 )
700+ expect_equal(method3 $ column $ temp_controls $ temperature_C , c(25 , 25 ))
701+ expect_equal(method3 $ autosampler $ injection_volume_uL , 1 )
702+ expect_equal(as.numeric(method3 $ metadata $ created ), 1779656802.0 )
703+ expect_equal(method3 $ pump $ gradient $ flow_mL_min ,
704+ c(0.4 ,0.5 ,0.5 ,0.5 ,0.55 ,0.55 ,0.6 ,0.6 ,0.7 ,0.7 ))
677705})
0 commit comments