msPurityData 1.41.2.msPurity-msn-standards vignette follows L-tryptophan and
L-kynurenine from MS1 feature detection through MS2–MS4 purity assessment,
spectral trees and matching. It uses the suggested package lcmsPlot to
display chromatograms, detected peaks and precursor purity.writeGraphML() returns the normalized output path on Windows after the
file has been written.citation("msPurity") includes both the original package
paper and the deep metabolome annotation workflow paper.subsetTree(). Peak trees reuse the parent peaks recorded
by purityA() for MS3/MS4. For raw spectra, peak matching uses 5 ppm
by default.
fragmentLinks() exposes measured masses and their signed difference for
fragment and candidate neutral-loss searches. Plot or export a selected
branch with plot(), as_igraph() or writeGraphML() (#155).BlinkMatchingParam() selects BLINK fragment scoring for MS2–MS4
searches. Hits report approximate cosine and estimated matching-ion count.
Parquet evidence records both scores and the settings used (#161).
For Spectra queries, spectralMatching() reports an outcome for every
input query. Retained hits identify shared scans and source files, with
the original measurements contributing to each stored consensus (#160).
spectralMatching() accepts experimental Spectra queries for in-memory
MS2–MS4 searches against experimental spectra or a reference library. Hits
carry the input positions, compatibility reason, scores and rank (#159).
scoreSpectrumPair() checks MS2–MS4 precursor masses, acquisition
conditions and available ancestry before reading peaks. It reports the
decision alongside the six existing scores. SpectralMatchingParam()
sets separate ppm and Da windows for each side of the comparison (#158).
Parquet spectral matching accepts a Spectra library directly, including
disk-backed libraries. Searches read candidate peaks in batches and can
record the library release and checksum with the evidence (#154).
DIMS retirement: purityD, its associated processing functions and
standalone DIMS functions, including dimsPredictPuritySingle(), are
deprecated. Calls remain functional during deprecation, but DIMS
functionality will receive no further bug fixes or feature development.
There is no direct replacement in msPurity. The interfaces will become
defunct and be removed in subsequent release cycles.
processedSpectrumInfo(), readProcessedSpectra() and
readProcessedProvenance() reopen Parquet results by feature, MS level,
averaging method or run. They expose stored peak statistics, raw study
references and the measurements behind an average (#129).
purityX() now accepts XcmsExperiment and XCMSnExp alongside
xcmsSet. It predicts feature purity from the selected MS1 spectra within
each sample's chromatographic peak boundaries. Spectrum subsetting and peak
processing on modern xcms inputs carry through to the prediction (#144).
PurityXParam() collects reusable settings for isolation-window offsets,
isolation-efficiency weighting, intensity thresholds and isotope handling.
For a saved result, processingParameters() returns the settings used and
processingHistory() identifies the chromatographic peaks and MS1 scans
behind each prediction. updateObject() preserves older predictions and
imports the settings available in the saved object (#144).
purityX(singleFile = ...) now uses the requested sample in multi-file
experiments and applies the default isolation-efficiency weighting when
requested. purityFWmean and purityFWHMmean now average the MS1 purity
estimates across the full or half-height peak width, respectively. If a
half-height flank is missing, the full-width estimate can still be used
(#144).
validateParquet() uses DuckDB to query the columns it needs and can use
temporary disk space for large joins. SQLite-to-Parquet conversion now
assigns the same run IDs across platforms when source files are unavailable,
and relative study links work on Windows (#128).createMSP() now works after frag4feature(useGroup = TRUE). It writes
the grouped feature's median m/z and retention time into MSP headers for
both measured scans and averaged spectra (#145).blockSize that cannot be grouped directly or split without separating
matching peaks now raise an error.blockSize (default 5,000 peaks) sets the clustering
block limit in intra/inter/all fragmentation averaging and DIMS
averaging/grouping. Explicit cores values apply to the current call;
omitting cores uses the object's stored setting.lineageScanId to link scans and their parents and
sourceSpectrumId for parent references expressed as source keys.AverageFragSpectraParam sets
to select or combine acquisition conditions for MSn (e.g. MS2-MS4) spectra.
Incompatible precursor paths stay separate. Inter-file averaging uses each file’s averaged spectrum
once per group, regardless of how many scans went into it.averageMembers(), averagePeakMembers()
and averageProvenance() to trace selected inputs and retained peaks through
intra-file and inter-file averaging. Repeated feature links remain distinct.Spectra on a dataset
written by MsBackendParquet's mzMLToParquet() (0.99.12 or later) runs
through purityA(), frag4feature(), filterFragSpectra() and averaging
with the same results as the mzML files, for MS2 to MS4. Peaks are read
from the dataset, never from the mzML files, so these need not exist; a
dataset that has moved or changed since purityA() read it is reported as
such. A selected or processed input numbers its raw peak rows as the
matching mzML input does. An activation method the dataset records as a
PSI-MS accession is read as its method name, so selectors match it as they
match a filter string, and activationTypeBasis records which applied.parentReference, a Parquet dataset's own spectrum ids are
no longer offered as sourceSpectrumId readings of parent scan numbers
once acquisition numbers resolve, which made parent references ambiguous
in studies of several runs.createDatabase(format = "parquet") no longer stages an SQLite database;
the MS2 output is unchanged. Results version 1.1.0 adds, without changing
what 1.0.0 datasets hold:
x_mspurity_scan, with ms_level, MSn stage
purity and status, the activation method used and its basis, and each
scan's parent and MS2 root, as references and as rows of the table;x_mspurity_msn_feature, and the
retention-time mapping of MS2 links in spectrum_feature;x_mspurity_scan_peak,
including those of feature-linked scans when allfrag = FALSE, which
were lost before;tool_provenance.study, scans and the
MS1 scans their MS2 precursors name are matched from the study's own
metadata by native id, then scan number at the same position and level;
files are no longer read or checksummed for this. When purityA() read
a Parquet dataset it is the default study; study = NA opts out.
Conditions the study does not record are reported as unavailable in the
loss ledger.AverageFragSpectraParam, at MS2 to MS4, are exported with their MS level,
parameter set and group, acquisition conditions and precursor path. Where
averaging recorded its provenance, merge_member lists the inputs each
average selected, with whether each contributed a peak, and the new
x_mspurity_merge_peak gives the input peak each averaged peak came from;
averages without a record keep reconstructed members. Empty averages are
exported as spectra without peaks. Spectral matching stays on MS2
averages.AverageFragSpectraParam.frag4feature() (#137): precursor times
of each file are mapped to the adjusted XCMS scale by interpolation and
compared with peak and feature windows on that scale, in both modes.
Before, individual mode converted peak bounds back to raw time by exact
match, which silently dropped every filled peak, and grouped mode compared
raw precursor times with adjusted feature windows, so convert2RawRT had
no effect there.aligned, unaligned,
external, estimated or missing) in the new rtMapStatus column, and
files without a mapping are named in a warning.includeFilled = TRUE links them,
flagged by is_filled. intense applies in both modes, falling back from
iMz to aMz to precursorMZ, and precurMzSource records the value
used.frag4feature() arguments: ms2RtMap maps DDA files outside the XCMS
object (an XCMS object, named functions or named offsets),
estimateRtMap = TRUE estimates the shift for them in grouped mode,
rtTol widens the windows, rtSource = "ms2" uses the MS/MS scan time
and groupWindow = "median" uses median feature bounds.
Frag4FeatureParam holds the same settings, apart from ms2RtMap.grped_df columns matchRank and rtApexDist order the matches of
each scan; per-file diagnostics are stored in pa@params$frag4feature.
Legacy columns keep their order and types. MS3 and MS4 rows keep their own
precursor m/z and time.plyr::ddply matching and the SNOW cluster
are replaced by one dplyr interval join, so dplyr (>= 1.1.0) is
required. On 32 files linking takes about 5 s instead of 870 s. Processing
history records one effective worker, and grouped mode now records the RT
conversion as used for association.grp_peaklist/grpPeaklist
arguments no longer error, the plim filter handles missing purity, and
the SQLite and Parquet writers and createMSP() prefer fileid over
sample when mapping links to files.purityA(), frag4feature() and
filterFragSpectra() take msLevel to process MS2 to MS4. purityA()
calculates MS3/MS4 precursor purity from the linked parent spectrum;
frag4feature(msLevel = 2:4) associates MS3/MS4 spectra with features
through their validated MS2 ancestors, with parentReference choosing how
parent spectra are identified. filterFragSpectra() applies purity
thresholds to each spectrum's own assessment, so a failed parent does not
exclude its descendants. MS3/MS4 averaging and processed export are not
supported yet.PurityAParam, Frag4FeatureParam and
FilterFragSpectraParam extend ProtGenerics::Param and are passed
through param. Purity and filtering settings can be assigned by MS level,
activation method, collision energy or mass analyzer. Explicit arguments
that conflict with param are an error.NA with a distinct reason
outside valid isolation bounds or when no neighbouring MS1 measurement can
be used, and a later spectrum no longer replaces a missing preceding one.purityTable() returns MS2 rows only. Filtering reads unchanged peak
arrays once, and equivalent parameter settings are resolved once.frag4feature() builds
descendant feature associations in one pass, preserving repeated links and
their order (#138).bpparam() on Windows is a SnowParam that started a
new cluster for every read, which made purityA(), frag4feature() and
the fragment filters many times slower there. msPurity still runs files in
parallel through its cores argument. BiocParallel moves from Suggests to
Imports.spectralMatching() examples use the bundled mini library
instead of downloading the full one, and createDatabase(),
create_database() and createMSP() examples write to tempdir().mzstack_<class> and msPurity_parquet_<class>
classes; parquetCapabilities() reports the mzstack_* names. A manifest
commit refused by another writer keeps msPurity_parquet_conflict.spectrum_index is int64 in every run, part files are
named by MsBackendParquet, core variables with no values in a run are not
written, and library sources without spectra are not written as empty
runs. The Parquet format is unreleased, so no migration is needed.flag_remove() now handles sample classes containing a single file and
combines validity flags across non-reference classes when deciding which
features to retain (#102).R CMD check and BiocCheck on Linux, macOS and
Windows with matching R and Bioconductor versions (#130).createDatabase(), spectralMatching() and
combineAnnotations() take format = "parquet"; SQLite remains the
default. Needs the suggested packages arrow and jsonlite.convertSqliteToParquet() converts an msPurity SQLite database to a Parquet
dataset, convertLibraryToParquet() converts an msp2db or MSP spectral
library or a Spectra object (such as an MSP file read with MsBackendMsp),
validateParquet() checks a Parquet dataset against the specification, and
parquetCapabilities() reports what the Parquet output supports.spectralMatching() on Parquet
datasets gives the same scores as on SQLite and runs much faster against
large libraries. New argument topn keeps the best-ranked matches per
query. Their peaks are read through MsBackendParquet when it is installed.spectra, fragSpectra and avSpectra
slots: the MS/MS scans with their purity as spectra variables, the scans
linked to features (each once) with filter flags as peak variables, and the
averaged spectra. They also gain a params slot recording the arguments of
purityA() and frag4feature(). purityD objects gain avSpectra (the
averaged peak lists) and experiment (the files as an MsExperiment) slots.purityTable(), groupedSpectra(), allFragSpectra(),
averagedSpectra() and averagedPeaks() return either the legacy data
frames and lists or Spectra objects. Use them instead of reading slots
directly.puritydf, grped_ms2,
all_frag_scans, av_spectra and avPeaks) are still filled by default.
options(msPurity.legacySlots = FALSE) leaves them empty; outputs are the
same either way. The default is planned to change in the next release.updateObject() converts purityA and purityD objects
saved by earlier versions; every method does this on its input.purityA() accepts Spectra, MsExperiment and
XcmsExperiment objects as well as file paths, and reads each file once.
purityD() accepts an MsExperiment. frag4feature() and
createDatabase() accept XcmsExperiment objects.mzRback argument is deprecated and ignored.processingHistory() and
processingParameters() for purityA objects and extracted Spectra.
purityA(), frag4feature(), filterFragSpectra() and the averaging
functions each record their effective settings (defaults included), the
software version, execution times and references to the spectra they read
and wrote, not copies of peaks. Repeated calls keep earlier records. A
subset of extracted Spectra returns only the history of its own spectra.
Objects saved by earlier versions get their known settings imported, marked
incomplete, with unknown dates left unknown.purityA() records, for each file, the
isolation offsets it used and where they came from (the caller, the
recorded metadata, or the Agilent approximation), and the iwNormFun it
applied when iwNorm = TRUE.FilterFragSpectraParam(), a
ProtGenerics::Param holding complete filter settings, and a param
argument to filterFragSpectra() taking one such object or a named list of
them. Its select field assigns settings to spectra by MS level, mass
analyzer, activation type, collision energy and its unit, and polarity,
without discarding spectra. Spectra matched by no set use the call's own
arguments, and overlapping sets with different settings stop with an
error. CID, HCD and ETD are recognised by abbreviation, CV name or
accession. Where structured metadata are missing, ordinary scan filter
strings supply CID/HCD and FTMS/ITMS. plim = NA skips purity filtering
for the spectra a set matches. Filtering with parameter sets needs
cores = 1. ProtGenerics is added to Imports.original_peak_index), and source peak
ids (sid) count the rows of the source data, including those of
intervening MSn spectra. Averaged spectra record the feature links they
were built from (msPurityContributors, msPurityClusterContributors) and
whether their inputs share one acquisition configuration
(msPurityAcquisitionConfiguration: uniform, incomplete, mixed or
unknown). Averaging itself is unchanged, so MS2 averages can still combine
acquisition conditions.frag4feature() or
filterFragSpectra() again clears the filter flags and averages that
depended on the previous run, and recomputing intra-file averages clears
the inter-file averages. Their history records are kept.allFragSpectra() names the scan of every peak correctly. The legacy
all_frag_scans table, and the scan peaks in SQLite output, number scans
with a count that skips scans without peaks, so after such a scan they name
the wrong scan; they are kept as they were because the SQLite output is
frozen.pid with an averaged spectrum were
added to that average; an average now contains only its own peaks.
Ambiguous assignments are refused and inconsistent identities in older
databases raise a warning (#124).seqNum columns stopped new and RDS-reopened
objects from being exported to SQLite or Parquet (#124).filterFragSpectra(rmp = TRUE) failed when
every spectrum of a feature lost all its peaks. Such features now get no
averaged spectrum, and the other averages equal those of rmp = FALSE.createMSP(method = "max") failed when one peak of the chosen
spectrum passed the filters, and could write the wrong scan when a scan was
linked to a feature more than once. It now writes the scan with the highest
precursor intensity and skips spectra with no passing peaks.createDatabase() called featureValues() without the
xcms:: prefix and failed unless xcms was attached.average_xcms_grouped_msms_indiv function