inst/unitTests/test_utils.R

test_hasChromatograms <- function() {
    fl <- system.file("proteomics/MRM-standmix-5.mzML.gz", package = "msdata")
    x <- mzR::openMSfile(fl, backend = "pwiz")
    checkTrue(mzR:::.hasChromatograms(x))
    checkTrue(mzR:::.hasChromatograms(fl))
    close(x)
    
    fl <- system.file("cdf/ko15.CDF", package = "msdata")
    x <- openMSfile(fl, backend = "netCDF")        
    suppressWarnings(checkTrue(!mzR:::.hasChromatograms(x)))
    suppressWarnings(checkTrue(!mzR:::.hasChromatograms(fl)))
    close(x)

    fl <- system.file("sciex/20171016_POOL_POS_1_105-134.mzML",
                      package = "msdata")
    x <- mzR::openMSfile(fl, backend = "pwiz")
    checkTrue(!mzR:::.hasChromatograms(x))
    checkTrue(!mzR:::.hasChromatograms(fl))
    close(x)
}

Try the mzR package in your browser

Any scripts or data that you put into this service are public.

mzR documentation built on Nov. 20, 2020, 2 a.m.