## @knitr knitr, include=FALSE, cache=FALSE
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)


## @knitr readCsvData0, tidy = FALSE
## 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)


## @knitr showOrgCsv
head(csv, n=3)


## @knitr readCsvData1, tidy = FALSE
## The quantitation data, from the original data
f1 <- dir(system.file("extdata", package = "pRoloc"), 
          full.names = TRUE, pattern = "exprsFile.csv")
exprsCsv <- read.csv(f1)
## Feature meta-data, from the original data
f2 <- dir(system.file("extdata", package = "pRoloc"), 
          full.names = TRUE, pattern = "fdataFile.csv")
fdataCsv <- read.csv(f2)
## Sample meta-data, a new file
f3 <- dir(system.file("extdata", package = "pRoloc"), 
          full.names = TRUE, pattern = "pdataFile.csv")
pdataCsv <- read.csv(f3)


## @knitr showExprsFile
head(exprsCsv, n=3)


## @knitr showFdFile
head(fdataCsv, n=3)


## @knitr showPdFile
pdataCsv


## @knitr makeMSnSet, tidy = FALSE
library("MSnbase")
res <- readMSnSet(exprsFile = f1,
                  featureDataFile = f2,
                  phenoDataFile = f3,
                  sep = ",")
res


## @knitr readMSnSet2
ecol <- paste("area", 114:117, sep = ".")
fname <- "Protein.ID"
eset <- readMSnSet2(f0, ecol, fname)
eset


## @knitr label=sessioninfo,results='asis',echo=FALSE,cache=FALSE
toLatex(sessionInfo())