tests/testthat/test_network.R

context("Network creation")

mzfile <- system.file("standards.mzXML", package = "cliqueMS")
library(xcms)
mzraw <- readMSData(files = mzfile, mode = "onDisk")
cpw <- CentWaveParam(ppm = 15, peakwidth = c(5,20), snthresh = 10)
mzData <- findChromPeaks(object = mzraw, param = cpw)
netlist = createNetwork(mzData, chromPeaks(mzData),
                        filter = TRUE)

test_that("Network is of class igraph", {
    expect_identical(class(netlist$network), "igraph")
})

test_that("Network has not any edge with weigth zero", {
    expect_equal(sum(igraph::E(netlist$network)$weight == 0), 0)
})

Try the cliqueMS package in your browser

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

cliqueMS documentation built on Nov. 8, 2020, 7:36 p.m.