NAME
MS::Reader::MSn::Spectrum - An MSn spectrum object
SYNOPSIS
use MS::Reader::MSn;
use MS::CV qw/:MS/;
my $run = MS::Reader::MSn->new('run.ms2');
while (my $spectrum = $run->next_spectrum) {
# $spectrum inherits from MS::Spectrum, so you can do:
my $id = $spectrum->id;
my $rt = $spectrum->rt;
my $mz = $spectrum->mz;
my $int = $spectrum->int;
my $lvl = $spectrum->ms_level;
# in addition,
# print the underlying data structure
print $spectrum->dump;
}
DESCRIPTION
MS::Reader::MSn::Spectrum objects represent spectra parsed from an MSn file. The class is an implementation of MS::Spectrum and so implements the standard data accessors associated with that class, as well as a few extra, as documented below. The underlying hash is a nested data structure containing all information present in the original MSn record. This information can be accessed directly (see below for details of the data structure) when class methods do not exist for doing so.
METHODS
id
my $id = $spectrum->id;
Returns the ID of the spectrum
mz
my $mz = $spectrum->mz;
for (@$mz) { # do something }
Returns an array reference to the m/z data array
int
my $int = $spectrum->int;
for (@$int) { # do something }
Returns an array reference to the peak intensity data array
rt
my $rt = $spectrum->rt;
Returns the retention time of the spectra. The units of this value are not defined in the specification and may vary depending on the generating software. This information is not guaranteed to be available in MSn files, in which case a fatal error will be thrown.
ms_level
my $l = $spectrum->ms_level;
Returns the MS level of the spectrum.
dump
my $dump = $spectrum->dump;
Returns a textual representation (via Data::Dumper
) of the data structure. This can facilitate access to data parsed from the MSn record but not accessible via an accessor method.
CAVEATS AND BUGS
The API is in alpha stage and is not guaranteed to be stable.
Please reports bugs or feature requests through the issue tracker at https://github.com/jvolkening/p5-MS/issues.
SEE ALSO
AUTHOR
Jeremy Volkening <jdv@base2bio.com>
COPYRIGHT AND LICENSE
Copyright 2015-2019 Jeremy Volkening
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.