@@ -17,16 +17,37 @@ test_chromatograms2 <- function() {
1717 f <- proteomics(full.names = TRUE ,
1818 pattern = " TMT_Erwinia_1uLSike_Top10HCD_isol2_45stepped_60min_01.mzML.gz" )
1919 x <- openMSfile(f , backend = " pwiz" )
20- checkIdentical(nChrom(x ), 1L )
20+ checkIdentical(nChrom(x ), 1L )
2121 checkIdentical(tic(x ), chromatogram(x , 1L ))
2222 checkIdentical(nrow(tic(x )), 7534L )
2323}
2424
25+ test_individual_chromatogramHeader <- function () {
26+ f <- proteomics(full.names = TRUE , pattern = " MRM" )
27+ x <- openMSfile(f , backend = " pwiz" )
28+ tic <- chromatogramHeader(x , 1 )
29+ tic1 <- chromatogramHeader(x , 1 : 1 )
30+ ch <- chromatogramHeader(x , 2 )
31+ checkEquals(colnames(ch ), c(" chromatogramId" , " chromatogramIndex" , " polarity" ,
32+ " precursorIsolationWindowTargetMZ" ,
33+ " precursorIsolationWindowLowerOffset" ,
34+ " precursorIsolationWindowUpperOffset" ,
35+ " precursorCollisionEnergy" ,
36+ " productIsolationWindowTargetMZ" ,
37+ " productIsolationWindowLowerOffset" ,
38+ " productIsolationWindowUpperOffset" ))
39+ checkEquals(tic $ chromatogramId , " TIC" )
40+ checkEquals(sum(is.na(ch $ precursorIsolationWindowTargetMZ )), 1 )
41+ checkEquals(sum(is.na(ch $ productIsolationWindowTargetMZ )), 1 )
42+ checkEquals(nrow(ch ), 1 )
43+ close(x )
44+ }
45+
2546test_chromatogramHeader <- function () {
2647 library(mzR )
2748 library(RUnit )
2849 library(msdata )
29-
50+
3051 f <- proteomics(full.names = TRUE , pattern = " MRM" )
3152 x <- openMSfile(f )
3253
@@ -42,7 +63,7 @@ test_chromatogramHeader <- function() {
4263 " productIsolationWindowUpperOffset" ))
4364 checkEquals(ch $ chromatogramId [1 ], " TIC" )
4465 checkEquals(sum(is.na(ch $ precursorIsolationWindowTargetMZ )), 1 )
45- checkEquals(sum(is.na(ch $ productIsolationWindowTargetMZ )), 1 )
66+ checkEquals(sum(is.na(ch $ productIsolationWindowTargetMZ )), 1 )
4667 checkEquals(length(chrs ), nrow(ch ))
4768 close(x )
4869
0 commit comments