inst/unitTests/runit.peaklist2picklist.R

test.p2pdimensions <- function() {
    ## Mock input data
    input <- cbind(mzmed=c(166.0861, 265.1192, 169.0354, 130.0504,
217.0969, 310.1289, 336.3274, 453.3422, 254.2491, 268.2646, 116.1077,
262.1803, 905.6864, 338.3425, 240.2331, 310.3103),

               mzmin=c(166.0843, 265.1088, 169.0341, 130.0485,
217.0868, 310.1212, 336.3242, 453.3385, 254.2441, 268.2577, 116.0653,
262.1783, 905.6726, 338.3396, 240.2253, 310.3085),

               mzmax=c(166.0926, 265.1568, 169.0369, 130.0526,
217.1031, 310.1357, 336.3315, 453.3462, 254.2566, 268.2726, 116.1082,
262.1837, 905.6978, 338.3461, 240.2392, 310.3210),

               rtmed=c(86.21800, 224.21635, 36.26749, 39.35784,
198.72017, 83.35260, 876.01160, 270.29547, 914.75492, 914.77873,
816.11585, 708.83185, 330.23208, 914.66756, 914.67620, 867.46462),

               rtmin=c(84.39375, 215.24270, 35.58729, 38.45482,
198.14584, 82.94103, 874.87098, 269.52717, 913.00221, 913.22755,
800.11523, 708.11252, 329.46901, 913.41345, 912.99649, 848.09027),

               rtmax=c(93.59857, 233.70016, 38.30110, 42.16537,
203.45342, 83.93689, 877.42669, 270.84229, 916.28995, 916.75357,
829.72721, 709.56468, 331.16873, 916.14623, 916.21224, 888.14680),

               npeaks=c(461, 452, 462, 475, 223, 421, 456, 456, 416,
409, 126, 125 , 453, 456, 417, 463),

               rtmin=c(84.39375, 215.24270, 35.58729, 38.45482,
198.14584, 82.94103, 874.87098, 269.52717, 913.00221, 913.22755,
800.11523, 708.11252, 329.46901, 913.41345, 912.99649, 848.09027),

               data_converted_pos=c(456, 447, 456, 415, 222, 421,
456, 456, 416, 409, 108, 125, 453, 456, 417, 456))

    ## Check that all peaks are in picklist
    pl <- peaklist2picklist(input, widthFactor=2, minWidth=60)

    checkTrue(all(dim(input) == dim(do.call(rbind, pl))))

}
sneumann/MetShot documentation built on May 30, 2019, 5:05 a.m.