Class IsotopicDistributionSpectrum

java.lang.Object
com.compomics.util.general.IsotopicDistributionSpectrum
All Implemented Interfaces:
SpectrumFile, Comparable

public class IsotopicDistributionSpectrum
extends Object
implements SpectrumFile
This class is an implementation of the SpectrumFile specific for the isotopic distribution Created by IntelliJ IDEA. User: Niklaas Date: 16-Aug-2010 Time: 14:36:23
  • Constructor Details

  • Method Details

    • getCharge

      public int getCharge()
      Getter for the charge
      Specified by:
      getCharge in interface SpectrumFile
      Returns:
      int with the charge
    • setCharge

      public void setCharge​(int aCharge)
      Setter for the charge
      Specified by:
      setCharge in interface SpectrumFile
      Parameters:
      aCharge - int with the charge of the precursor ion.
    • getFilename

      public String getFilename()
      Getter for the filename
      Specified by:
      getFilename in interface SpectrumFile
      Returns:
      String with "Isotopic distribution"
    • setFilename

      public void setFilename​(String aFilename)
      Setter for the filename
      Specified by:
      setFilename in interface SpectrumFile
      Parameters:
      aFilename - String with the filename for the file.
    • getPeaks

      public HashMap getPeaks()
      Getter for the peaks
      Specified by:
      getPeaks in interface SpectrumFile
      Returns:
      HashMap with the peaks (key = mass, value = intensity)
    • setPeaks

      public void setPeaks​(HashMap aPeaks)
      Setter for the peaks
      Specified by:
      setPeaks in interface SpectrumFile
      Parameters:
      aPeaks - HashMap with Doubles as keys (the masses) and Doubles as values (the intensities).
    • getPrecursorMZ

      public double getPrecursorMZ()
      Getter for the precursor MZ
      Specified by:
      getPrecursorMZ in interface SpectrumFile
      Returns:
      double with the precursor MZ
    • setPrecursorMZ

      public void setPrecursorMZ​(double aPrecursorMZ)
      Setter for the precursor MZ
      Specified by:
      setPrecursorMZ in interface SpectrumFile
      Parameters:
      aPrecursorMZ - double with the precursor M/Z
    • getIntensity

      public double getIntensity()
      Getter for the precursor intensity (here always zero)
      Specified by:
      getIntensity in interface SpectrumFile
      Returns:
      zero
    • setIntensity

      public void setIntensity​(double aIntensity)
      Setter for the intensity. Here this will do nothing since there is no precursor
      Specified by:
      setIntensity in interface SpectrumFile
      Parameters:
      aIntensity - double with the intensity of the precursor ion.
    • getTotalIntensity

      public double getTotalIntensity()
      Method calculates the total intensity of the peaks
      Specified by:
      getTotalIntensity in interface SpectrumFile
      Returns:
      double with the sum of all the peak intensities
    • getHighestIntensity

      public double getHighestIntensity()
      Method that find the intensity of the most intense peak
      Specified by:
      getHighestIntensity in interface SpectrumFile
      Returns:
      double with the intensity of the most intense peak
    • writeToStream

      public void writeToStream​(OutputStream aOut) throws IOException
      Method to write to a givern stream
      Specified by:
      writeToStream in interface SpectrumFile
      Parameters:
      aOut - OutputStream to write the file to. This Stream will NOT be closed by this method.
      Throws:
      IOException - if an IOException occurs
    • writeToFile

      public void writeToFile​(File aParentDir) throws IOException
      Method to write to a given file
      Specified by:
      writeToFile in interface SpectrumFile
      Parameters:
      aParentDir - File with the parent directory to put the file in.
      Throws:
      IOException - if an IOException occurs
    • compareTo

      public int compareTo​(Object o)
      Method that compares an IsotopicDistributionSpectrum
      Specified by:
      compareTo in interface Comparable
      Parameters:
      o - Another IsotopicDistributionSpectrum
      Returns:
      int (always zero)