extractPrecSpectra-methods.Rd
Extracts the MSMS spectra that originate from the precursor(s) having
the same MZ value as defined in theprec
argument.
A warning will be issued of one or several of the precursor MZ values
in prec
are absent in the experiment precursor MZ values (i.e
in precursorMz(object)
).
signature(object = "MSnExp", prec = "numeric")
Returns an "MSnExp"
containing MSMS spectra
whose precursor MZ values are in prec
.
file <- dir(system.file(package="MSnbase",dir="extdata"),
full.name=TRUE,pattern="mzXML$")
aa <- readMSData(file,verbose=FALSE)
my.prec <- precursorMz(aa)[1]
my.prec
#> F1.S1
#> 645.3741
bb <- extractPrecSpectra(aa,my.prec)
precursorMz(bb)
#> F1.S1 F1.S3
#> 645.3741 645.3741
processingData(bb)
#> - - - Processing information - - -
#> Data loaded: Wed May 15 16:30:13 2024
#> 1 (2) precursors (spectra) extracted: Wed May 15 16:30:13 2024
#> MSnbase version: 2.31.1