com.compomics.util.experiment.massspectrometry
Class MSnSpectrum

java.lang.Object
  extended by com.compomics.util.experiment.personalization.ExperimentObject
      extended by com.compomics.util.experiment.massspectrometry.Spectrum
          extended by com.compomics.util.experiment.massspectrometry.MSnSpectrum
All Implemented Interfaces:
Serializable, Cloneable

public class MSnSpectrum
extends Spectrum

This class models an MSn spectrum.

Author:
Marc Vaudel
See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.compomics.util.experiment.massspectrometry.Spectrum
fileName, level, peakList, scanNumber, scanStartTime, SPECTRUM_KEY_SPLITTER, spectrumTitle
 
Constructor Summary
MSnSpectrum()
          Constructor for the spectrum.
MSnSpectrum(int level, Precursor precursor, String spectrumTitle, HashMap<Double,Peak> peakMap, String fileName)
          Constructor for the spectrum.
MSnSpectrum(int level, Precursor precursor, String spectrumTitle, HashMap<Double,Peak> peakMap, String fileName, double scanStartTime)
          Constructor for the spectrum.
MSnSpectrum(int level, Precursor precursor, String spectrumTitle, String fileName)
          Minimal constructor for the spectrum.
 
Method Summary
 String asMgf()
          Returns the peak list as mgf bloc.
 Precursor getPrecursor()
          Returns the precursor.
 void setPrecursor(Precursor precursor)
          Set the precursor.
 void writeMgf(BufferedWriter writer1)
          Writes the spectrum in the mgf format using the given writer
 
Methods inherited from class com.compomics.util.experiment.massspectrometry.Spectrum
addPeak, getFileName, getIntensityLimit, getIntensityValuesAsArray, getJFreePeakList, getLevel, getMaxIntensity, getMaxMz, getMinMz, getMzAndIntensityAsArray, getMzValuesAsArray, getPeakList, getPeakMap, getPeaksAboveIntensityThreshold, getRecalibratedPeakList, getScanNumber, getScanStartTime, getSpectrumFile, getSpectrumKey, getSpectrumKey, getSpectrumTitle, getSpectrumTitle, getTotalIntensity, removePeakList, setPeakList, setPeaks, setScanNumber, setScanStartTime, setSpectrumTitle
 
Methods inherited from class com.compomics.util.experiment.personalization.ExperimentObject
addUrParam, getParameterKey, getUrParam
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MSnSpectrum

public MSnSpectrum()
Constructor for the spectrum.


MSnSpectrum

public MSnSpectrum(int level,
                   Precursor precursor,
                   String spectrumTitle,
                   String fileName)
Minimal constructor for the spectrum. The peak list is not loaded in order to reduce memory consumption.

Parameters:
level - MS level
precursor - precursor
spectrumTitle - spectrum title
fileName - file name

MSnSpectrum

public MSnSpectrum(int level,
                   Precursor precursor,
                   String spectrumTitle,
                   HashMap<Double,Peak> peakMap,
                   String fileName)
Constructor for the spectrum.

Parameters:
level - MS level
precursor - precursor
spectrumTitle - spectrum title
peakMap - set of peaks
fileName - file name

MSnSpectrum

public MSnSpectrum(int level,
                   Precursor precursor,
                   String spectrumTitle,
                   HashMap<Double,Peak> peakMap,
                   String fileName,
                   double scanStartTime)
Constructor for the spectrum.

Parameters:
level - MS level
precursor - precursor
spectrumTitle - spectrum title
peakMap - set of peaks
fileName - file name
scanStartTime - The time point when the spectrum was recorded
Method Detail

getPrecursor

public Precursor getPrecursor()
Returns the precursor.

Returns:
precursor charge

setPrecursor

public void setPrecursor(Precursor precursor)
Set the precursor.

Parameters:
precursor - the precursor to set

asMgf

public String asMgf()
Returns the peak list as mgf bloc.

Returns:
the peak list as mgf bloc

writeMgf

public void writeMgf(BufferedWriter writer1)
              throws IOException
Writes the spectrum in the mgf format using the given writer

Parameters:
writer1 - a buffered writer where the spectrum will be written
Throws:
IOException


Copyright © 2013. All Rights Reserved.