NAME

MS::Reader::MzML::Record - The base class for MzML spectrum and chromatogram records

SYNOPSIS

use MS::Reader::MzML;

while (my $spectrum = $run->next_spectrum) {
   
    # $spectrum inherits methods from MS::Reader::MzML::Record

}

DESCRIPTION

MS::Reader::MzML::Record is the base class for spectrum and chromatogram records and is not intended to be used directly. However, the following methods are inherited by those modules for public consumption.

METHODS

get_array

my $z = $record->get_array($cv);
my %z = $record->get_array($cv);

Takes a single argument (PSI:MS CV id for the data array type) and returns a context-dependent value. In list context, returns a hash where keys are the free-form array names and values are the data array references. In scalar context, returns an data array reference for the first array found. Subclasses wrap this in methods to return specific array types (e.g. m/z, intensity, retention time) but it can also be used directly to return other data arrays, if available. Applicable constants exported by the MS::CV module include:

  • MS_M_Z_ARRAY

  • MS_INTENSITY_ARRAY

  • MS_TIME_ARRAY

  • MS_CHARGE_ARRAY

  • MS_SIGNAL_TO_NOISE_ARRAY

  • MS_WAVELENGTH_ARRAY

  • MS_RESOLUTION_ARRAY

  • MS_BASELINE_ARRAY

  • MS_FLOWRATE_ARRAY

  • MS_PRESSURE_ARRAY

  • MS_TEMPERATURE_ARRAY

  • MS_MEAN_DRIFT_TIME_ARRAY

  • MS_MEAN_CHARGE_ARRAY

  • MS_NON_STANDARD_DATA_ARRAY

param

my $val = $record->param($cv_id);
my $val = $record->param($cv_id => 2);
my ($val,$units) = $record->param($cv_id);

Takes as an argument a PSI:MS CV ID and optionally an index of the annotation to return. In scalar context, returns the value associated with the CV term or undef if the term is not present. In list context, returns the value of the term and the CV ID of the units assigned to it. By default, the first term with the given CV ID is used, although it is legal (but not common) for a CV term to be applied multiple times to a record.

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.

AUTHOR

Jeremy Volkening <jdv@base2bio.com>

COPYRIGHT AND LICENSE

Copyright 2015-2016 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/>.