### R code from vignette source 'vignettes/MSnbase/inst/doc/MSnbase-io.Rnw' ################################################### ### code chunk number 1: knitr ################################################### library("knitr") suppressPackageStartupMessages(library("MSnbase")) suppressPackageStartupMessages(library("pRolocdata")) opts_chunk$set(fig.align = 'center', fig.show = 'hold', par = TRUE, prompt = TRUE, comment = NA) options(replace.assign = TRUE, width = 70) ################################################### ### code chunk number 2: readCsvData0 ################################################### ## The original data for replicate 1, available ## from the pRolocdata package f0 <- dir(system.file("extdata", package = "pRolocdata"), full.names = TRUE, pattern = "pr800866n_si_004-rep1.csv") csv <- read.csv(f0) ################################################### ### code chunk number 3: showOrgCsv ################################################### head(csv, n=3) ################################################### ### code chunk number 4: readCsvData1 ################################################### ## The quantitation data, from the original data f1 <- dir(system.file("extdata", package = "pRolocdata"), full.names = TRUE, pattern = "exprsFile.csv") exprsCsv <- read.csv(f1) ## Feature meta-data, from the original data f2 <- dir(system.file("extdata", package = "pRolocdata"), full.names = TRUE, pattern = "fdataFile.csv") fdataCsv <- read.csv(f2) ## Sample meta-data, a new file f3 <- dir(system.file("extdata", package = "pRolocdata"), full.names = TRUE, pattern = "pdataFile.csv") pdataCsv <- read.csv(f3) ################################################### ### code chunk number 5: showExprsFile ################################################### head(exprsCsv, n=3) ################################################### ### code chunk number 6: showFdFile ################################################### head(fdataCsv, n=3) ################################################### ### code chunk number 7: showPdFile ################################################### pdataCsv ################################################### ### code chunk number 8: makeMSnSet ################################################### library("MSnbase") res <- readMSnSet(exprsFile = f1, featureDataFile = f2, phenoDataFile = f3, sep = ",") res ################################################### ### code chunk number 9: readMSnSet2 ################################################### ecol <- paste("area", 114:117, sep = ".") fname <- "Protein.ID" eset <- readMSnSet2(f0, ecol, fname) eset ################################################### ### code chunk number 10: ecols ################################################### getEcols(f0, ",") grepEcols(f0, "area", ",") e <- grepEcols(f0, "area", ",") readMSnSet2(f0, e)