R : Copyright 2005, The R Foundation for Statistical Computing Version 2.1.1 (2005-06-20), ISBN 3-900051-07-0 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for a HTML browser interface to help. Type 'q()' to quit R. > ### *
> ### > attach(NULL, name = "CheckExEnv") > assign(".CheckExEnv", as.environment(2), pos = length(search())) # base > ## add some hooks to label plot pages for base and grid graphics > setHook("plot.new", ".newplot.hook") > setHook("persp", ".newplot.hook") > setHook("grid.newpage", ".gridplot.hook") > > assign("cleanEx", + function(env = .GlobalEnv) { + rm(list = ls(envir = env, all.names = TRUE), envir = env) + RNGkind("default", "default") + set.seed(1) + options(warn = 1) + delayedAssign("T", stop("T used instead of TRUE"), + assign.env = .CheckExEnv) + delayedAssign("F", stop("F used instead of FALSE"), + assign.env = .CheckExEnv) + sch <- search() + newitems <- sch[! sch %in% .oldSearch] + for(item in rev(newitems)) + eval(substitute(detach(item), list(item=item))) + missitems <- .oldSearch[! .oldSearch %in% sch] + if(length(missitems)) + warning("items ", paste(missitems, collapse=", "), + " have been removed from the search path") + }, + env = .CheckExEnv) > assign("..nameEx", "__{must remake R-ex/*.R}__", env = .CheckExEnv) # for now > assign("ptime", proc.time(), env = .CheckExEnv) > grDevices::postscript("caMassClass-Examples.ps") > assign("par.postscript", graphics::par(no.readonly = TRUE), env = .CheckExEnv) > options(contrasts = c(unordered = "contr.treatment", ordered = "contr.poly")) > options(warn = 1) > library('caMassClass') Loading required package: PROcess Loading required package: Icens Loading required package: survival Loading required package: splines Loading required package: e1071 Loading required package: class Loading required package: nnet Loading required package: rpart Loading required package: caTools Loading required package: bitops Loading required package: XML Loading required package: digest > > assign(".oldSearch", search(), env = .CheckExEnv) > assign(".oldNS", loadedNamespaces(), env = .CheckExEnv) > cleanEx(); ..nameEx <- "msc.baseline.subtract" > > ### * msc.baseline.subtract > > flush(stderr()); flush(stdout()) > > ### Name: msc.baseline.subtract > ### Title: Baseline Subtraction for Mass Spectra Data > ### Aliases: msc.baseline.subtract > ### Keywords: ts > > ### ** Examples > > # load input data > if (!file.exists("Data_IMAC.Rdata")) example("msc.project.read") msc.p.> directory = system.file("Test", package = "caMassClass") msc.p.> ProjectFile = file.path(directory, "InputFiles.csv") msc.p.> FileNames = msc.project.read(ProjectFile, ".") msc.p.> cat("File ", FileNames, " was created\n") File ./Data_IMAC.Rdata was created > load("Data_IMAC.Rdata") > > # run msc.baseline.subtract using 3D input > Y = msc.baseline.subtract(X) > cat("Size before: ", dim(X), " and after :", dim(Y), "\n") Size before: 11883 20 2 and after : 11883 20 2 > > # test on data provided in PROcess package (2D input) > directory = system.file("Test", package = "PROcess") > X = msc.msfiles.read.csv(directory) > Y = msc.baseline.subtract(X, plot=TRUE) > cat("Size before: ", dim(X), " and after :", dim(Y), "\n") Size before: 13280 2 and after : 13280 2 > > > > > cleanEx(); ..nameEx <- "msc.biomarkers.fill" > > ### * msc.biomarkers.fill > > flush(stderr()); flush(stdout()) > > ### Name: msc.biomarkers.fill > ### Title: Fill Empty Spaces in Biomarker Matrix > ### Aliases: msc.biomarkers.fill > ### Keywords: ts > > ### ** Examples > > # load input data > if (!file.exists("Data_IMAC.Rdata")) example("msc.project.read") > load("Data_IMAC.Rdata") > Y = msc.peaks.align(msc.peaks.find(X)) > dim(Y$Bmrks) [1] 22 40 > print( Y$Bmrks , na.print=".", digits=2) cancer_01(1) cancer_02(1) cancer_03(1) cancer_04(1) cancer_05(1) M2959.86 0.52 0.50 0.52 0.54 0.45 M3893.45 0.99 0.94 0.87 1.32 0.97 M3966.43 1.67 1.29 1.14 1.58 1.54 M3981.58 1.67 . . . . M4292.97 0.44 0.21 . . 0.32 M4478.38 0.44 . . 0.25 0.48 M4654.46 1.43 1.12 0.87 1.26 1.50 M4758.42 0.69 0.67 . 0.67 0.88 M5348.72 0.48 0.49 0.67 0.72 0.25 M5916.53 4.01 4.02 5.11 3.35 1.37 M6123.01 1.19 1.09 1.49 1.09 0.70 M6954.25 0.53 . . 0.62 0.52 M7778.77 4.06 3.49 3.47 3.50 2.87 M8154.85 0.80 0.86 0.87 0.83 0.89 M8615.99 0.31 . 0.29 0.33 0.39 M8945.9 1.14 0.90 1.09 0.90 1.69 M9071.32 . . . . . M9300.7 5.01 4.43 3.83 3.51 4.65 M9507.71 2.00 1.84 1.38 1.37 2.07 M10271.3 0.28 0.22 . 0.29 . M11740.1 0.26 . 0.25 0.21 0.26 M13895.5 0.78 0.67 0.56 0.82 0.78 cancer_06(1) cancer_07(1) cancer_08(1) cancer_09(1) cancer_10(1) M2959.86 0.86 0.58 0.47 0.47 0.53 M3893.45 0.94 1.16 1.44 1.10 1.30 M3966.43 . . 1.76 1.43 2.13 M3981.58 . . . . . M4292.97 . . 0.37 . 0.35 M4478.38 0.48 . 0.53 0.58 . M4654.46 1.34 1.48 1.21 1.47 1.67 M4758.42 0.76 0.82 0.74 0.83 0.84 M5348.72 0.59 0.45 0.30 0.35 0.38 M5916.53 4.50 4.61 2.77 2.69 3.08 M6123.01 1.40 1.65 1.03 0.81 1.01 M6954.25 . . . . . M7778.77 3.36 2.43 5.38 5.00 5.04 M8154.85 0.83 0.66 1.15 1.28 0.99 M8615.99 . . . 0.54 . M8945.9 1.52 . 1.56 2.22 1.08 M9071.32 . 0.83 1.02 1.32 0.75 M9300.7 4.54 3.20 4.90 5.72 5.80 M9507.71 1.83 1.73 1.68 2.65 2.37 M10271.3 . . 0.54 . . M11740.1 0.22 . . 0.38 . M13895.5 . . . 0.75 0.70 normal_01(1) normal_02(1) normal_03(1) normal_04(1) normal_05(1) M2959.86 0.53 0.52 0.54 0.90 0.45 M3893.45 1.31 1.13 1.02 1.08 1.42 M3966.43 . . 1.32 . 1.59 M3981.58 2.12 . . . 1.16 M4292.97 0.48 . 0.26 . 0.46 M4478.38 . . . . . M4654.46 1.27 1.76 1.10 1.33 1.26 M4758.42 . 0.90 . . 0.76 M5348.72 1.14 0.28 0.69 0.67 0.35 M5916.53 4.26 2.70 3.90 3.26 3.50 M6123.01 1.33 0.88 1.27 1.48 1.23 M6954.25 . . . . . M7778.77 4.13 3.74 2.33 2.58 3.39 M8154.85 0.78 0.80 0.65 0.85 0.77 M8615.99 0.28 . 0.37 . 0.31 M8945.9 0.97 1.11 1.17 0.51 0.73 M9071.32 . . 0.84 . 0.65 M9300.7 4.69 6.73 3.88 3.44 4.24 M9507.71 1.65 2.53 1.72 1.46 1.76 M10271.3 . . . 0.38 0.31 M11740.1 0.37 0.28 . . 0.27 M13895.5 . . . . . normal_06(1) normal_07(1) normal_08(1) normal_09(1) normal_10(1) M2959.86 0.88 0.50 . 0.58 0.53 M3893.45 0.78 1.12 1.84 1.24 1.16 M3966.43 . . 1.65 1.77 . M3981.58 . . . 1.40 1.16 M4292.97 . . . 0.42 0.48 M4478.38 . . . . 0.48 M4654.46 0.97 1.35 2.05 1.24 1.27 M4758.42 . 0.66 0.89 . . M5348.72 1.36 0.46 . 0.26 0.21 M5916.53 7.19 3.55 1.50 2.39 1.65 M6123.01 2.56 1.16 . 0.91 0.66 M6954.25 0.48 0.60 0.48 0.67 0.69 M7778.77 2.07 3.78 2.79 2.66 1.53 M8154.85 0.50 0.67 0.75 0.74 0.38 M8615.99 0.35 . . . 0.95 M8945.9 0.50 0.75 0.77 0.68 1.28 M9071.32 . 0.60 0.82 . . M9300.7 2.90 5.57 4.74 3.05 2.77 M9507.71 0.94 1.81 2.13 1.34 1.43 M10271.3 . 0.34 0.66 . 0.24 M11740.1 . 0.49 0.49 0.61 0.41 M13895.5 . 1.13 0.78 1.11 1.09 cancer_01(2) cancer_02(2) cancer_03(2) cancer_04(2) cancer_05(2) M2959.86 0.60 0.75 0.57 0.70 0.64 M3893.45 0.97 1.11 1.03 1.36 1.50 M3966.43 1.38 1.34 1.18 1.47 2.26 M3981.58 1.38 . . . . M4292.97 0.37 0.33 . . 0.57 M4478.38 . . . 0.32 0.77 M4654.46 1.29 1.44 1.17 1.45 1.76 M4758.42 0.69 0.95 . . 1.11 M5348.72 0.64 0.77 1.13 0.78 0.47 M5916.53 4.74 4.83 6.35 4.48 1.36 M6123.01 1.52 1.49 1.88 1.34 0.52 M6954.25 0.74 . . 0.55 . M7778.77 3.32 3.74 4.54 4.14 3.12 M8154.85 0.94 1.11 0.99 0.86 1.13 M8615.99 0.49 . . . 0.50 M8945.9 1.11 0.88 1.11 1.00 1.66 M9071.32 . . . . . M9300.7 4.27 3.94 4.35 4.62 3.83 M9507.71 2.02 1.66 1.53 1.50 1.73 M10271.3 0.25 . . 0.36 . M11740.1 0.23 . 0.29 . . M13895.5 0.70 . . 0.75 . cancer_06(2) cancer_07(2) cancer_08(2) cancer_09(2) cancer_10(2) M2959.86 0.75 0.95 0.47 . 0.38 M3893.45 1.18 1.21 1.33 1.06 1.36 M3966.43 . 1.71 1.60 1.47 1.84 M3981.58 . . . . 1.52 M4292.97 0.33 0.55 0.30 0.22 0.29 M4478.38 0.59 0.56 0.55 0.56 . M4654.46 1.54 1.62 1.36 1.47 1.52 M4758.42 0.82 0.92 0.80 . 0.85 M5348.72 0.36 0.38 0.25 0.19 0.31 M5916.53 2.95 3.39 1.82 1.24 2.82 M6123.01 1.00 1.19 0.69 . 0.80 M6954.25 . . . . 0.44 M7778.77 3.20 2.46 3.02 4.60 4.99 M8154.85 0.89 0.68 0.92 1.00 1.01 M8615.99 0.43 0.23 0.45 0.27 . M8945.9 1.74 1.46 1.51 2.25 1.05 M9071.32 . . 1.08 . . M9300.7 4.82 4.15 3.78 5.20 5.67 M9507.71 1.94 1.76 1.99 2.17 2.27 M10271.3 . . 0.62 . . M11740.1 0.27 1.34 0.33 0.38 0.27 M13895.5 . . 0.72 0.72 0.79 normal_01(2) normal_02(2) normal_03(2) normal_04(2) normal_05(2) M2959.86 0.38 0.37 0.77 0.34 0.42 M3893.45 1.58 0.95 1.18 0.93 1.51 M3966.43 . . 1.76 . 2.39 M3981.58 2.29 . 1.32 . 1.97 M4292.97 0.76 . 0.36 . 0.37 M4478.38 . 0.42 . . . M4654.46 1.62 1.23 1.38 1.28 1.51 M4758.42 . 0.72 0.78 0.77 0.71 M5348.72 0.62 0.48 0.68 0.48 0.48 M5916.53 3.04 3.88 4.76 4.22 2.76 M6123.01 1.18 1.04 1.38 1.39 0.92 M6954.25 . 0.41 . . . M7778.77 4.17 4.25 3.76 5.00 4.23 M8154.85 1.23 0.75 0.78 0.92 0.83 M8615.99 0.63 . 0.35 0.39 0.37 M8945.9 1.24 1.16 1.15 1.27 0.67 M9071.32 . 0.90 . . 0.67 M9300.7 4.27 5.91 5.20 5.70 5.80 M9507.71 2.53 2.14 1.69 2.36 1.65 M10271.3 0.29 . . 0.44 0.30 M11740.1 0.33 0.24 . . 0.47 M13895.5 . 0.87 . 0.64 0.68 normal_06(2) normal_07(2) normal_08(2) normal_09(2) normal_10(2) M2959.86 1.22 0.50 . 0.611 . M3893.45 0.77 1.22 1.53 0.514 1.11 M3966.43 . . 1.31 0.831 . M3981.58 . 0.86 . 0.831 0.91 M4292.97 . . . 0.083 0.64 M4478.38 . . . . 0.40 M4654.46 0.88 1.25 1.85 0.541 1.29 M4758.42 . 0.78 . . . M5348.72 1.78 0.34 0.26 . . M5916.53 8.26 3.43 1.67 4.088 1.19 M6123.01 3.30 1.18 0.72 1.347 . M6954.25 . 0.39 0.56 . 0.76 M7778.77 2.00 4.75 2.77 2.027 1.91 M8154.85 0.48 0.88 0.72 0.325 0.52 M8615.99 0.30 . 0.43 . 1.02 M8945.9 0.51 0.95 0.82 0.370 1.78 M9071.32 . 0.79 0.77 . . M9300.7 2.66 5.51 4.62 2.256 2.93 M9507.71 1.07 2.36 2.13 0.790 1.28 M10271.3 . 0.37 0.52 . 0.33 M11740.1 . 0.40 0.46 0.372 0.50 M13895.5 . 0.99 0.82 . 1.22 > > # run msc.biomarkers.fill > Z = msc.biomarkers.fill( X, Y$Bmrks, Y$BinBounds) > dim(Z) [1] 22 20 2 > print( Z[,,1] , na.print=".", digits=2) cancer_01 cancer_02 cancer_03 cancer_04 cancer_05 cancer_06 cancer_07 M2959.86 0.52 0.50 0.52 0.54 0.45 0.86 0.58 M3893.45 0.99 0.94 0.87 1.32 0.97 0.94 1.16 M3966.43 1.67 1.29 1.14 1.58 1.54 2.10 2.51 M3981.58 1.67 3.14 2.43 1.28 3.48 1.63 2.17 M4292.97 0.44 0.21 1.99 1.46 0.32 1.67 1.20 M4478.38 0.44 1.73 1.91 0.25 0.48 0.48 1.63 M4654.46 1.43 1.12 0.87 1.26 1.50 1.34 1.48 M4758.42 0.69 0.67 1.44 0.67 0.88 0.76 0.82 M5348.72 0.48 0.49 0.67 0.72 0.25 0.59 0.45 M5916.53 4.01 4.02 5.11 3.35 1.37 4.50 4.61 M6123.01 1.19 1.09 1.49 1.09 0.70 1.40 1.65 M6954.25 0.53 1.75 1.65 0.62 0.52 1.43 1.04 M7778.77 4.06 3.49 3.47 3.50 2.87 3.36 2.43 M8154.85 0.80 0.86 0.87 0.83 0.89 0.83 0.66 M8615.99 0.31 1.04 0.29 0.33 0.39 0.55 0.38 M8945.9 1.14 0.90 1.09 0.90 1.69 1.52 3.75 M9071.32 1.47 1.14 1.69 1.34 1.73 1.23 0.83 M9300.7 5.01 4.43 3.83 3.51 4.65 4.54 3.20 M9507.71 2.00 1.84 1.38 1.37 2.07 1.83 1.73 M10271.3 0.28 0.22 1.67 0.29 1.49 0.35 1.02 M11740.1 0.26 1.73 0.25 0.21 0.26 0.22 3.35 M13895.5 0.78 0.67 0.56 0.82 0.78 1.10 0.81 cancer_08 cancer_09 cancer_10 normal_01 normal_02 normal_03 normal_04 M2959.86 0.47 0.47 0.53 0.53 0.52 0.54 0.90 M3893.45 1.44 1.10 1.30 1.31 1.13 1.02 1.08 M3966.43 1.76 1.43 2.13 5.66 2.01 1.32 1.03 M3981.58 3.28 2.42 4.67 2.12 1.10 4.66 1.07 M4292.97 0.37 1.87 0.35 0.48 0.99 0.26 1.41 M4478.38 0.53 0.58 1.35 1.28 1.44 1.40 1.33 M4654.46 1.21 1.47 1.67 1.27 1.76 1.10 1.33 M4758.42 0.74 0.83 0.84 1.65 0.90 1.65 1.96 M5348.72 0.30 0.35 0.38 1.14 0.28 0.69 0.67 M5916.53 2.77 2.69 3.08 4.26 2.70 3.90 3.26 M6123.01 1.03 0.81 1.01 1.33 0.88 1.27 1.48 M6954.25 1.69 1.93 1.85 1.37 1.86 1.29 1.30 M7778.77 5.38 5.00 5.04 4.13 3.74 2.33 2.58 M8154.85 1.15 1.28 0.99 0.78 0.80 0.65 0.85 M8615.99 1.79 0.54 1.94 0.28 1.09 0.37 1.84 M8945.9 1.56 2.22 1.08 0.97 1.11 1.17 0.51 M9071.32 1.02 1.32 0.75 1.59 1.43 0.84 1.31 M9300.7 4.90 5.72 5.80 4.69 6.73 3.88 3.44 M9507.71 1.68 2.65 2.37 1.65 2.53 1.72 1.46 M10271.3 0.54 1.05 0.92 1.94 0.89 1.84 0.38 M11740.1 1.81 0.38 1.73 0.37 0.28 1.75 0.81 M13895.5 1.67 0.75 0.70 1.55 2.13 1.65 1.07 normal_05 normal_06 normal_07 normal_08 normal_09 normal_10 M2959.86 0.45 0.88 0.50 1.71 0.58 0.53 M3893.45 1.42 0.78 1.12 1.84 1.24 1.16 M3966.43 1.59 1.53 2.51 1.65 1.77 3.91 M3981.58 1.16 0.39 2.70 1.56 1.40 1.16 M4292.97 0.46 0.39 1.67 1.58 0.42 0.48 M4478.38 0.69 0.80 1.39 1.27 1.62 0.48 M4654.46 1.26 0.97 1.35 2.05 1.24 1.27 M4758.42 0.76 1.21 0.66 0.89 1.52 1.73 M5348.72 0.35 1.36 0.46 1.59 0.26 0.21 M5916.53 3.50 7.19 3.55 1.50 2.39 1.65 M6123.01 1.23 2.56 1.16 1.61 0.91 0.66 M6954.25 1.33 0.48 0.60 0.48 0.67 0.69 M7778.77 3.39 2.07 3.78 2.79 2.66 1.53 M8154.85 0.77 0.50 0.67 0.75 0.74 0.38 M8615.99 0.31 0.35 1.52 1.78 1.50 0.95 M8945.9 0.73 0.50 0.75 0.77 0.68 1.28 M9071.32 0.65 1.59 0.60 0.82 1.47 1.25 M9300.7 4.24 2.90 5.57 4.74 3.05 2.77 M9507.71 1.76 0.94 1.81 2.13 1.34 1.43 M10271.3 0.31 1.75 0.34 0.66 0.65 0.24 M11740.1 0.27 0.88 0.49 0.49 0.61 0.41 M13895.5 1.31 1.38 1.13 0.78 1.11 1.09 > print( Z[,,2] , na.print=".", digits=2) cancer_01 cancer_02 cancer_03 cancer_04 cancer_05 cancer_06 cancer_07 M2959.86 0.60 0.75 0.57 0.70 0.64 0.75 0.95 M3893.45 0.97 1.11 1.03 1.36 1.50 1.18 1.21 M3966.43 1.38 1.34 1.18 1.47 2.26 4.19 1.71 M3981.58 1.38 2.81 2.19 1.30 3.34 2.21 2.03 M4292.97 0.37 0.33 1.42 1.67 0.57 0.33 0.55 M4478.38 1.53 1.93 1.68 0.32 0.77 0.59 0.56 M4654.46 1.29 1.44 1.17 1.45 1.76 1.54 1.62 M4758.42 0.69 0.95 1.43 1.64 1.11 0.82 0.92 M5348.72 0.64 0.77 1.13 0.78 0.47 0.36 0.38 M5916.53 4.74 4.83 6.35 4.48 1.36 2.95 3.39 M6123.01 1.52 1.49 1.88 1.34 0.52 1.00 1.19 M6954.25 0.74 0.83 1.41 0.55 1.72 1.53 1.07 M7778.77 3.32 3.74 4.54 4.14 3.12 3.20 2.46 M8154.85 0.94 1.11 0.99 0.86 1.13 0.89 0.68 M8615.99 0.49 0.96 1.91 1.60 0.50 0.43 0.23 M8945.9 1.11 0.88 1.11 1.00 1.66 1.74 1.46 M9071.32 1.36 1.07 1.70 1.30 1.25 1.19 1.55 M9300.7 4.27 3.94 4.35 4.62 3.83 4.82 4.15 M9507.71 2.02 1.66 1.53 1.50 1.73 1.94 1.76 M10271.3 0.25 1.61 1.68 0.36 0.81 0.32 0.81 M11740.1 0.23 1.13 0.29 1.58 1.37 0.27 1.34 M13895.5 0.70 0.90 1.59 0.75 1.41 0.99 0.90 cancer_08 cancer_09 cancer_10 normal_01 normal_02 normal_03 normal_04 M2959.86 0.47 1.76 0.38 0.38 0.37 0.77 0.34 M3893.45 1.33 1.06 1.36 1.58 0.95 1.18 0.93 M3966.43 1.60 1.47 1.84 6.17 1.75 1.76 1.06 M3981.58 3.40 2.70 1.52 2.29 1.07 1.32 1.02 M4292.97 0.30 0.22 0.29 0.76 0.94 0.36 0.53 M4478.38 0.55 0.56 1.39 1.44 0.42 1.46 1.44 M4654.46 1.36 1.47 1.52 1.62 1.23 1.38 1.28 M4758.42 0.80 1.76 0.85 1.77 0.72 0.78 0.77 M5348.72 0.25 0.19 0.31 0.62 0.48 0.68 0.48 M5916.53 1.82 1.24 2.82 3.04 3.88 4.76 4.22 M6123.01 0.69 1.71 0.80 1.18 1.04 1.38 1.39 M6954.25 1.88 1.88 0.44 1.25 0.41 1.35 1.81 M7778.77 3.02 4.60 4.99 4.17 4.25 3.76 5.00 M8154.85 0.92 1.00 1.01 1.23 0.75 0.78 0.92 M8615.99 0.45 0.27 1.71 0.63 1.36 0.35 0.39 M8945.9 1.51 2.25 1.05 1.24 1.16 1.15 1.27 M9071.32 1.08 1.96 1.92 1.81 0.90 1.87 1.82 M9300.7 3.78 5.20 5.67 4.27 5.91 5.20 5.70 M9507.71 1.99 2.17 2.27 2.53 2.14 1.69 2.36 M10271.3 0.62 1.13 0.86 0.29 1.22 1.77 0.44 M11740.1 0.33 0.38 0.27 0.33 0.24 1.62 1.53 M13895.5 0.72 0.72 0.79 1.26 0.87 1.37 0.64 normal_05 normal_06 normal_07 normal_08 normal_09 normal_10 M2959.86 0.42 1.22 0.50 1.92 0.611 1.60 M3893.45 1.51 0.77 1.22 1.53 0.514 1.11 M3966.43 2.39 1.00 2.32 1.31 0.831 4.31 M3981.58 1.97 0.52 0.86 1.26 0.831 0.91 M4292.97 0.37 0.36 1.74 1.38 0.083 0.64 M4478.38 0.98 0.95 1.50 1.37 0.702 0.40 M4654.46 1.51 0.88 1.25 1.85 0.541 1.29 M4758.42 0.71 1.59 0.78 2.04 0.895 1.37 M5348.72 0.48 1.78 0.34 0.26 6.702 1.27 M5916.53 2.76 8.26 3.43 1.67 4.088 1.19 M6123.01 0.92 3.30 1.18 0.72 1.347 1.27 M6954.25 1.90 1.82 0.39 0.56 0.892 0.76 M7778.77 4.23 2.00 4.75 2.77 2.027 1.91 M8154.85 0.83 0.48 0.88 0.72 0.325 0.52 M8615.99 0.37 0.30 1.85 0.43 1.667 1.02 M8945.9 0.67 0.51 0.95 0.82 0.370 1.78 M9071.32 0.67 1.37 0.79 0.77 1.328 1.34 M9300.7 5.80 2.66 5.51 4.62 2.256 2.93 M9507.71 1.65 1.07 2.36 2.13 0.790 1.28 M10271.3 0.30 1.66 0.37 0.52 0.434 0.33 M11740.1 0.47 0.96 0.40 0.46 0.372 0.50 M13895.5 0.68 1.51 0.99 0.82 0.930 1.22 > > # run msc.biomarkers.fill with other FillType > Z = msc.biomarkers.fill( X, Y$Bmrks, Y$BinBounds, FillType=2) > > > > cleanEx(); ..nameEx <- "msc.biomarkers.read.csv" > > ### * msc.biomarkers.read.csv > > flush(stderr()); flush(stdout()) > > ### Name: msc.biomarkers.read.csv > ### Title: Read and Write biomarker matrix in CSV format > ### Aliases: msc.biomarkers.read.csv msc.biomarkers.write.csv > ### Keywords: ts > > ### ** Examples > > example("msc.peaks.align", verbose=FALSE) # create biomarkers data msc.p.> if (!file.exists("Data_IMAC.Rdata")) example("msc.project.read") msc.p.> load("Data_IMAC.Rdata") msc.p.> Peaks = msc.peaks.find(X) msc.p.> cat(nrow(Peaks), "peaks were found in", Peaks[nrow(Peaks), 2], "files.\n") 823 peaks were found in 40 files. msc.p.> Y = msc.peaks.align(Peaks) msc.p.> print(t(Y$Bmrks), na.print = ".", digits = 2) M2959.86 M3893.45 M3966.43 M3981.58 M4292.97 M4478.38 M4654.46 cancer_01(1) 0.52 0.99 1.67 1.67 0.436 0.44 1.43 cancer_02(1) 0.50 0.94 1.29 . 0.208 . 1.12 cancer_03(1) 0.52 0.87 1.14 . . . 0.87 cancer_04(1) 0.54 1.32 1.58 . . 0.25 1.26 cancer_05(1) 0.45 0.97 1.54 . 0.322 0.48 1.50 cancer_06(1) 0.86 0.94 . . . 0.48 1.34 cancer_07(1) 0.58 1.16 . . . . 1.48 cancer_08(1) 0.47 1.44 1.76 . 0.367 0.53 1.21 cancer_09(1) 0.47 1.10 1.43 . . 0.58 1.47 cancer_10(1) 0.53 1.30 2.13 . 0.354 . 1.67 normal_01(1) 0.53 1.31 . 2.12 0.476 . 1.27 normal_02(1) 0.52 1.13 . . . . 1.76 normal_03(1) 0.54 1.02 1.32 . 0.255 . 1.10 normal_04(1) 0.90 1.08 . . . . 1.33 normal_05(1) 0.45 1.42 1.59 1.16 0.463 . 1.26 normal_06(1) 0.88 0.78 . . . . 0.97 normal_07(1) 0.50 1.12 . . . . 1.35 normal_08(1) . 1.84 1.65 . . . 2.05 normal_09(1) 0.58 1.24 1.77 1.40 0.421 . 1.24 normal_10(1) 0.53 1.16 . 1.16 0.478 0.48 1.27 cancer_01(2) 0.60 0.97 1.38 1.38 0.369 . 1.29 cancer_02(2) 0.75 1.11 1.34 . 0.332 . 1.44 cancer_03(2) 0.57 1.03 1.18 . . . 1.17 cancer_04(2) 0.70 1.36 1.47 . . 0.32 1.45 cancer_05(2) 0.64 1.50 2.26 . 0.567 0.77 1.76 cancer_06(2) 0.75 1.18 . . 0.331 0.59 1.54 cancer_07(2) 0.95 1.21 1.71 . 0.550 0.56 1.62 cancer_08(2) 0.47 1.33 1.60 . 0.304 0.55 1.36 cancer_09(2) . 1.06 1.47 . 0.224 0.56 1.47 cancer_10(2) 0.38 1.36 1.84 1.52 0.292 . 1.52 normal_01(2) 0.38 1.58 . 2.29 0.756 . 1.62 normal_02(2) 0.37 0.95 . . . 0.42 1.23 normal_03(2) 0.77 1.18 1.76 1.32 0.364 . 1.38 normal_04(2) 0.34 0.93 . . . . 1.28 normal_05(2) 0.42 1.51 2.39 1.97 0.374 . 1.51 normal_06(2) 1.22 0.77 . . . . 0.88 normal_07(2) 0.50 1.22 . 0.86 . . 1.25 normal_08(2) . 1.53 1.31 . . . 1.85 normal_09(2) 0.61 0.51 0.83 0.83 0.083 . 0.54 normal_10(2) . 1.11 . 0.91 0.638 0.40 1.29 M4758.42 M5348.72 M5916.53 M6123.01 M6954.25 M7778.77 M8154.85 cancer_01(1) 0.69 0.48 4.0 1.19 0.53 4.1 0.80 cancer_02(1) 0.67 0.49 4.0 1.09 . 3.5 0.86 cancer_03(1) . 0.67 5.1 1.49 . 3.5 0.87 cancer_04(1) 0.67 0.72 3.4 1.09 0.62 3.5 0.83 cancer_05(1) 0.88 0.25 1.4 0.70 0.52 2.9 0.89 cancer_06(1) 0.76 0.59 4.5 1.40 . 3.4 0.83 cancer_07(1) 0.82 0.45 4.6 1.65 . 2.4 0.66 cancer_08(1) 0.74 0.30 2.8 1.03 . 5.4 1.15 cancer_09(1) 0.83 0.35 2.7 0.81 . 5.0 1.28 cancer_10(1) 0.84 0.38 3.1 1.01 . 5.0 0.99 normal_01(1) . 1.14 4.3 1.33 . 4.1 0.78 normal_02(1) 0.90 0.28 2.7 0.88 . 3.7 0.80 normal_03(1) . 0.69 3.9 1.27 . 2.3 0.65 normal_04(1) . 0.67 3.3 1.48 . 2.6 0.85 normal_05(1) 0.76 0.35 3.5 1.23 . 3.4 0.77 normal_06(1) . 1.36 7.2 2.56 0.48 2.1 0.50 normal_07(1) 0.66 0.46 3.5 1.16 0.60 3.8 0.67 normal_08(1) 0.89 . 1.5 . 0.48 2.8 0.75 normal_09(1) . 0.26 2.4 0.91 0.67 2.7 0.74 normal_10(1) . 0.21 1.7 0.66 0.69 1.5 0.38 cancer_01(2) 0.69 0.64 4.7 1.52 0.74 3.3 0.94 cancer_02(2) 0.95 0.77 4.8 1.49 . 3.7 1.11 cancer_03(2) . 1.13 6.3 1.88 . 4.5 0.99 cancer_04(2) . 0.78 4.5 1.34 0.55 4.1 0.86 cancer_05(2) 1.11 0.47 1.4 0.52 . 3.1 1.13 cancer_06(2) 0.82 0.36 2.9 1.00 . 3.2 0.89 cancer_07(2) 0.92 0.38 3.4 1.19 . 2.5 0.68 cancer_08(2) 0.80 0.25 1.8 0.69 . 3.0 0.92 cancer_09(2) . 0.19 1.2 . . 4.6 1.00 cancer_10(2) 0.85 0.31 2.8 0.80 0.44 5.0 1.01 normal_01(2) . 0.62 3.0 1.18 . 4.2 1.23 normal_02(2) 0.72 0.48 3.9 1.04 0.41 4.3 0.75 normal_03(2) 0.78 0.68 4.8 1.38 . 3.8 0.78 normal_04(2) 0.77 0.48 4.2 1.39 . 5.0 0.92 normal_05(2) 0.71 0.48 2.8 0.92 . 4.2 0.83 normal_06(2) . 1.78 8.3 3.30 . 2.0 0.48 normal_07(2) 0.78 0.34 3.4 1.18 0.39 4.7 0.88 normal_08(2) . 0.26 1.7 0.72 0.56 2.8 0.72 normal_09(2) . . 4.1 1.35 . 2.0 0.32 normal_10(2) . . 1.2 . 0.76 1.9 0.52 M8615.99 M8945.9 M9071.32 M9300.7 M9507.71 M10271.3 M11740.1 cancer_01(1) 0.31 1.14 . 5.0 2.00 0.28 0.26 cancer_02(1) . 0.90 . 4.4 1.84 0.22 . cancer_03(1) 0.29 1.09 . 3.8 1.38 . 0.25 cancer_04(1) 0.33 0.90 . 3.5 1.37 0.29 0.21 cancer_05(1) 0.39 1.69 . 4.6 2.07 . 0.26 cancer_06(1) . 1.52 . 4.5 1.83 . 0.22 cancer_07(1) . . 0.83 3.2 1.73 . . cancer_08(1) . 1.56 1.02 4.9 1.68 0.54 . cancer_09(1) 0.54 2.22 1.32 5.7 2.65 . 0.38 cancer_10(1) . 1.08 0.75 5.8 2.37 . . normal_01(1) 0.28 0.97 . 4.7 1.65 . 0.37 normal_02(1) . 1.11 . 6.7 2.53 . 0.28 normal_03(1) 0.37 1.17 0.84 3.9 1.72 . . normal_04(1) . 0.51 . 3.4 1.46 0.38 . normal_05(1) 0.31 0.73 0.65 4.2 1.76 0.31 0.27 normal_06(1) 0.35 0.50 . 2.9 0.94 . . normal_07(1) . 0.75 0.60 5.6 1.81 0.34 0.49 normal_08(1) . 0.77 0.82 4.7 2.13 0.66 0.49 normal_09(1) . 0.68 . 3.0 1.34 . 0.61 normal_10(1) 0.95 1.28 . 2.8 1.43 0.24 0.41 cancer_01(2) 0.49 1.11 . 4.3 2.02 0.25 0.23 cancer_02(2) . 0.88 . 3.9 1.66 . . cancer_03(2) . 1.11 . 4.4 1.53 . 0.29 cancer_04(2) . 1.00 . 4.6 1.50 0.36 . cancer_05(2) 0.50 1.66 . 3.8 1.73 . . cancer_06(2) 0.43 1.74 . 4.8 1.94 . 0.27 cancer_07(2) 0.23 1.46 . 4.1 1.76 . 1.34 cancer_08(2) 0.45 1.51 1.08 3.8 1.99 0.62 0.33 cancer_09(2) 0.27 2.25 . 5.2 2.17 . 0.38 cancer_10(2) . 1.05 . 5.7 2.27 . 0.27 normal_01(2) 0.63 1.24 . 4.3 2.53 0.29 0.33 normal_02(2) . 1.16 0.90 5.9 2.14 . 0.24 normal_03(2) 0.35 1.15 . 5.2 1.69 . . normal_04(2) 0.39 1.27 . 5.7 2.36 0.44 . normal_05(2) 0.37 0.67 0.67 5.8 1.65 0.30 0.47 normal_06(2) 0.30 0.51 . 2.7 1.07 . . normal_07(2) . 0.95 0.79 5.5 2.36 0.37 0.40 normal_08(2) 0.43 0.82 0.77 4.6 2.13 0.52 0.46 normal_09(2) . 0.37 . 2.3 0.79 . 0.37 normal_10(2) 1.02 1.78 . 2.9 1.28 0.33 0.50 M13895.5 cancer_01(1) 0.78 cancer_02(1) 0.67 cancer_03(1) 0.56 cancer_04(1) 0.82 cancer_05(1) 0.78 cancer_06(1) . cancer_07(1) . cancer_08(1) . cancer_09(1) 0.75 cancer_10(1) 0.70 normal_01(1) . normal_02(1) . normal_03(1) . normal_04(1) . normal_05(1) . normal_06(1) . normal_07(1) 1.13 normal_08(1) 0.78 normal_09(1) 1.11 normal_10(1) 1.09 cancer_01(2) 0.70 cancer_02(2) . cancer_03(2) . cancer_04(2) 0.75 cancer_05(2) . cancer_06(2) . cancer_07(2) . cancer_08(2) 0.72 cancer_09(2) 0.72 cancer_10(2) 0.79 normal_01(2) . normal_02(2) 0.87 normal_03(2) . normal_04(2) 0.64 normal_05(2) 0.68 normal_06(2) . normal_07(2) 0.99 normal_08(2) 0.82 normal_09(2) . normal_10(2) 1.22 > X = Y$Bmrks # biomarkers data is stored in variable 'Y$Bmrks' > msc.biomarkers.write.csv("biomarkers.csv", X) > Y = msc.biomarkers.read.csv("biomarkers.csv") > file.remove("biomarkers.csv") [1] TRUE > stopifnot( all(X==Y, na.rm=TRUE) ) > > > > cleanEx(); ..nameEx <- "msc.classifier.run" > > ### * msc.classifier.run > > flush(stderr()); flush(stdout()) > > ### Name: msc.classifier.run > ### Title: Train and Test Chosen Classifier. > ### Aliases: msc.classifier.run > ### Keywords: classif > > ### ** Examples > > data(iris) > mask = msc.sample.split(iris[,5], SplitRatio=1/4) # very few points to train Warning in msc.sample.split(iris[, 5], SplitRatio = 1/4) : Function 'msc.sample.split' was moved to 'caTools' package under new name 'split.samples'. Sorry for inconvinience. > xtrain = iris[ mask,-5] # use output of msc.sample.split to ... > xtest = iris[!mask,-5] # create train and test subsets > ytrain = iris[ mask, 5] > ytest = iris[!mask, 5] > table(ytrain, msc.classifier.run(xtrain,ytrain,xtrain, method="svm") ) ytrain setosa versicolor virginica setosa 12 0 0 versicolor 0 12 0 virginica 0 2 10 > table(ytrain, msc.classifier.run(xtrain,ytrain,xtrain, method="LogitBoost") ) ytrain setosa versicolor virginica setosa 12 0 0 versicolor 0 12 0 virginica 0 0 12 > table(ytrain, msc.classifier.run(xtrain,ytrain,xtrain, method="nnet") ) ytrain setosa versicolor virginica setosa 12 0 0 versicolor 0 12 0 virginica 0 1 11 > table(ytrain, msc.classifier.run(xtrain,ytrain,xtrain, method="lda") ) Loading required package: MASS ytrain setosa versicolor virginica setosa 12 0 0 versicolor 0 12 0 virginica 0 0 12 > table(ytrain, msc.classifier.run(xtrain,ytrain,xtrain, method="qda") ) ytrain setosa versicolor virginica setosa 12 0 0 versicolor 0 12 0 virginica 0 0 12 > > > > cleanEx(); ..nameEx <- "msc.classifier.test" > > ### * msc.classifier.test > > flush(stderr()); flush(stdout()) > > ### Name: msc.classifier.test > ### Title: Test a Classifier through Cross-validation > ### Aliases: msc.classifier.test > ### Keywords: classif > > ### ** Examples > > data(iris) > A = msc.classifier.test(iris[,-5],iris[,5], method="LogitBoost", nIter=2) Warning in msc.sample.split(Y[TrainIdx], SplitRatio, group = group) : Function 'msc.sample.split' was moved to 'caTools' package under new name 'split.samples'. Sorry for inconvinience. Warning in msc.sample.split(Y[TrainIdx], SplitRatio, group = group) : Function 'msc.sample.split' was moved to 'caTools' package under new name 'split.samples'. Sorry for inconvinience. Warning in msc.sample.split(Y[TrainIdx], SplitRatio, group = group) : Function 'msc.sample.split' was moved to 'caTools' package under new name 'split.samples'. Sorry for inconvinience. Warning in msc.sample.split(Y[TrainIdx], SplitRatio, group = group) : Function 'msc.sample.split' was moved to 'caTools' package under new name 'split.samples'. Sorry for inconvinience. Warning in msc.sample.split(Y[TrainIdx], SplitRatio, group = group) : Function 'msc.sample.split' was moved to 'caTools' package under new name 'split.samples'. Sorry for inconvinience. Warning in msc.sample.split(Y[TrainIdx], SplitRatio, group = group) : Function 'msc.sample.split' was moved to 'caTools' package under new name 'split.samples'. Sorry for inconvinience. Warning in msc.sample.split(Y[TrainIdx], SplitRatio, group = group) : Function 'msc.sample.split' was moved to 'caTools' package under new name 'split.samples'. Sorry for inconvinience. Warning in msc.sample.split(Y[TrainIdx], SplitRatio, group = group) : Function 'msc.sample.split' was moved to 'caTools' package under new name 'split.samples'. Sorry for inconvinience. Warning in msc.sample.split(Y[TrainIdx], SplitRatio, group = group) : Function 'msc.sample.split' was moved to 'caTools' package under new name 'split.samples'. Sorry for inconvinience. Warning in msc.sample.split(Y[TrainIdx], SplitRatio, group = group) : Function 'msc.sample.split' was moved to 'caTools' package under new name 'split.samples'. Sorry for inconvinience. Warning in msc.sample.split(Y[TrainIdx], SplitRatio, group = group) : Function 'msc.sample.split' was moved to 'caTools' package under new name 'split.samples'. Sorry for inconvinience. Warning in msc.sample.split(Y[TrainIdx], SplitRatio, group = group) : Function 'msc.sample.split' was moved to 'caTools' package under new name 'split.samples'. Sorry for inconvinience. Warning in msc.sample.split(Y[TrainIdx], SplitRatio, group = group) : Function 'msc.sample.split' was moved to 'caTools' package under new name 'split.samples'. Sorry for inconvinience. Warning in msc.sample.split(Y[TrainIdx], SplitRatio, group = group) : Function 'msc.sample.split' was moved to 'caTools' package under new name 'split.samples'. Sorry for inconvinience. Warning in msc.sample.split(Y[TrainIdx], SplitRatio, group = group) : Function 'msc.sample.split' was moved to 'caTools' package under new name 'split.samples'. Sorry for inconvinience. Warning in msc.sample.split(Y[TrainIdx], SplitRatio, group = group) : Function 'msc.sample.split' was moved to 'caTools' package under new name 'split.samples'. Sorry for inconvinience. Warning in msc.sample.split(Y[TrainIdx], SplitRatio, group = group) : Function 'msc.sample.split' was moved to 'caTools' package under new name 'split.samples'. Sorry for inconvinience. Warning in msc.sample.split(Y[TrainIdx], SplitRatio, group = group) : Function 'msc.sample.split' was moved to 'caTools' package under new name 'split.samples'. Sorry for inconvinience. Warning in msc.sample.split(Y[TrainIdx], SplitRatio, group = group) : Function 'msc.sample.split' was moved to 'caTools' package under new name 'split.samples'. Sorry for inconvinience. Warning in msc.sample.split(Y[TrainIdx], SplitRatio, group = group) : Function 'msc.sample.split' was moved to 'caTools' package under new name 'split.samples'. Sorry for inconvinience. Warning in msc.sample.split(Y[TrainIdx], SplitRatio, group = group) : Function 'msc.sample.split' was moved to 'caTools' package under new name 'split.samples'. Sorry for inconvinience. Warning in msc.sample.split(Y[TrainIdx], SplitRatio, group = group) : Function 'msc.sample.split' was moved to 'caTools' package under new name 'split.samples'. Sorry for inconvinience. Warning in msc.sample.split(Y[TrainIdx], SplitRatio, group = group) : Function 'msc.sample.split' was moved to 'caTools' package under new name 'split.samples'. Sorry for inconvinience. Warning in msc.sample.split(Y[TrainIdx], SplitRatio, group = group) : Function 'msc.sample.split' was moved to 'caTools' package under new name 'split.samples'. Sorry for inconvinience. Warning in msc.sample.split(Y[TrainIdx], SplitRatio, group = group) : Function 'msc.sample.split' was moved to 'caTools' package under new name 'split.samples'. Sorry for inconvinience. Warning in msc.sample.split(Y[TrainIdx], SplitRatio, group = group) : Function 'msc.sample.split' was moved to 'caTools' package under new name 'split.samples'. Sorry for inconvinience. Warning in msc.sample.split(Y[TrainIdx], SplitRatio, group = group) : Function 'msc.sample.split' was moved to 'caTools' package under new name 'split.samples'. Sorry for inconvinience. Warning in msc.sample.split(Y[TrainIdx], SplitRatio, group = group) : Function 'msc.sample.split' was moved to 'caTools' package under new name 'split.samples'. Sorry for inconvinience. Warning in msc.sample.split(Y[TrainIdx], SplitRatio, group = group) : Function 'msc.sample.split' was moved to 'caTools' package under new name 'split.samples'. Sorry for inconvinience. Warning in msc.sample.split(Y[TrainIdx], SplitRatio, group = group) : Function 'msc.sample.split' was moved to 'caTools' package under new name 'split.samples'. Sorry for inconvinience. Warning in msc.sample.split(Y[TrainIdx], SplitRatio, group = group) : Function 'msc.sample.split' was moved to 'caTools' package under new name 'split.samples'. Sorry for inconvinience. Warning in msc.sample.split(Y[TrainIdx], SplitRatio, group = group) : Function 'msc.sample.split' was moved to 'caTools' package under new name 'split.samples'. Sorry for inconvinience. Warning in msc.sample.split(Y[TrainIdx], SplitRatio, group = group) : Function 'msc.sample.split' was moved to 'caTools' package under new name 'split.samples'. Sorry for inconvinience. Warning in msc.sample.split(Y[TrainIdx], SplitRatio, group = group) : Function 'msc.sample.split' was moved to 'caTools' package under new name 'split.samples'. Sorry for inconvinience. Warning in msc.sample.split(Y[TrainIdx], SplitRatio, group = group) : Function 'msc.sample.split' was moved to 'caTools' package under new name 'split.samples'. Sorry for inconvinience. Warning in msc.sample.split(Y[TrainIdx], SplitRatio, group = group) : Function 'msc.sample.split' was moved to 'caTools' package under new name 'split.samples'. Sorry for inconvinience. Warning in msc.sample.split(Y[TrainIdx], SplitRatio, group = group) : Function 'msc.sample.split' was moved to 'caTools' package under new name 'split.samples'. Sorry for inconvinience. Warning in msc.sample.split(Y[TrainIdx], SplitRatio, group = group) : Function 'msc.sample.split' was moved to 'caTools' package under new name 'split.samples'. Sorry for inconvinience. Warning in msc.sample.split(Y[TrainIdx], SplitRatio, group = group) : Function 'msc.sample.split' was moved to 'caTools' package under new name 'split.samples'. Sorry for inconvinience. Warning in msc.sample.split(Y[TrainIdx], SplitRatio, group = group) : Function 'msc.sample.split' was moved to 'caTools' package under new name 'split.samples'. Sorry for inconvinience. Warning in msc.sample.split(Y[TrainIdx], SplitRatio, group = group) : Function 'msc.sample.split' was moved to 'caTools' package under new name 'split.samples'. Sorry for inconvinience. Warning in msc.sample.split(Y[TrainIdx], SplitRatio, group = group) : Function 'msc.sample.split' was moved to 'caTools' package under new name 'split.samples'. Sorry for inconvinience. Warning in msc.sample.split(Y[TrainIdx], SplitRatio, group = group) : Function 'msc.sample.split' was moved to 'caTools' package under new name 'split.samples'. Sorry for inconvinience. Warning in msc.sample.split(Y[TrainIdx], SplitRatio, group = group) : Function 'msc.sample.split' was moved to 'caTools' package under new name 'split.samples'. Sorry for inconvinience. Warning in msc.sample.split(Y[TrainIdx], SplitRatio, group = group) : Function 'msc.sample.split' was moved to 'caTools' package under new name 'split.samples'. Sorry for inconvinience. Warning in msc.sample.split(Y[TrainIdx], SplitRatio, group = group) : Function 'msc.sample.split' was moved to 'caTools' package under new name 'split.samples'. Sorry for inconvinience. Warning in msc.sample.split(Y[TrainIdx], SplitRatio, group = group) : Function 'msc.sample.split' was moved to 'caTools' package under new name 'split.samples'. Sorry for inconvinience. Warning in msc.sample.split(Y[TrainIdx], SplitRatio, group = group) : Function 'msc.sample.split' was moved to 'caTools' package under new name 'split.samples'. Sorry for inconvinience. Warning in msc.sample.split(Y[TrainIdx], SplitRatio, group = group) : Function 'msc.sample.split' was moved to 'caTools' package under new name 'split.samples'. Sorry for inconvinience. Warning in msc.sample.split(Y[TrainIdx], SplitRatio, group = group) : Function 'msc.sample.split' was moved to 'caTools' package under new name 'split.samples'. Sorry for inconvinience. > A $Y [1] setosa setosa setosa setosa setosa setosa [7] setosa setosa setosa setosa setosa [13] setosa setosa setosa setosa setosa setosa [19] setosa setosa setosa setosa setosa setosa [25] setosa setosa setosa setosa setosa setosa [31] setosa setosa setosa setosa setosa setosa [37] setosa setosa setosa setosa setosa [43] setosa setosa setosa setosa setosa setosa [49] setosa setosa versicolor versicolor virginica versicolor [55] versicolor versicolor versicolor versicolor versicolor versicolor [61] versicolor versicolor versicolor versicolor versicolor versicolor [67] versicolor versicolor versicolor versicolor versicolor [73] versicolor versicolor versicolor versicolor virginica [79] versicolor versicolor versicolor versicolor versicolor [85] versicolor versicolor versicolor versicolor versicolor versicolor [91] versicolor versicolor versicolor versicolor versicolor versicolor [97] versicolor versicolor versicolor versicolor virginica virginica [103] virginica virginica virginica virginica versicolor virginica [109] virginica virginica virginica virginica virginica virginica [115] virginica virginica virginica virginica virginica [121] virginica virginica virginica virginica virginica virginica [127] versicolor virginica virginica virginica virginica virginica [133] virginica virginica virginica virginica [139] virginica virginica virginica virginica virginica [145] virginica virginica virginica virginica virginica virginica Levels: setosa versicolor virginica $Res [1] 0.9215686 0.9215686 0.8431373 0.8823529 0.9215686 0.9019608 0.8627451 [8] 0.8627451 0.8823529 0.8431373 0.8823529 0.8431373 0.8627451 0.8039216 [15] 0.9411765 0.9215686 0.9019608 0.9019608 0.8431373 0.9607843 0.9019608 [22] 0.9019608 0.9607843 0.9607843 0.9019608 0.8627451 0.8823529 0.8823529 [29] 0.8431373 0.8823529 0.9019608 0.9215686 0.8235294 0.8823529 0.8823529 [36] 0.9215686 0.9019608 0.9019608 0.8823529 0.9019608 0.9019608 0.8431373 [43] 0.8627451 0.8823529 0.8823529 0.8627451 0.9019608 0.8823529 0.9019608 [50] 0.8823529 $Tabl true predicted setosa versicolor virginica setosa 0.93294118 0.00000000 0.00000000 versicolor 0.00000000 0.89647059 0.06588235 virginica 0.00000000 0.05882353 0.83529412 $Prob setosa versicolor virginica [1,] 0.8807971 0.5000000 0.1192029 [2,] 0.8807971 0.5000000 0.1192029 [3,] 0.8807971 0.5000000 0.1192029 [4,] 0.8807971 0.5000000 0.1192029 [5,] 0.8807971 0.5000000 0.1192029 [6,] 0.8807971 0.5000000 0.1192029 [7,] 0.8807971 0.5000000 0.1192029 [8,] 0.8807971 0.5000000 0.1192029 [9,] 0.8807971 0.8807971 0.1192029 [10,] 0.8807971 0.5000000 0.1192029 [11,] 0.8807971 0.5000000 0.1192029 [12,] 0.8807971 0.5000000 0.1192029 [13,] 0.8807971 0.5000000 0.1192029 [14,] 0.8807971 0.5000000 0.1192029 [15,] 0.8807971 0.5000000 0.1192029 [16,] 0.8807971 0.5000000 0.1192029 [17,] 0.8807971 0.5000000 0.1192029 [18,] 0.8807971 0.5000000 0.1192029 [19,] 0.8807971 0.5000000 0.1192029 [20,] 0.8807971 0.5000000 0.1192029 [21,] 0.8807971 0.5000000 0.1192029 [22,] 0.8807971 0.5000000 0.1192029 [23,] 0.8807971 0.5000000 0.1192029 [24,] 0.8807971 0.5000000 0.1192029 [25,] 0.8807971 0.5000000 0.1192029 [26,] 0.8807971 0.5000000 0.1192029 [27,] 0.8807971 0.5000000 0.1192029 [28,] 0.8807971 0.5000000 0.1192029 [29,] 0.8807971 0.5000000 0.1192029 [30,] 0.8807971 0.5000000 0.1192029 [31,] 0.8807971 0.5000000 0.1192029 [32,] 0.8807971 0.5000000 0.1192029 [33,] 0.8807971 0.5000000 0.1192029 [34,] 0.8807971 0.5000000 0.1192029 [35,] 0.8807971 0.5000000 0.1192029 [36,] 0.8807971 0.5000000 0.1192029 [37,] 0.8807971 0.5000000 0.1192029 [38,] 0.8807971 0.5000000 0.1192029 [39,] 0.8807971 0.5000000 0.1192029 [40,] 0.8807971 0.5000000 0.1192029 [41,] 0.8807971 0.5000000 0.1192029 [42,] 0.8807971 0.8807971 0.1192029 [43,] 0.8807971 0.5000000 0.1192029 [44,] 0.8807971 0.5000000 0.1192029 [45,] 0.8807971 0.5000000 0.1192029 [46,] 0.8807971 0.5000000 0.1192029 [47,] 0.8807971 0.5000000 0.1192029 [48,] 0.8807971 0.5000000 0.1192029 [49,] 0.8807971 0.5000000 0.1192029 [50,] 0.8807971 0.5000000 0.1192029 [51,] 0.1192029 0.5000000 0.1192029 [52,] 0.1192029 0.5000000 0.1192029 [53,] 0.1192029 0.1192029 0.5000000 [54,] 0.1192029 0.8807971 0.1192029 [55,] 0.1192029 0.8807971 0.1192029 [56,] 0.1192029 0.8807971 0.1192029 [57,] 0.1192029 0.5000000 0.1192029 [58,] 0.1192029 0.8807971 0.1192029 [59,] 0.1192029 0.8807971 0.1192029 [60,] 0.1192029 0.8807971 0.1192029 [61,] 0.1192029 0.8807971 0.1192029 [62,] 0.1192029 0.5000000 0.1192029 [63,] 0.1192029 0.8807971 0.1192029 [64,] 0.1192029 0.8807971 0.1192029 [65,] 0.1192029 0.8807971 0.1192029 [66,] 0.1192029 0.5000000 0.1192029 [67,] 0.1192029 0.5000000 0.1192029 [68,] 0.1192029 0.8807971 0.1192029 [69,] 0.1192029 0.8807971 0.1192029 [70,] 0.1192029 0.8807971 0.1192029 [71,] 0.1192029 0.5000000 0.5000000 [72,] 0.1192029 0.8807971 0.1192029 [73,] 0.1192029 0.5000000 0.5000000 [74,] 0.1192029 0.8807971 0.1192029 [75,] 0.1192029 0.8807971 0.1192029 [76,] 0.1192029 0.5000000 0.1192029 [77,] 0.1192029 0.8807971 0.1192029 [78,] 0.1192029 0.1192029 0.8807971 [79,] 0.1192029 0.8807971 0.1192029 [80,] 0.1192029 0.8807971 0.1192029 [81,] 0.1192029 0.8807971 0.1192029 [82,] 0.1192029 0.8807971 0.1192029 [83,] 0.1192029 0.8807971 0.1192029 [84,] 0.1192029 0.5000000 0.5000000 [85,] 0.1192029 0.5000000 0.1192029 [86,] 0.1192029 0.5000000 0.1192029 [87,] 0.1192029 0.5000000 0.1192029 [88,] 0.1192029 0.8807971 0.1192029 [89,] 0.1192029 0.5000000 0.1192029 [90,] 0.1192029 0.8807971 0.1192029 [91,] 0.1192029 0.8807971 0.1192029 [92,] 0.1192029 0.5000000 0.1192029 [93,] 0.1192029 0.8807971 0.1192029 [94,] 0.1192029 0.8807971 0.1192029 [95,] 0.1192029 0.8807971 0.1192029 [96,] 0.1192029 0.5000000 0.1192029 [97,] 0.1192029 0.8807971 0.1192029 [98,] 0.1192029 0.8807971 0.1192029 [99,] 0.1192029 0.8807971 0.1192029 [100,] 0.1192029 0.8807971 0.1192029 [101,] 0.1192029 0.1192029 0.8807971 [102,] 0.1192029 0.5000000 0.8807971 [103,] 0.1192029 0.1192029 0.8807971 [104,] 0.1192029 0.5000000 0.8807971 [105,] 0.1192029 0.1192029 0.8807971 [106,] 0.1192029 0.1192029 0.8807971 [107,] 0.1192029 0.8807971 0.5000000 [108,] 0.1192029 0.5000000 0.8807971 [109,] 0.1192029 0.5000000 0.8807971 [110,] 0.1192029 0.1192029 0.8807971 [111,] 0.1192029 0.1192029 0.8807971 [112,] 0.1192029 0.5000000 0.8807971 [113,] 0.1192029 0.1192029 0.8807971 [114,] 0.1192029 0.5000000 0.8807971 [115,] 0.1192029 0.5000000 0.8807971 [116,] 0.1192029 0.1192029 0.8807971 [117,] 0.1192029 0.1192029 0.8807971 [118,] 0.1192029 0.1192029 0.8807971 [119,] 0.1192029 0.5000000 0.8807971 [120,] 0.1192029 0.5000000 0.5000000 [121,] 0.1192029 0.1192029 0.8807971 [122,] 0.1192029 0.5000000 0.8807971 [123,] 0.1192029 0.5000000 0.8807971 [124,] 0.1192029 0.5000000 0.8807971 [125,] 0.1192029 0.1192029 0.8807971 [126,] 0.1192029 0.1192029 0.8807971 [127,] 0.1192029 0.8807971 0.5000000 [128,] 0.1192029 0.1192029 0.8807971 [129,] 0.1192029 0.5000000 0.8807971 [130,] 0.1192029 0.1192029 0.5000000 [131,] 0.1192029 0.5000000 0.8807971 [132,] 0.1192029 0.1192029 0.8807971 [133,] 0.1192029 0.5000000 0.8807971 [134,] 0.1192029 0.5000000 0.5000000 [135,] 0.1192029 0.5000000 0.5000000 [136,] 0.1192029 0.1192029 0.8807971 [137,] 0.1192029 0.1192029 0.8807971 [138,] 0.1192029 0.1192029 0.8807971 [139,] 0.1192029 0.5000000 0.5000000 [140,] 0.1192029 0.1192029 0.8807971 [141,] 0.1192029 0.1192029 0.8807971 [142,] 0.1192029 0.1192029 0.8807971 [143,] 0.1192029 0.5000000 0.8807971 [144,] 0.1192029 0.1192029 0.8807971 [145,] 0.1192029 0.1192029 0.8807971 [146,] 0.1192029 0.1192029 0.8807971 [147,] 0.1192029 0.5000000 0.8807971 [148,] 0.1192029 0.1192029 0.8807971 [149,] 0.1192029 0.1192029 0.8807971 [150,] 0.1192029 0.1192029 0.8807971 > cat("correct classification in",100*mean(A$Res),"+-",100*sd(A$Res),"percent of cases\n") correct classification in 88.82353 +- 3.367175 percent of cases > > > > cleanEx(); ..nameEx <- "msc.copies.merge" > > ### * msc.copies.merge > > flush(stderr()); flush(stdout()) > > ### Name: msc.copies.merge > ### Title: Merge Multiple Copies of Mass Spectra Samples > ### Aliases: msc.copies.merge > ### Keywords: ts > > ### ** Examples > > # load input data > if (!file.exists("Data_IMAC.Rdata")) example("msc.project.read") > load("Data_IMAC.Rdata") > > # run msc.copies.merge > Y = msc.copies.merge(X, 1+2+4) > colnames(Y) [1] "avr(cancer_01)" "avr(cancer_02)" "avr(cancer_03)" "avr(cancer_04)" [5] "avr(cancer_05)" "avr(cancer_06)" "avr(cancer_07)" "avr(cancer_08)" [9] "avr(cancer_09)" "avr(cancer_10)" "avr(normal_01)" "avr(normal_02)" [13] "avr(normal_03)" "avr(normal_04)" "avr(normal_05)" "avr(normal_06)" [17] "avr(normal_07)" "avr(normal_08)" "avr(normal_09)" "avr(normal_10)" [21] "cancer_01(1)" "cancer_02(1)" "cancer_03(1)" "cancer_04(1)" [25] "cancer_05(1)" "cancer_06(1)" "cancer_07(1)" "cancer_08(1)" [29] "cancer_09(1)" "cancer_10(1)" "normal_01(1)" "normal_02(1)" [33] "normal_03(1)" "normal_04(1)" "normal_05(1)" "normal_06(1)" [37] "normal_07(1)" "normal_08(1)" "normal_09(1)" "normal_10(1)" [41] "cancer_01(2)" "cancer_02(2)" "cancer_03(2)" "cancer_04(2)" [45] "cancer_05(2)" "cancer_06(2)" "cancer_07(2)" "cancer_08(2)" [49] "cancer_09(2)" "cancer_10(2)" "normal_01(2)" "normal_02(2)" [53] "normal_03(2)" "normal_04(2)" "normal_05(2)" "normal_06(2)" [57] "normal_07(2)" "normal_08(2)" "normal_09(2)" "normal_10(2)" > > > > cleanEx(); ..nameEx <- "msc.features.remove" > > ### * msc.features.remove > > flush(stderr()); flush(stdout()) > > ### Name: msc.features.remove > ### Title: Remove Highly Correlated Features > ### Aliases: msc.features.remove > ### Keywords: ts classif > > ### ** Examples > > # load input data > if (!file.exists("Data_IMAC.Rdata")) example("msc.project.read") > load("Data_IMAC.Rdata") > > X = t(X[,,1]) > auc = colAUC(X,SampleLabels) > quantile(auc) 0% 25% 50% 75% 100% 0.50 0.56 0.62 0.70 1.00 > cidx = msc.features.remove(X, auc, verbose=TRUE) [1] "iteration nCol nLeads" [1] " 1 11883 11882" [1] " 2 4276 2744" [1] " 3 3591 450" [1] " 4 3525 49" [1] " 5 3516 8" [1] " 6 3516 0" > Y = X[,cidx] > > > > cleanEx(); ..nameEx <- "msc.features.scale" > > ### * msc.features.scale > > flush(stderr()); flush(stdout()) > > ### Name: msc.features.scale > ### Title: Scale Classification Data > ### Aliases: msc.features.scale > ### Keywords: classif > > ### ** Examples > > library(e1071) > data(iris) > mask = msc.sample.split(iris[,5], SplitRatio=1/4) # very few points to train Warning in msc.sample.split(iris[, 5], SplitRatio = 1/4) : Function 'msc.sample.split' was moved to 'caTools' package under new name 'split.samples'. Sorry for inconvinience. > xtrain = iris[ mask,-5] # use output of msc.sample.split to ... > xtest = iris[!mask,-5] # create train and test subsets > ytrain = iris[ mask, 5] > ytest = iris[!mask, 5] > x = msc.features.scale(xtrain, xtest) > model = svm(x$xtrain, ytrain, scale=FALSE) > table(predict(model, x$xtest), ytest) ytest setosa versicolor virginica setosa 38 0 0 versicolor 0 38 12 virginica 0 0 26 > model = svm(xtrain, ytrain, scale=FALSE) > table(predict(model, xtest), ytest) ytest setosa versicolor virginica setosa 38 0 0 versicolor 0 38 4 virginica 0 0 34 > > > > cleanEx(); ..nameEx <- "msc.features.select" > > ### * msc.features.select > > flush(stderr()); flush(stdout()) > > ### Name: msc.features.select > ### Title: Reduce Number of Features Prior to Classification > ### Aliases: msc.features.select > ### Keywords: classif > > ### ** Examples > > # load input data > if (!file.exists("Data_IMAC.Rdata")) example("msc.project.read") > load("Data_IMAC.Rdata") > > X = t(X[,,1]) > cidx = msc.features.select(X, SampleLabels, KeepCol=0.7) > cat(length(cidx),"features were selected out of",ncol(X),"min(auc)=0.7\n") 2051 features were selected out of 11883 min(auc)=0.7 > cidx = msc.features.select(X, SampleLabels, KeepCol=400) > cat(length(cidx),"features were selected out of",ncol(X),"\n") 400 features were selected out of 11883 > cat(" min(auc)=", min(colAUC(X[,cidx], SampleLabels)),"\n") min(auc)= 0.83 > Y = X[,cidx] > > > > cleanEx(); ..nameEx <- "msc.mass.adjust" > > ### * msc.mass.adjust > > flush(stderr()); flush(stdout()) > > ### Name: msc.mass.adjust > ### Title: Perform Normalization and Mass Drift Adjustment for Mass Spectra > ### Data. > ### Aliases: msc.mass.adjust msc.mass.adjust.apply msc.mass.adjust.calc > ### Keywords: ts > > ### ** Examples > > # load input data > if (!file.exists("Data_IMAC.Rdata")) example("msc.project.read") > load("Data_IMAC.Rdata") > > # run on 3D input data using long syntax > out = msc.mass.adjust.calc (X) > Y = msc.mass.adjust.apply(X, out$ShiftX, out$ScaleY, out$ShiftY) > > # check what happened to means > Z = cbind(colMeans(X), colMeans(Y)) > colnames(Z) = c("copy 1 before", "copy 2 before", "copy 1 after", "copy 2 after" ) > cat("Sample means after and after:\n") Sample means after and after: > Z copy 1 before copy 2 before copy 1 after copy 2 after cancer_01 0.6037046 0.5855511 0.6908872 0.6912799 cancer_02 0.6190209 0.5793421 0.6911989 0.6911909 cancer_03 0.5532459 0.6789047 0.6910405 0.6911959 cancer_04 0.6798570 0.6684816 0.6912034 0.6911215 cancer_05 0.7543402 1.0182934 0.6912071 0.6912755 cancer_06 0.7525662 0.7574410 0.6911379 0.6912918 cancer_07 0.8791013 0.7301935 0.6913685 0.6909545 cancer_08 0.6133923 0.7629808 0.6912269 0.6912301 cancer_09 0.5973236 0.6738924 0.6911285 0.6911253 cancer_10 0.6371509 0.5850878 0.6911219 0.6911225 normal_01 0.5865622 0.5859988 0.6912620 0.6911364 normal_02 0.6839491 0.5680698 0.6905649 0.6911107 normal_03 0.6220353 0.6521835 0.6911319 0.6911319 normal_04 0.6606052 0.6765638 0.6911412 0.6911211 normal_05 0.7242335 0.6146538 0.6911229 0.6911256 normal_06 0.5375892 0.6051525 0.6911446 0.6911520 normal_07 0.7352464 0.6151361 0.6911319 0.6911319 normal_08 0.9610972 0.8938676 0.6911257 0.6911280 normal_09 0.7475076 0.6139081 0.6912124 0.6912163 normal_10 0.8742606 0.7525992 0.6911238 0.6911281 > > # check what happen to sample correlation > A = msc.sample.correlation(X, PeaksOnly=TRUE) > B = msc.sample.correlation(Y, PeaksOnly=TRUE) > cat("Mean corelation between two copies of the same sample:\n") Mean corelation between two copies of the same sample: > cat(" before: ", mean(A$innerCor)," after: ", mean(B$innerCor), "\n") before: 0.8997452 after: 0.9107214 > cat("Mean corelation between unrelated samples:\n") Mean corelation between unrelated samples: > cat(" before: ", mean(A$outerCor)," after: ", mean(B$outerCor), "\n") before: 0.7489782 after: 0.7897508 > > # run on 2D input data using short syntax > # check what happened to means and medians > Y = msc.mass.adjust(X[,,1], scalePar=2) > Z = cbind(colMeans(X[,,1]), apply(X[,,1],2,median), colMeans(Y), apply(Y,2,median)) > colnames(Z) = c("means before", "medians before", "means after", "medians after" ) > Z means before medians before means after medians after cancer_01 0.6037046 0.1519939 0.6908935 0.1865748 cancer_02 0.6190209 0.1480618 0.6912076 0.1871891 cancer_03 0.5532459 0.1320468 0.6910477 0.1871888 cancer_04 0.6798570 0.1734967 0.6912121 0.1871891 cancer_05 0.7543402 0.1774887 0.6913077 0.1871891 cancer_06 0.7525662 0.1617795 0.6912961 0.1871891 cancer_07 0.8791013 0.1828753 0.6913591 0.1871891 cancer_08 0.6133923 0.1504167 0.6911338 0.1871891 cancer_09 0.5973236 0.1490367 0.6911365 0.1871891 cancer_10 0.6371509 0.1366210 0.6911305 0.1871891 normal_01 0.5865622 0.1593115 0.6911382 0.1871891 normal_02 0.6839491 0.1634680 0.6905667 0.1871170 normal_03 0.6220353 0.1586889 0.6911395 0.1871891 normal_04 0.6606052 0.1755848 0.6911371 0.1871891 normal_05 0.7242335 0.1664355 0.6911314 0.1871891 normal_06 0.5375892 0.1273939 0.6911268 0.1871891 normal_07 0.7352464 0.1822692 0.6911395 0.1871891 normal_08 0.9610972 0.2036835 0.6911337 0.1871891 normal_09 0.7475076 0.1917133 0.6911360 0.1871891 normal_10 0.8742606 0.1745725 0.6911318 0.1871891 > Y = msc.mass.adjust(X[,,1], scalePar=1) > Z = cbind(colMeans(X[,,1]), apply(X[,,1],2,median), colMeans(Y), apply(Y,2,median)) > colnames(Z) = c("means before", "medians before", "means after", "medians after" ) > Z means before medians before means after medians after cancer_01 0.6037046 0.1519939 0.6908901 0.1733769 cancer_02 0.6190209 0.1480618 0.6912131 0.1653116 cancer_03 0.5532459 0.1320468 0.6910462 0.1649585 cancer_04 0.6798570 0.1734967 0.6912149 0.1763759 cancer_05 0.7543402 0.1774887 0.6913188 0.1626182 cancer_06 0.7525662 0.1617795 0.6913170 0.1485746 cancer_07 0.8791013 0.1828753 0.6913881 0.1437745 cancer_08 0.6133923 0.1504167 0.6911377 0.1694819 cancer_09 0.5973236 0.1490367 0.6911382 0.1724445 cancer_10 0.6371509 0.1366210 0.6911388 0.1481975 normal_01 0.5865622 0.1593115 0.6911381 0.1877149 normal_02 0.6839491 0.1634680 0.6905493 0.1651113 normal_03 0.6220353 0.1586889 0.6911395 0.1763182 normal_04 0.6606052 0.1755848 0.6911375 0.1837007 normal_05 0.7242335 0.1664355 0.6911375 0.1588302 normal_06 0.5375892 0.1273939 0.6911316 0.1637812 normal_07 0.7352464 0.1822692 0.6911395 0.1713350 normal_08 0.9610972 0.2036835 0.6911379 0.1464719 normal_09 0.7475076 0.1917133 0.6911371 0.1772566 normal_10 0.8742606 0.1745725 0.6911367 0.1380069 > > # mass adjustment for train and test sets, where test set is normalized in > # the same way as train set was > Xtrain = X[, 1:10,] > Xtest = X[,11:20,] > out = msc.mass.adjust.calc (Xtrain); > Xtrain = msc.mass.adjust.apply(Xtrain, out$ShiftX, out$ScaleY, out$ShiftY) > out = msc.mass.adjust.calc (Xtest , AvrSamp=out$AvrSamp); > Xtest = msc.mass.adjust.apply(Xtest , out$ShiftX, out$ScaleY, out$ShiftY) > > > > cleanEx(); ..nameEx <- "msc.mass.cut" > > ### * msc.mass.cut > > flush(stderr()); flush(stdout()) > > ### Name: msc.mass.cut > ### Title: Remove Low Mass Portion of the Mass Spectra Data. > ### Aliases: msc.mass.cut > ### Keywords: ts > > ### ** Examples > > # load input data > if (!file.exists("Data_IMAC.Rdata")) example("msc.project.read") > load("Data_IMAC.Rdata") > > # run in 3D input > Y = msc.mass.cut( X, MinMass=3000) > cat("Size before: ", dim(X), " and after :", dim(Y), "\n") Size before: 11883 20 2 and after : 9377 20 2 > > # test on data provided in PROcess package (2D input) > directory = system.file("Test", package = "PROcess") > X = msc.msfiles.read.csv(directory) > Y = msc.mass.cut( X, MinMass=4000) > cat("Size before: ", dim(X), " and after :", dim(Y), "\n") Size before: 13280 2 and after : 7439 2 > > > > > cleanEx(); ..nameEx <- "msc.msfiles.read.csv" > > ### * msc.msfiles.read.csv > > flush(stderr()); flush(stdout()) > > ### Name: msc.msfiles.read.csv > ### Title: Read Protein Mass Spectra from CSV files > ### Aliases: msc.msfiles.read.csv > ### Keywords: ts file > > ### ** Examples > > # example of mode "single string" FileList > directory = system.file("Test", package = "caMassClass") > X = msc.msfiles.read.csv(directory, "IMAC_normal_.*csv") > dim(X) [1] 11883 20 > > # example of explicite 1D FileList > ProjectFile = file.path(directory,"InputFiles.csv") > FileList = read.csv(file=ProjectFile, comment.char = "") > FileList[,3] [1] IMAC_cancer.zip/IMAC_cancer_01(1).csv [2] IMAC_cancer.zip/IMAC_cancer_02(1).csv [3] IMAC_cancer.zip/IMAC_cancer_03(1).csv [4] IMAC_cancer.zip/IMAC_cancer_04(1).csv [5] IMAC_cancer.zip/IMAC_cancer_05(1).csv [6] IMAC_cancer.zip/IMAC_cancer_06(1).csv [7] IMAC_cancer.zip/IMAC_cancer_07(1).csv [8] IMAC_cancer.zip/IMAC_cancer_08(1).csv [9] IMAC_cancer.zip/IMAC_cancer_09(1).csv [10] IMAC_cancer.zip/IMAC_cancer_10(1).csv [11] IMAC_normal_01(1).csv [12] IMAC_normal_02(1).csv [13] IMAC_normal_03(1).csv [14] IMAC_normal_04(1).csv [15] IMAC_normal_05(1).csv [16] IMAC_normal_06(1).csv [17] IMAC_normal_07(1).csv [18] IMAC_normal_08(1).csv [19] IMAC_normal_09(1).csv [20] IMAC_normal_10(1).csv 20 Levels: IMAC_cancer.zip/IMAC_cancer_01(1).csv ... > X = msc.msfiles.read.csv(directory, FileList=FileList[,3], SampleNames=FileList[,1]) > dim(X) [1] 11883 20 > > # example of explicite 2D FileList > FileList[,3:4] IMAC1 1 IMAC_cancer.zip/IMAC_cancer_01(1).csv 2 IMAC_cancer.zip/IMAC_cancer_02(1).csv 3 IMAC_cancer.zip/IMAC_cancer_03(1).csv 4 IMAC_cancer.zip/IMAC_cancer_04(1).csv 5 IMAC_cancer.zip/IMAC_cancer_05(1).csv 6 IMAC_cancer.zip/IMAC_cancer_06(1).csv 7 IMAC_cancer.zip/IMAC_cancer_07(1).csv 8 IMAC_cancer.zip/IMAC_cancer_08(1).csv 9 IMAC_cancer.zip/IMAC_cancer_09(1).csv 10 IMAC_cancer.zip/IMAC_cancer_10(1).csv 11 IMAC_normal_01(1).csv 12 IMAC_normal_02(1).csv 13 IMAC_normal_03(1).csv 14 IMAC_normal_04(1).csv 15 IMAC_normal_05(1).csv 16 IMAC_normal_06(1).csv 17 IMAC_normal_07(1).csv 18 IMAC_normal_08(1).csv 19 IMAC_normal_09(1).csv 20 IMAC_normal_10(1).csv IMAC2 1 IMAC_cancer.zip/IMAC_cancer_01(2).csv 2 IMAC_cancer.zip/IMAC_cancer_02(2).csv 3 IMAC_cancer.zip/IMAC_cancer_03(2).csv 4 IMAC_cancer.zip/IMAC_cancer_04(2).csv 5 IMAC_cancer.zip/IMAC_cancer_05(2).csv 6 IMAC_cancer.zip/IMAC_cancer_06(2).csv 7 IMAC_cancer.zip/IMAC_cancer_07(2).csv 8 IMAC_cancer.zip/IMAC_cancer_08(2).csv 9 IMAC_cancer.zip/IMAC_cancer_09(2).csv 10 IMAC_cancer.zip/IMAC_cancer_10(2).csv 11 IMAC_normal_01(2).csv 12 IMAC_normal_02(2).csv 13 IMAC_normal_03(2).csv 14 IMAC_normal_04(2).csv 15 IMAC_normal_05(2).csv 16 IMAC_normal_06(2).csv 17 IMAC_normal_07(2).csv 18 IMAC_normal_08(2).csv 19 IMAC_normal_09(2).csv 20 IMAC_normal_10(2).csv > X = msc.msfiles.read.csv(directory, FileList=FileList[,3:4], + SampleNames=FileList[,1], CopyNames=c("copy 1", "copy 2")) > dim(X) [1] 11883 20 2 > > > > cleanEx(); ..nameEx <- "msc.peaks.align" > > ### * msc.peaks.align > > flush(stderr()); flush(stdout()) > > ### Name: msc.peaks.align > ### Title: Align Peaks of Mass Spectra into a "Biomarker" Matrix > ### Aliases: msc.peaks.align msc.peaks.alignment > ### Keywords: ts > > ### ** Examples > > # load input data > if (!file.exists("Data_IMAC.Rdata")) example("msc.project.read") > load("Data_IMAC.Rdata") > > # Find and Align peaks > Peaks = msc.peaks.find(X) > cat(nrow(Peaks), "peaks were found in", Peaks[nrow(Peaks),2], "files.\n") 823 peaks were found in 40 files. > Y = msc.peaks.align(Peaks) > print( t(Y$Bmrks) , na.print=".", digits=2) M2959.86 M3893.45 M3966.43 M3981.58 M4292.97 M4478.38 M4654.46 cancer_01(1) 0.52 0.99 1.67 1.67 0.436 0.44 1.43 cancer_02(1) 0.50 0.94 1.29 . 0.208 . 1.12 cancer_03(1) 0.52 0.87 1.14 . . . 0.87 cancer_04(1) 0.54 1.32 1.58 . . 0.25 1.26 cancer_05(1) 0.45 0.97 1.54 . 0.322 0.48 1.50 cancer_06(1) 0.86 0.94 . . . 0.48 1.34 cancer_07(1) 0.58 1.16 . . . . 1.48 cancer_08(1) 0.47 1.44 1.76 . 0.367 0.53 1.21 cancer_09(1) 0.47 1.10 1.43 . . 0.58 1.47 cancer_10(1) 0.53 1.30 2.13 . 0.354 . 1.67 normal_01(1) 0.53 1.31 . 2.12 0.476 . 1.27 normal_02(1) 0.52 1.13 . . . . 1.76 normal_03(1) 0.54 1.02 1.32 . 0.255 . 1.10 normal_04(1) 0.90 1.08 . . . . 1.33 normal_05(1) 0.45 1.42 1.59 1.16 0.463 . 1.26 normal_06(1) 0.88 0.78 . . . . 0.97 normal_07(1) 0.50 1.12 . . . . 1.35 normal_08(1) . 1.84 1.65 . . . 2.05 normal_09(1) 0.58 1.24 1.77 1.40 0.421 . 1.24 normal_10(1) 0.53 1.16 . 1.16 0.478 0.48 1.27 cancer_01(2) 0.60 0.97 1.38 1.38 0.369 . 1.29 cancer_02(2) 0.75 1.11 1.34 . 0.332 . 1.44 cancer_03(2) 0.57 1.03 1.18 . . . 1.17 cancer_04(2) 0.70 1.36 1.47 . . 0.32 1.45 cancer_05(2) 0.64 1.50 2.26 . 0.567 0.77 1.76 cancer_06(2) 0.75 1.18 . . 0.331 0.59 1.54 cancer_07(2) 0.95 1.21 1.71 . 0.550 0.56 1.62 cancer_08(2) 0.47 1.33 1.60 . 0.304 0.55 1.36 cancer_09(2) . 1.06 1.47 . 0.224 0.56 1.47 cancer_10(2) 0.38 1.36 1.84 1.52 0.292 . 1.52 normal_01(2) 0.38 1.58 . 2.29 0.756 . 1.62 normal_02(2) 0.37 0.95 . . . 0.42 1.23 normal_03(2) 0.77 1.18 1.76 1.32 0.364 . 1.38 normal_04(2) 0.34 0.93 . . . . 1.28 normal_05(2) 0.42 1.51 2.39 1.97 0.374 . 1.51 normal_06(2) 1.22 0.77 . . . . 0.88 normal_07(2) 0.50 1.22 . 0.86 . . 1.25 normal_08(2) . 1.53 1.31 . . . 1.85 normal_09(2) 0.61 0.51 0.83 0.83 0.083 . 0.54 normal_10(2) . 1.11 . 0.91 0.638 0.40 1.29 M4758.42 M5348.72 M5916.53 M6123.01 M6954.25 M7778.77 M8154.85 cancer_01(1) 0.69 0.48 4.0 1.19 0.53 4.1 0.80 cancer_02(1) 0.67 0.49 4.0 1.09 . 3.5 0.86 cancer_03(1) . 0.67 5.1 1.49 . 3.5 0.87 cancer_04(1) 0.67 0.72 3.4 1.09 0.62 3.5 0.83 cancer_05(1) 0.88 0.25 1.4 0.70 0.52 2.9 0.89 cancer_06(1) 0.76 0.59 4.5 1.40 . 3.4 0.83 cancer_07(1) 0.82 0.45 4.6 1.65 . 2.4 0.66 cancer_08(1) 0.74 0.30 2.8 1.03 . 5.4 1.15 cancer_09(1) 0.83 0.35 2.7 0.81 . 5.0 1.28 cancer_10(1) 0.84 0.38 3.1 1.01 . 5.0 0.99 normal_01(1) . 1.14 4.3 1.33 . 4.1 0.78 normal_02(1) 0.90 0.28 2.7 0.88 . 3.7 0.80 normal_03(1) . 0.69 3.9 1.27 . 2.3 0.65 normal_04(1) . 0.67 3.3 1.48 . 2.6 0.85 normal_05(1) 0.76 0.35 3.5 1.23 . 3.4 0.77 normal_06(1) . 1.36 7.2 2.56 0.48 2.1 0.50 normal_07(1) 0.66 0.46 3.5 1.16 0.60 3.8 0.67 normal_08(1) 0.89 . 1.5 . 0.48 2.8 0.75 normal_09(1) . 0.26 2.4 0.91 0.67 2.7 0.74 normal_10(1) . 0.21 1.7 0.66 0.69 1.5 0.38 cancer_01(2) 0.69 0.64 4.7 1.52 0.74 3.3 0.94 cancer_02(2) 0.95 0.77 4.8 1.49 . 3.7 1.11 cancer_03(2) . 1.13 6.3 1.88 . 4.5 0.99 cancer_04(2) . 0.78 4.5 1.34 0.55 4.1 0.86 cancer_05(2) 1.11 0.47 1.4 0.52 . 3.1 1.13 cancer_06(2) 0.82 0.36 2.9 1.00 . 3.2 0.89 cancer_07(2) 0.92 0.38 3.4 1.19 . 2.5 0.68 cancer_08(2) 0.80 0.25 1.8 0.69 . 3.0 0.92 cancer_09(2) . 0.19 1.2 . . 4.6 1.00 cancer_10(2) 0.85 0.31 2.8 0.80 0.44 5.0 1.01 normal_01(2) . 0.62 3.0 1.18 . 4.2 1.23 normal_02(2) 0.72 0.48 3.9 1.04 0.41 4.3 0.75 normal_03(2) 0.78 0.68 4.8 1.38 . 3.8 0.78 normal_04(2) 0.77 0.48 4.2 1.39 . 5.0 0.92 normal_05(2) 0.71 0.48 2.8 0.92 . 4.2 0.83 normal_06(2) . 1.78 8.3 3.30 . 2.0 0.48 normal_07(2) 0.78 0.34 3.4 1.18 0.39 4.7 0.88 normal_08(2) . 0.26 1.7 0.72 0.56 2.8 0.72 normal_09(2) . . 4.1 1.35 . 2.0 0.32 normal_10(2) . . 1.2 . 0.76 1.9 0.52 M8615.99 M8945.9 M9071.32 M9300.7 M9507.71 M10271.3 M11740.1 cancer_01(1) 0.31 1.14 . 5.0 2.00 0.28 0.26 cancer_02(1) . 0.90 . 4.4 1.84 0.22 . cancer_03(1) 0.29 1.09 . 3.8 1.38 . 0.25 cancer_04(1) 0.33 0.90 . 3.5 1.37 0.29 0.21 cancer_05(1) 0.39 1.69 . 4.6 2.07 . 0.26 cancer_06(1) . 1.52 . 4.5 1.83 . 0.22 cancer_07(1) . . 0.83 3.2 1.73 . . cancer_08(1) . 1.56 1.02 4.9 1.68 0.54 . cancer_09(1) 0.54 2.22 1.32 5.7 2.65 . 0.38 cancer_10(1) . 1.08 0.75 5.8 2.37 . . normal_01(1) 0.28 0.97 . 4.7 1.65 . 0.37 normal_02(1) . 1.11 . 6.7 2.53 . 0.28 normal_03(1) 0.37 1.17 0.84 3.9 1.72 . . normal_04(1) . 0.51 . 3.4 1.46 0.38 . normal_05(1) 0.31 0.73 0.65 4.2 1.76 0.31 0.27 normal_06(1) 0.35 0.50 . 2.9 0.94 . . normal_07(1) . 0.75 0.60 5.6 1.81 0.34 0.49 normal_08(1) . 0.77 0.82 4.7 2.13 0.66 0.49 normal_09(1) . 0.68 . 3.0 1.34 . 0.61 normal_10(1) 0.95 1.28 . 2.8 1.43 0.24 0.41 cancer_01(2) 0.49 1.11 . 4.3 2.02 0.25 0.23 cancer_02(2) . 0.88 . 3.9 1.66 . . cancer_03(2) . 1.11 . 4.4 1.53 . 0.29 cancer_04(2) . 1.00 . 4.6 1.50 0.36 . cancer_05(2) 0.50 1.66 . 3.8 1.73 . . cancer_06(2) 0.43 1.74 . 4.8 1.94 . 0.27 cancer_07(2) 0.23 1.46 . 4.1 1.76 . 1.34 cancer_08(2) 0.45 1.51 1.08 3.8 1.99 0.62 0.33 cancer_09(2) 0.27 2.25 . 5.2 2.17 . 0.38 cancer_10(2) . 1.05 . 5.7 2.27 . 0.27 normal_01(2) 0.63 1.24 . 4.3 2.53 0.29 0.33 normal_02(2) . 1.16 0.90 5.9 2.14 . 0.24 normal_03(2) 0.35 1.15 . 5.2 1.69 . . normal_04(2) 0.39 1.27 . 5.7 2.36 0.44 . normal_05(2) 0.37 0.67 0.67 5.8 1.65 0.30 0.47 normal_06(2) 0.30 0.51 . 2.7 1.07 . . normal_07(2) . 0.95 0.79 5.5 2.36 0.37 0.40 normal_08(2) 0.43 0.82 0.77 4.6 2.13 0.52 0.46 normal_09(2) . 0.37 . 2.3 0.79 . 0.37 normal_10(2) 1.02 1.78 . 2.9 1.28 0.33 0.50 M13895.5 cancer_01(1) 0.78 cancer_02(1) 0.67 cancer_03(1) 0.56 cancer_04(1) 0.82 cancer_05(1) 0.78 cancer_06(1) . cancer_07(1) . cancer_08(1) . cancer_09(1) 0.75 cancer_10(1) 0.70 normal_01(1) . normal_02(1) . normal_03(1) . normal_04(1) . normal_05(1) . normal_06(1) . normal_07(1) 1.13 normal_08(1) 0.78 normal_09(1) 1.11 normal_10(1) 1.09 cancer_01(2) 0.70 cancer_02(2) . cancer_03(2) . cancer_04(2) 0.75 cancer_05(2) . cancer_06(2) . cancer_07(2) . cancer_08(2) 0.72 cancer_09(2) 0.72 cancer_10(2) 0.79 normal_01(2) . normal_02(2) 0.87 normal_03(2) . normal_04(2) 0.64 normal_05(2) 0.68 normal_06(2) . normal_07(2) 0.99 normal_08(2) 0.82 normal_09(2) . normal_10(2) 1.22 > > > > cleanEx(); ..nameEx <- "msc.peaks.clust" > > ### * msc.peaks.clust > > flush(stderr()); flush(stdout()) > > ### Name: msc.peaks.clust > ### Title: Clusters Peaks of Mass Spectra > ### Aliases: msc.peaks.clust > ### Keywords: ts > > ### ** Examples > > # example with simple made up data (18 peaks, 3 samples) > M = c(1,5,8,12,17,22, 3,5,7,11,14,25, 1, 5, 7,10,17,21) # peak position/mass > S = c(1,1,1, 1, 1, 1, 2,2,2, 2, 2, 2, 3, 3, 3, 3, 3, 3) # peak's sample number > idx = sort(M, index=TRUE)$ix; # sort peaks by mass > M = M[idx]; # sorted mass > S = S[idx]; # arrange sample numbers in the same order > bin = msc.peaks.clust(diff(M), S, verbose=TRUE) [1] "Stack #Gaps [parent_bin ](bin_size) -> [Left_child ](#reps bin_size) + [right_child](#reps bin_size) gap_chosen" [1] " 1 1 [ 1 18](24.00000) -> [ 1 15]( 12, 16.0000) + [ 16 18]( 0, 4.0000) gap=4.0000" [1] " 1 1 [ 1 15](16.00000) -> [ 1 13]( 10, 13.0000) + [ 14 15]( 0, 0.0000) gap=3.0000" [1] " 2 5 [ 1 13](13.00000) -> [ 1 9]( 6, 7.0000) + [ 10 13]( 1, 4.0000) gap=2.0000" [1] " 1 1 [ 10 13]( 4.00000) -> [ 10 12]( 0, 2.0000) + [ 13 13]( 0, 0.0000) gap=2.0000" [1] " 1 3 [ 1 9]( 7.00000) -> [ 1 6]( 3, 4.0000) + [ 7 9]( 0, 1.0000) gap=2.0000" [1] " 0 2 [ 1 6]( 4.00000) -> [ 1 3]( 0, 2.0000) + [ 4 6]( 0, 0.0000) gap=2.0000" > rbind(S,M,bin) # show results [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13] [,14] S 1 3 2 1 2 3 2 3 1 3 2 1 2 1 M 1 1 3 5 5 5 7 7 8 10 11 12 14 17 bin 1 0 0 1 0 0 1 0 0 1 0 0 1 1 [,15] [,16] [,17] [,18] S 3 3 1 2 M 17 21 22 25 bin 0 1 0 0 > > # use the results to align peaks into biomarkers matrix > Bmrks = matrix(NA,sum(bin),max(S)); # init feature (biomarker) matrix > bin = cumsum(bin); # find bin numbers for each peak in S array > for (j in 1:length(S)) # Bmrks usually store height H of each peak + Bmrks[bin[j], S[j]] = 1; # but in this example it will be "1" > Bmrks [,1] [,2] [,3] [1,] 1 1 1 [2,] 1 1 1 [3,] 1 1 1 [4,] 1 1 1 [5,] NA 1 NA [6,] 1 NA 1 [7,] 1 1 1 > > > > cleanEx(); ..nameEx <- "msc.peaks.find" > > ### * msc.peaks.find > > flush(stderr()); flush(stdout()) > > ### Name: msc.peaks.find > ### Title: Find Peaks of Mass Spectra > ### Aliases: msc.peaks.find > ### Keywords: ts > > ### ** Examples > > # load input data > if (!file.exists("Data_IMAC.Rdata")) example("msc.project.read") > load("Data_IMAC.Rdata") > > # Find Peaks > Peaks = msc.peaks.find(X) > cat(nrow(Peaks), "peaks were found in", Peaks[nrow(Peaks),2], "files.\n") 823 peaks were found in 40 files. > > > > cleanEx(); ..nameEx <- "msc.peaks.read.csv" > > ### * msc.peaks.read.csv > > flush(stderr()); flush(stdout()) > > ### Name: msc.peaks.read.csv > ### Title: Read and Write Mass Spectra Peaks in CSV Format > ### Aliases: msc.peaks.read.csv msc.peaks.write.csv > ### Keywords: ts > > ### ** Examples > > example("msc.peaks.find") # create peak data msc.p.> if (!file.exists("Data_IMAC.Rdata")) example("msc.project.read") msc.p.> load("Data_IMAC.Rdata") msc.p.> Peaks = msc.peaks.find(X) msc.p.> cat(nrow(Peaks), "peaks were found in", Peaks[nrow(Peaks), 2], "files.\n") 823 peaks were found in 40 files. > X = Peaks # Peak data is stored in variable 'Peaks' > msc.peaks.write.csv("peaks.csv", X) > X = msc.peaks.read.csv("peaks.csv") > file.remove("peaks.csv") [1] TRUE > stopifnot(X==Peaks) > > > > cleanEx(); ..nameEx <- "msc.preprocess.run" > > ### * msc.preprocess.run > > flush(stderr()); flush(stdout()) > > ### Name: msc.preprocess.run > ### Title: Preprocessing Pipeline of Protein Mass Spectra > ### Aliases: msc.preprocess.run > ### Keywords: ts > > ### ** Examples > > # load input data > if (!file.exists("Data_IMAC.Rdata")) example("msc.project.read") > load("Data_IMAC.Rdata") > > # run preprocess > Y = msc.preprocess.run(X) Baseline Removal - skipped Cut low masses Mass Drift Adjustment [1] "Peak Extraction/Aligment - skipped\n" Merge Samples Done with preprocessing > cat("Size before: ", dim(X), " and after :", dim(Y), "\n") Size before: 11883 20 2 and after : 9377 60 > > > > cleanEx(); ..nameEx <- "msc.project.read" > > ### * msc.project.read > > flush(stderr()); flush(stdout()) > > ### Name: msc.project.read > ### Title: Read and Manage a Batch of Protein Mass Spectra > ### Aliases: msc.project.read > ### Keywords: ts file > > ### ** Examples > > directory = system.file("Test", package = "caMassClass") > ProjectFile = file.path(directory,"InputFiles.csv") > FileNames = msc.project.read(ProjectFile, '.') > cat("File ",FileNames," was created\n") File ./Data_IMAC.Rdata was created > > > > cleanEx(); ..nameEx <- "msc.project.run" > > ### * msc.project.run > > flush(stderr()); flush(stdout()) > > ### Name: msc.project.run > ### Title: Read and Preprocess Protein Mass Spectra > ### Aliases: msc.project.run > ### Keywords: ts > > ### ** Examples > > directory = system.file("Test", package = "caMassClass") > ProjectFile = file.path(directory,"InputFiles.csv") > Data = msc.project.run(ProjectFile, '.', + baseline.removal=0, mass.drift.adjustment=1, min.mass=3000, + peak.extraction=1, merge.copies=7, shiftPar=0.0004) Read CSV files and save them in R format Preprocess IMAC data Baseline Removal - skipped Cut low masses Mass Drift Adjustment Peak Extraction Peak Aligment Fill Biomarkers Merge Samples Done with preprocessing Update sample labels > > > > cleanEx(); ..nameEx <- "msc.sample.correlation" > > ### * msc.sample.correlation > > flush(stderr()); flush(stdout()) > > ### Name: msc.sample.correlation > ### Title: Sample Correlation > ### Aliases: msc.sample.correlation > ### Keywords: ts > > ### ** Examples > > # load input data > if (!file.exists("Data_IMAC.Rdata")) example("msc.project.read") > load("Data_IMAC.Rdata") > > # run in 3D input data using long syntax > out = msc.mass.adjust.calc (X); > Y = msc.mass.adjust.apply(X, out$ShiftX, out$ScaleY, out$ShiftY) > > # check what happen to sample correlation > A = msc.sample.correlation(X, PeaksOnly=TRUE) > B = msc.sample.correlation(Y, PeaksOnly=TRUE) > cat("Mean corelation between two copies of the same sample:\n") Mean corelation between two copies of the same sample: > cat(" before: ", mean(A$innerCor)," after: ", mean(B$innerCor), "\n") before: 0.8997452 after: 0.9107214 > cat("Mean corelation between unrelated samples:\n") Mean corelation between unrelated samples: > cat(" before: ", mean(A$outerCor)," after: ", mean(B$outerCor), "\n") before: 0.7489782 after: 0.7897508 > > > > cleanEx(); ..nameEx <- "mzXML" > > ### * mzXML > > flush(stderr()); flush(stdout()) > > ### Name: read.mzXML > ### Title: Read and Write mzXML Files > ### Aliases: read.mzXML write.mzXML new.mzXML > ### Keywords: file > > ### ** Examples > > directory = system.file("Test", package = "caMassClass") > FileName = file.path(directory,"test1.xml") > xml = read.mzXML(FileName) > xml $header [1] "\n" $parentFile [1] " \n \n" $dataProcessing [1] " \n \n \n" $indexOffset [1] "0" $index NULL $scan $scan[[1]] $scan[[1]]$mass [1] 428.8388 666.1218 856.0161 956.2572 959.4442 1054.5771 1074.7927 [8] 1089.9229 1121.0698 1124.1724 1139.9790 1146.2075 1155.8115 1159.5918 [15] 1172.8542 1181.4463 1190.8564 1193.3604 1218.6665 1229.0952 1257.6169 [22] 1361.0352 1361.7271 1389.2571 1445.6738 1717.3994 1736.9541 1852.5127 [29] 1862.7773 1900.6785 $scan[[1]]$peaks [1] 1199 368 2242 3430 2837 602 4585 690 3333 1574 411 590 [13] 1334 2503 1598 4289 610 3388 596 3143 1571 13764 3401 4053 [25] 3022 1583 1651 1308 2199 316 $scan[[1]]$num [1] 1 $scan[[1]]$parentNum [1] 1 $scan[[1]]$msLevel [1] 1 $scan[[1]]$header [1] " \n " $scan[[1]]$maldi NULL $scan[[1]]$scanOrigin NULL $scan[[1]]$precursorMz character(0) $scan[[1]]$nameValue NULL $scan[[2]] $scan[[2]]$mass [1] 182.6632 225.5469 247.1612 323.8478 346.5691 360.3236 478.8156 [8] 527.1956 596.2330 717.2694 785.1747 1227.2649 $scan[[2]]$peaks [1] 812 525 2216 1254 1426 3880 1641 2260 3356 2181 5533 3539 $scan[[2]]$num [1] 2 $scan[[2]]$parentNum [1] 2 $scan[[2]]$msLevel [1] 1 $scan[[2]]$header [1] " \n " $scan[[2]]$maldi NULL $scan[[2]]$scanOrigin NULL $scan[[2]]$precursorMz character(0) $scan[[2]]$nameValue NULL attr(,"class") [1] "mzXML" > > # test reading/writing > write.mzXML(xml, "temp.xml") > xml2 = read.mzXML("temp.xml") > file.remove("temp.xml") [1] TRUE > stopifnot(all(xml$scan[[1]]$peaks == xml2$scan[[1]]$peaks)) > stopifnot(xml$msInstrument == xml2$msInstrument) > > # extracting scan data from the output > FileName = file.path(directory,"test2.xml") > xml = read.mzXML(FileName) > plot(xml$scan[[1]]$mass, xml$scan[[1]]$peaks, type="l") > > # extracting data from unparsed sections > tree = xmlTreeParse(xml$msInstrument, asText=TRUE, asTree=TRUE) > x = xmlRoot(tree) > xmlName(x) [1] "msInstrument" > xmlAttrs(x[["msManufacturer"]]) ["value"] value "ThermoFinnigan" > xmlAttrs(x[["software"]]) type name version "acquisition" "Xcalibur" "1.3 SP 1" > > > > ### *