library("rpx")
px <- PXDataset("PXD000864")
mgfs <- grep("mgf", pxfiles(px), value = TRUE)
mgfs <- grep("-0[5-6]-[1|2]", mgfs, value=TRUE)
mgffiles <- pxget(px, mgfs)
library("R.utils")
mgffiles <- sapply(mgffiles, gunzip)
## Generate the lightweight qc report,
## trim the mgf files to 1/10 of their size.
trimMgf <- function(f, m = 1/10, overwrite = FALSE) {
message("Reading ", f)
x <- readLines(f)
beg <- grep("BEGIN IONS", x)
end <- grep("END IONS", x)
n <- length(beg)
message("Sub-setting to ", m)
i <- sort(sample(n, floor(n * m)))
k <- unlist(mapply(seq, from = beg[i], to = end[i]))
if (overwrite) {
unlink(f)
message("Writing ", f)
writeLines(x[k], con = f)
return(f)
} else {
g <- sub(".mgf", "_small.mgf", f)
message("Writing ", g)
writeLines(x[k], con = g)
return(g)
}
}
set.seed(1)
mgffiles <- sapply(mgffiles, trimMgf, overwrite = TRUE)
fas <- pxget(px, "TTE2010.zip")
fas <- unzip(fas)
design <- system.file("extdata/PXD000864-design.txt", package = "proteoQC")
read.table(design, header = TRUE)
qcres <- msQCpipe(spectralist = design,
fasta = fas,
outdir = "./qc",
miss = 0,
enzyme = 1, varmod = 2, fixmod = 1,
tol = 10, itol = 0.6, cpu = 2,
mode = "identification")
html <- reportHTML(qcres)
Run the code above in your browser using DataLab