Skip to content
Snippets Groups Projects
Commit 3271f25f authored by Emma Schymanski's avatar Emma Schymanski
Browse files

Push current fixed version

git-svn-id: file:///home/git/hedgehog.fhcrc.org/bioconductor/trunk/madman/Rpacks/RMassBank@116140 bc3139a8-67e5-0310-9ffc-ced21a209358
parent 423104df
No related branches found
No related tags found
No related merge requests found
test.nopeaks <- function(){
w <- newMsmsWorkspace()
w@aggregated <- data.frame(mzFound = numeric(0), intensity = numeric(0), good = logical(0), mzCalc = numeric(0), formula = character(0), dbe = numeric(0),
formulaCount = integer(0), dppm = numeric(0), dppmBest = numeric(0), scan = integer(0), cpdID = character(0), parentScan = integer(0), dppmRc = numeric(0),
index = integer(0), noise = logical(0), reanalyzed.formula = character(0), reanalyzed.mzCalc = numeric(0), reanalyzed.dppm = numeric(0),reanalyzed.formulaCount = numeric(0),
reanalyzed.dbe = numeric(0),matchedReanalysis = logical(0))
formulaCount = integer(0), dppm = numeric(0), dppmBest = numeric(0), scan = integer(0), cpdID = character(0), parentScan = integer(0), dppmRc = numeric(0),
index = integer(0), noise = logical(0), reanalyzed.formula = character(0), reanalyzed.mzCalc = numeric(0), reanalyzed.dppm = numeric(0),reanalyzed.formulaCount = numeric(0),
reanalyzed.dbe = numeric(0),matchedReanalysis = logical(0))
filterMultiplicity(w, mode="pH")
RUnit::checkTrue(TRUE)
checkTrue(TRUE)
}
\ No newline at end of file
......@@ -2,7 +2,6 @@ test.mzRRead <- function(){
allOK <- TRUE
records <- list.files("XX/recdata",full.names=TRUE)
rightrecords <- list.files(system.file("records/XX/recdata", package="RMassBankData"), full.names=TRUE)
for(i in 1:length(records)){
gen <- file(description = records[i], open = "r", blocking = TRUE,
encoding = getOption("encoding"), raw = FALSE)
......
......@@ -4,8 +4,8 @@
\alias{checkIsotopes}
\title{Checks for isotopes in a \code{msmsWorkspace}}
\usage{
checkIsotopes(w, mode = "pH", intensity_cutoff = 1000,
intensity_precision = "low", conflict = "dppm", isolationWindow = 4,
checkIsotopes(w, mode = "pH", intensity_cutoff = 0,
intensity_precision = "none", conflict = "strict", isolationWindow = 2,
evalMode = "complete", plotSpectrum = TRUE,
settings = getOption("RMassBank"))
}
......@@ -15,7 +15,8 @@ checkIsotopes(w, mode = "pH", intensity_cutoff = 1000,
\item{mode}{\code{"pH", "pNa", "pM", "pNH4", "mH", "mM", "mFA"} for different ions
([M+H]+, [M+Na]+, [M]+, [M+NH4]+, [M-H]-, [M]-, [M+FA]-).}
\item{intensity_cutoff}{The cutoff (as an absolute intensity value) under which isotopic peaks shouldn't be checked for or accepted as valid.}
\item{intensity_cutoff}{The cutoff (as an absolute intensity value) under which isotopic peaks shouldn't be checked for or accepted as valid.
Please note: The cutoff is not hard in the sense that it interacts with the intensity_precision parameter.}
\item{intensity_precision}{The difference that is accepted between the calculated and observed intensity of a possible isotopic peak. Further details down below.}
......
......@@ -4,7 +4,7 @@
\alias{compileRecord}
\title{Compile MassBank records}
\usage{
compileRecord(spec, mbdata, aggregated, additionalPeaks = NULL)
compileRecord(spec, mbdata, aggregated, additionalPeaks = NULL, retrieval="standard")
}
\arguments{
\item{spec}{A \code{RmbSpectraSet} for a compound, after analysis (\code{\link{analyzeMsMs}}).
......@@ -20,6 +20,10 @@ usage information.)}
\item{additionalPeaks}{If present, a table with additional peaks to add into the spectra.
As loaded with \code{\link{addPeaks}}.}
\item{retrieval}{A value that determines whether the files should be handled either as "standard",
if the compoundlist is complete, "tentative", if at least a formula is present or "unknown"
if the only know thing is the m/z}
}
\value{
Returns a MassBank record in list format: e.g.
......
......@@ -4,11 +4,19 @@
\alias{findMass}
\title{Calculate exact mass}
\usage{
findMass(cpdID_or_smiles)
findMass(cpdID_or_smiles, retrieval = "standard", mode = "pH")
}
\arguments{
\item{cpdID_or_smiles}{SMILES code or compound ID of the molecule. (Numerics
are treated as compound ID).}
\item{retrieval}{A value that determines whether the files should be handled either as "standard",
if the compoundlist is complete, "tentative", if at least a formula is present or "unknown"
if the only know thing is the m/z}
\item{mode}{\code{"pH", "pNa", "pM", "pNH4", "mH", "mM", "mFA"} for different ions
([M+H]+, [M+Na]+, [M]+, [M+NH4]+, [M-H]-, [M]-, [M+FA]-).
Only needed for retrieval="unknown"}
}
\value{
Returns the exact mass of the uncharged molecule.
......
......@@ -12,7 +12,7 @@ findMsMsHR(fileName = NULL, msRaw = NULL, cpdID, mode = "pH",
fillPrecursorScan = getOption("RMassBank")$findMsMsRawSettings$fillPrecursorScan,
rtMargin = getOption("RMassBank")$rtMargin,
deprofile = getOption("RMassBank")$deprofile, headerCache = NULL,
peaksCache = NULL)
peaksCache = NULL, retrieval = "standard")
findMsMsHR.mass(msRaw, mz, limit.coarse, limit.fine, rtLimits = NA,
maxCount = NA, headerCache = NULL, fillPrecursorScan = FALSE,
......@@ -60,6 +60,10 @@ freshly from \code{msRaw} for every compound.}
\item{peaksCache}{If present, the complete output of \code{mzR::peaks(msRaw)}. This speeds up the lookup
if multiple compounds should be searched in the same file.}
\item{retrieval}{A value that determines whether the files should be handled either as "standard",
if the compoundlist is complete, "tentative", if at least a formula is present or "unknown"
if the only know thing is the m/z}
\item{mz}{The mass to use for spectrum search.}
\item{limit.coarse}{Parameter in \code{findMsMsHR.mass} corresponding to \code{mzCoarse}.
......
......@@ -3,23 +3,26 @@
\name{findMz}
\alias{findCAS}
\alias{findFormula}
\alias{findLevel}
\alias{findMz}
\alias{findName}
\alias{findRt}
\alias{findSmiles}
\title{Find compound information}
\usage{
findMz(cpdID, mode = "pH", ppm = 10, deltaMz = 0)
findMz(cpdID, mode = "pH", ppm = 10, deltaMz = 0, retrieval="standard")
findRt(cpdID)
findSmiles(cpdID)
findFormula(cpdID)
findFormula(cpdID, retrieval="standard")
findCAS(cpdID)
findName(cpdID)
findLevel(cpdID, compact=FALSE)
}
\arguments{
\item{cpdID}{The compound ID in the compound list.}
......@@ -37,6 +40,13 @@ molecular mass + and - 10 ppm).}
\item{deltaMz}{Specifies additional m/z window to add to the range (deltaMz
= 0.02 will return the range of the molecular mass +- 0.02 (and additionally
+- the set ppm value).}
\item{retrieval}{A value that determines whether the files should be handled either as "standard",
if the compoundlist is complete, "tentative", if at least a formula is present or "unknown"
if the only know thing is the m/z}
\item{compact}{Only for \code{findLevel}, returns the "retrieval" parameter used for many functions
within RMassBank if TRUE}
}
\value{
\code{findMz} will return a \code{list(mzCenter=, mzMin=, mzMax=)}
......
......@@ -5,10 +5,10 @@
\alias{gatherSpectrum}
\title{Compose data block of MassBank record}
\usage{
gatherCompound(spec, aggregated, additionalPeaks = NULL)
gatherCompound(spec, aggregated, additionalPeaks = NULL, retrieval="standard")
gatherSpectrum(spec, msmsdata, ac_ms, ac_lc, aggregated,
additionalPeaks = NULL)
additionalPeaks = NULL, retrieval="standard")
}
\arguments{
\item{spec}{A \code{RmbSpectraSet} object, representing a compound with multiple spectra.}
......@@ -18,6 +18,10 @@ gatherCompound(spec, aggregated, additionalPeaks = NULL)
\item{additionalPeaks}{If present, a table with additional peaks to add into the spectra.
As loaded with \code{\link{addPeaks}}.}
\item{retrieval}{A value that determines whether the files should be handled either as "standard",
if the compoundlist is complete, "tentative", if at least a formula is present or "unknown"
if the only know thing is the m/z}
\item{msmsdata}{A \code{RmbSpectrum2} object from the \code{spec} spectra set, representing a single spectrum to give a record.}
\item{ac_ms, ac_lc}{Information for the AC\$MASS_SPECTROMETRY and
......
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/createMassBank.R
\name{gatherDataUnknown}
\alias{gatherDataUnknown}
\title{Retrieve annotation data}
\usage{
gatherDataUnknown(id, mode, retrieval)
}
\arguments{
\item{id}{The compound ID.}
\item{mode}{\code{"pH", "pNa", "pM", "pNH4", "mH", "mM", "mFA"} for different ions
([M+H]+, [M+Na]+, [M]+, [M+NH4]+, [M-H]-, [M]-, [M+FA]-).}
\item{retrieval}{A value that determines whether the files should be handled either as "standard",
if the compoundlist is complete, "tentative", if at least a formula is present or "unknown"
if the only know thing is the m/z}
}
\value{
Returns a list of type \code{list(id= \var{compoundID}, ...,
'ACCESSION' = '', 'RECORD_TITLE' = '', )} etc. %% ...
}
\description{
Retrieves annotation data for an unknown compound by using basic information present
}
\details{
Composes the "upper part" of a MassBank record filled with chemical data
about the compound: name, exact mass, structure, CAS no..
The instrument type is also written into this block (even
if not strictly part of the chemical information). Additionally, index
fields are added at the start of the record, which will be removed later:
\code{id, dbcas, dbname} from the compound list.
Additionally, the fields \code{ACCESSION} and \code{RECORD_TITLE} are
inserted empty and will be filled later on.
This function is used to generate the data in case a substance is unknown,
i.e. not enough information is present to derive anything about formulas or links
}
\examples{
# Gather data for compound ID 131
\dontrun{gatherDataUnknown(131,"pH")}
}
\author{
Michael Stravs, Erik Mueller
}
\references{
MassBank record format:
\url{http://www.massbank.jp/manuals/MassBankRecord_en.pdf}
}
\seealso{
\code{\link{mbWorkflow}}
}
......@@ -17,7 +17,7 @@ which should then be manually inspected.}
\item{gatherData}{A variable denoting whether to retrieve information using several online databases \code{gatherData= "online"}
or to use the local babel installation \code{gatherData= "babel"}. Note that babel is used either way, if a directory is given
in the settings}
in the settings. This setting will be ignored if retrieval is set to "standard"}
}
\value{
The processed \code{mbWorkspace}.
......
......@@ -11,7 +11,9 @@ processProblematicPeaks(w, mode, archivename = NA)
\item{mode}{Processing mode (pH etc)}
\item{archivename}{Base name of the archive to write to (for "abc" the exported failpeaks list will be "abc_Failpeaks.csv").}
\item{archivename}{Base name of the archive to write to (for "abc" the exported failpeaks list will be "abc_Failpeaks.csv").
if the compoundlist is complete, "tentative", if at least a formula is present or "unknown"
if the only know thing is the m/z}
}
\value{
Returns the aggregate data.frame with added column "\code{problematic}" (logical) which marks peaks which match the problematic criteria
......
#### doRUnit.R --- Run RUnit tests
####------------------------------------------------------------------------
### Structure borrowed from rcppgls:
### https://github.com/eddelbuettel/rcppgsl/blob/master/tests/doRUnit.R
if(require("RUnit", quietly = TRUE)) {
if(require("RMassBankData", quietly = TRUE) && !(compareVersion(installed.packages()["RMassBankData","Version"],"1.99.0") == -1)) {
pkg <- "RMassBank"
print("Starting tests")
require(pkg, character.only=TRUE)
path <- system.file("unitTests", package = pkg)
stopifnot(file.exists(path), file.info(path.expand(path))$isdir)
source(file.path(path, "runTests.R"), echo = TRUE)
} else {
## Taking this message out until the new RMassBankData is on bioc, just to avoid confusion.
# message("Package RMassBankData with version > 1.99 not available, cannot run unit tests")
}
} else {
message("Package RUnit not available, cannot run unit tests")
}
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