Skip to content
Snippets Groups Projects
Commit 8b242d40 authored by meowcat's avatar meowcat
Browse files

Merge pull request #61 from sneumann/master

Please pull improved show() method and roxygen generated manpages
parents 7f3f36c9 9d855498
No related branches found
No related tags found
No related merge requests found
......@@ -235,16 +235,35 @@ setMethod("show", "msmsWorkspace",
cat(" with files: \n")
sapply(basename(object@files), function(x) cat(" -", x, "\n"))
## msmsWorkflow: Step 1. Get peaks ?
numspecs <- 0
dummy <- sapply(object@specs, function(x) cat(" -", x$id, "\t foundOK:", x$foundOK, "\n"))
cat("Peaks found:\n")
dummy <- sapply(object@specs, function(x) cat(" -", x$id, "\t peaks:",
sapply(x$peaks, nrow), "\n"))
ids <- vector()
dummy1 <- sapply(object@specs, function(x) {
cat(" -", x$id, "\t peaks:",
sapply(x$peaks, nrow), "\n")
ids <<- c(ids, x$id)
numspecs <<- numspecs + 1
return(sapply(x$peaks, nrow))
})
## msmsWorkflow: Step 2. First analysis pre recalibration
cat("Peaks annotated after Step 2:\n")
dummy <- sapply(object@analyzedSpecs, function(x) cat(" -", x$id, "\t peaks:",
sapply(x$msmsdata, function(x) length(unique(x$childFilt[,1]))), "\n"))
dummy2 <- sapply(object@analyzedSpecs, function(x) {
cat(" -", x$id, "\t peaks:",
sapply(x$msmsdata, function(x) length(unique(x$childFilt[,1]))), "\n")
return(sapply(x$msmsdata, function(x) length(unique(x$childFilt[,1]))))
})
PeakMat <- matrix(dummy1-dummy2,numspecs,numspecs)
tempids <- ids
cat("Peaks without annotation:\n")
sapply(split(PeakMat, rep(1:nrow(PeakMat), each = ncol(PeakMat))), function(x){
cat(" -", tempids[1], "\t number of peaks filtered:", x, "\n")
tempids <<- tempids[-1]
})
## msmsWorkflow: Step 3. Aggregate all spectra
cat("Peaks aggregated after Step 3:\n")
cat("Matched Peaks:\n")
......@@ -273,12 +292,29 @@ setMethod("show", "msmsWorkspace",
cat("Peaks found after Step 4:\n")
dummy <- sapply(object@recalibratedSpecs, function(x) cat(" -", x$id, "\t foundOK:", x$foundOK, "\n"))
cat("Peaks found:\n")
dummy <- sapply(object@recalibratedSpecs, function(x) cat(" -", x$id, "\t peaks:",
sapply(x$peaks, nrow), "\n"))
dummy4 <- sapply(object@recalibratedSpecs, function(x){
cat(" -", x$id, "\t peaks:",
sapply(x$peaks, nrow), "\n")
return(sapply(x$peaks, nrow))
})
## msmsWorkflow: Step 5. Reanalyze recalibrated spectra
cat("Peaks found after Step 5:\n")
dummy <- sapply(object@analyzedRcSpecs, function(x) cat(" -", x$id, "\t peaks:",
sapply(x$msmsdata, function(x) length(unique(x$childFilt[,1]))), "\n"))
dummy5 <- sapply(object@analyzedRcSpecs, function(x){
cat(" -", x$id, "\t peaks:",
sapply(x$msmsdata, function(x) length(unique(x$childFilt[,1]))), "\n")
return(sapply(x$msmsdata, function(x) length(unique(x$childFilt[,1]))))
})
PeakMat <- matrix(dummy4-dummy5,numspecs,numspecs)
tempids <- ids
cat("Peaks without annotation in reanalyzed recalibrated peaks:\n")
sapply(split(PeakMat, rep(1:nrow(PeakMat), each = ncol(PeakMat))), function(x){
cat(" -", tempids[1], "\t number of peaks filtered:", x, "\n")
tempids <<- tempids[-1]
})
## msmsWorkflow: Step 6. Aggregate recalibrated results
cat("Peaks found after Step 6:\n")
cat("Matched Peaks:\n")
......
\name{findMsMsHRperxcms.direct}
\alias{findMsMsHRperxcms.direct}
\title{Read in mz-files using XCMS}
\usage{
findMsMsHRperxcms.direct(fileName, cpdID, mode = "pH",
findPeaksArgs = NULL, plots = FALSE, MSe = FALSE)
}
\arguments{
\item{fileName}{The path to the mz-file that should be
read}
\item{cpdID}{The compoundID of the compound that has been
used for the file}
\item{mode}{The ionization mode that has been used for
the spectrum represented by the peaklist}
\item{findPeaksArgs}{A list of arguments that will be
handed to the xcms-method findPeaks via do.call}
\item{plots}{A parameter that determines whether the
spectra should be plotted or not}
\item{MSe}{A boolean value that determines whether the
spectra were recorded using MSe or not}
}
\value{
The \code{msmsWorkspace} with the additional peaklist
added to the right spectrum
}
\description{
Picks peaks from mz-files and returns the pseudospectra
that CAMERA creates with the help of XCMS
}
\examples{
\dontrun{
fileList <- list.files(system.file("XCMSinput", package = "RMassBank"), "Glucolesquerellin", full.names=TRUE)[3]
loadList(system.file("XCMSinput/compoundList.csv",package="RMassBank"))
psp <- findMsMsHRperxcms.direct(fileList,2184)
}
}
\author{
Erik Mueller
}
\seealso{
\code{\link{msmsWorkflow}}
}
\name{plotMbWorkspaces}
\alias{plotMbWorkspaces}
\title{Plots mbWorkspaces}
\usage{
plotMbWorkspaces(w1, w2 = NULL)
}
\arguments{
\item{w1}{The \code{mbWorkspace} to be plotted}
\item{w2}{Another optional \code{mbWorkspace} be plotted
as a reference.}
}
\value{
A logical indicating whether the information was plotted
or not
}
\description{
Plots the peaks of one or two \code{mbWorkspace} to
compare them.
}
\details{
This functions plots one or two \code{mbWorkspace}s in
case the use has used different methods to acquire
similar spectra. \code{w1} must always be supplied, while
\code{w2} is optional. The wokspaces need to be fully
processed for this function to work.
}
\examples{
#
\dontrun{plotMbWorkspaces(w1,w2)}
}
\author{
Erik Mueller
}
\name{toRMB}
\alias{toRMB}
\title{Conversion of XCMS-pseudospectra into RMassBank-spectra}
\usage{
toRMB(msmsXCMSspecs, cpdID, mode, MS1spec)
}
\arguments{
\item{msmsXCMSspecs}{The compoundID of the compound that
has been used for the peaklist}
\item{cpdID}{The compound ID of the substance of the
given spectrum}
\item{mode}{The ionization mode that has been used for
the spectrum}
\item{MS1spec}{The MS1-spectrum from XCMS, which can be
optionally supplied}
}
\value{
One list element of the (at)specs-entry from an
msmsWorkspace
}
\description{
Converts a pseudospectrum extracted from XCMS using
CAMERA into the msmsWorkspace(at)specs-format that
RMassBank uses
}
\examples{
\dontrun{
XCMSpspectra <- findmsmsHRperxcms.direct("Glucolesquerellin_2184_1.mzdata", 2184)
wspecs <- toRMB(XCMSpspectra)
}
}
\author{
Erik Mueller
}
\seealso{
\code{\link{msmsWorkspace-class}}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment