Author image Alexandre Masselot
and 1 contributors


InSilicoSpectro::Spectra::ExpSpectrum - A class for representing spectra.


use InSilicoSpectro::Spectra::ExpSpectrum;


This class role is to model mass spectra.



my $sp=new(%h|$ExpSpectrum)

Constructor. %h is a hash of attribute=>value pairs, $ExpSpectrum is a InSilicoSpectro::Spectra::ExpSpectrum object, from which the attributes are copied.


An object of class InSilicoSpectro::Spectra::PeakDescriptor that defines the index of each experimental peak property such as mass, intensity, s/n, etc.


Accessor and modifier for the experimental spectrum. The spectrum is a reference to a vector of references to vectors containing peak properties (see function InSilicoSpectro::InSilico::PMFMatch).

The experimental spectrum itself. It is part of the design of this class to impose a data structure for the spectrum and make it visible (no accessors/modifiers).

The data structure is a vector of references to vectors corresponding to the experimental peaks in the experimental spectrum. The attribute spectrum is a reference to the experimental spectrum: a structure like

  spectrum->[0] -> (mass, intensity, s/n, ...) for peak 1
  spectrum->[1] -> (mass, intensity, s/n, ...) for peak 2
  spectrum->[2] -> (mass, intensity, s/n, ...) for peak 3

The actual order of the peak properties is given by the PeakDescriptor object pointed by the attribute peakDescriptor.


Return the size of the spectrum


Converts the spectrum into a string with eol characters between peaks and at the end of the last line. Properties of a peak are separated by a tab character.

Overloaded "" operator

Returns the result of toString.


Copyright (C) 2004-2006 Geneva Bioinformatics

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library 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 Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA


Alexandre Masselot,

Jacques Colinge