NAME
InSilicoSpectro::Spectra::ExpSpectrum - A class for representing spectra.
SYNOPSIS
use InSilicoSpectro::Spectra::ExpSpectrum;
DESCRIPTION
This class role is to model mass spectra.
ATTRIBUTES
- peakDescriptor
-
An object of class InSilicoSpectro::Spectra::PeakDescriptor that defines the index of each experimental peak property such as mass, intensity, s/n, etc.
- spectrum
-
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.
METHODS
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.
peakDescriptor([$pd])
Accessor and modifier of the attribute peakDescriptor.
spectrum([$sp])
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).
toString
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.