@@ -592,6 +592,38 @@ test_that("read_chroms can read 'Shimadzu' PDA files (ASCII and LCD)", {
592
592
round(attr(x2 , " time_range" ), 3 ))
593
593
})
594
594
595
+ test_that(" Shimadzu Anthocyanin peak tables match" , {
596
+ skip_on_cran()
597
+ skip_if_not_installed(" chromConverterExtraTests" )
598
+
599
+ path_ascii <- system.file(" shimadzuDAD_Anthocyanin.txt" ,
600
+ package = " chromConverterExtraTests" )
601
+ skip_if_not(file.exists(path_ascii ))
602
+
603
+ path_lcd <- system.file(" Anthocyanin.lcd" ,
604
+ package = " chromConverterExtraTests" )
605
+ skip_if_not(file.exists(path_lcd ))
606
+
607
+ x <- read_peaklist(path_ascii , format_in = " shimadzu_dad" ,
608
+ data_format = " original" ,
609
+ progress_bar = FALSE )[[1 ]]
610
+
611
+ x1 <- read_shimadzu_lcd(path_lcd , what = " peak_table" )
612
+ x1 <- read_peaklist(path_lcd , format_in = " shimadzu_lcd" , progress_bar = FALSE )[[1 ]]
613
+
614
+ expect_equal(x [[1 ]][,c(3 ,6 : 7 ,4 : 5 ,8 : 9 ,11 ,13 : 18 ,21 : 22 )],x1 [[1 ]][,- 1 ], tolerance = .001 ,
615
+ ignore_attr = TRUE )
616
+ expect_equal(x [[2 ]][,c(3 ,6 : 7 ,4 : 5 ,8 : 9 ,11 ,13 : 18 ,21 : 22 )],x1 [[3 ]][,- 1 ], tolerance = .001 ,
617
+ ignore_attr = TRUE )
618
+ expect_equal(x [[3 ]][,c(3 ,6 : 7 ,4 : 5 ,8 : 9 ,11 ,13 : 18 ,21 : 22 )],x1 [[4 ]][,- 1 ], tolerance = .001 ,
619
+ ignore_attr = TRUE )
620
+ expect_equal(x [[4 ]][,c(3 ,6 : 7 ,4 : 5 ,8 : 9 ,11 ,13 : 18 ,21 : 22 )],x1 [[5 ]][,- 1 ], tolerance = .001 ,
621
+ ignore_attr = TRUE )
622
+ expect_equal(x [[5 ]][,c(3 ,6 : 7 ,4 : 5 ,8 : 9 ,11 ,13 : 18 ,21 : 22 )],x1 [[6 ]][,- 1 ], tolerance = .001 ,
623
+ ignore_attr = TRUE )
624
+ })
625
+
626
+
595
627
test_that(" read_chroms can read 2D chromatograms from 'Shimadzu' LCD files" , {
596
628
skip_on_cran()
597
629
skip_if_not_installed(" chromConverterExtraTests" )
@@ -729,6 +761,36 @@ test_that("read_chroms can read multi-channel chromatograms from 'Shimadzu' LCD
729
761
expect_equal(x2 [x2 $ lambda == " " , " intensity" ], x [[" B" ]], ignore_attr = TRUE )
730
762
})
731
763
764
+ test_that(" Shimadzu multichannel peak tables match" , {
765
+ skip_on_cran()
766
+ skip_if_not_installed(" chromConverterExtraTests" )
767
+
768
+ path_asc <- system.file(" multichannel_chrom.txt" ,
769
+ package = " chromConverterExtraTests" )
770
+
771
+ skip_if_not(file.exists(path_asc ))
772
+
773
+ path_lcd <- system.file(" multichannel_chrom.lcd" ,
774
+ package = " chromConverterExtraTests" )
775
+ skip_if_not(file.exists(path_lcd ))
776
+
777
+ x <- read_peaklist(path_asc , format_in = " shimadzu_dad" ,
778
+ data_format = " original" ,
779
+ progress_bar = FALSE )[[1 ]]
780
+
781
+ x1 <- read_peaklist(path_lcd , format_in = " shimadzu_lcd" ,
782
+ progress_bar = FALSE )[[1 ]]
783
+
784
+
785
+ expect_equal(x [[1 ]][,c(3 ,6 : 7 ,4 : 5 ,8 : 9 ,11 ,13 : 18 ,21 : 22 )],x1 [[1 ]][,- 1 ], tolerance = .01 ,
786
+ ignore_attr = TRUE )
787
+ expect_equal(x [[2 ]][,c(3 ,6 : 7 ,4 : 5 ,8 : 9 ,11 ,13 : 18 ,21 : 22 )],x1 [[2 ]][,- 1 ], tolerance = .001 ,
788
+ ignore_attr = TRUE )
789
+ expect_equal(x [[3 ]][,c(3 ,6 : 7 ,4 : 5 ,8 : 9 ,11 ,13 : 18 ,21 : 22 )],x1 [[3 ]][,- 1 ], tolerance = .001 ,
790
+ ignore_attr = TRUE )
791
+ })
792
+
793
+
732
794
test_that(" read_chroms can read 'Agilent' .dx files" , {
733
795
skip_on_cran()
734
796
skip_if_not_installed(" chromConverterExtraTests" )
@@ -874,6 +936,26 @@ test_that("Shimadzu GCD parser works", {
874
936
expect_equal(as.numeric(attr(txt , " time_range" )), round(attr(x , " time_range" ), 3 ))
875
937
})
876
938
939
+ test_that(" Shimadzu FID peak tables match" , {
940
+ skip_on_cran()
941
+ skip_if_not_installed(" chromConverterExtraTests" )
942
+
943
+ path_asc <- test_path(" testdata/ladder.txt" )
944
+
945
+ path_gcd <- system.file(" FS19_214.gcd" , package = " chromConverterExtraTests" )
946
+ skip_if_not(file.exists(path_gcd ))
947
+
948
+ x <- read_peaklist(path_asc , format_in = " shimadzu_dad" ,
949
+ data_format = " original" ,
950
+ progress_bar = FALSE )[[1 ]]
951
+
952
+ x1 <- read_peaklist(path_gcd , format_in = " shimadzu_gcd" , progress_bar = FALSE )
953
+
954
+ expect_equal(x [,c(3 ,6 : 7 ,4 : 5 ,8 : 9 ,11 ,13 : 18 ,21 : 22 )], x1 [[1 ]][,- 1 ], tolerance = .001 ,
955
+ ignore_attr = TRUE )
956
+ })
957
+
958
+
877
959
test_that(" Shimadzu QGD parser works" , {
878
960
skip_on_cran()
879
961
skip_if_missing_dependencies()
0 commit comments