Package com.compomics.util.general
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 Summary
Constructors Constructor Description IsotopicDistributionSpectrum()
-
Method Summary
Modifier and Type Method Description int
compareTo(Object o)
Method that compares an IsotopicDistributionSpectrumint
getCharge()
Getter for the chargeString
getFilename()
Getter for the filenamedouble
getHighestIntensity()
Method that find the intensity of the most intense peakdouble
getIntensity()
Getter for the precursor intensity (here always zero)HashMap
getPeaks()
Getter for the peaksdouble
getPrecursorMZ()
Getter for the precursor MZdouble
getTotalIntensity()
Method calculates the total intensity of the peaksvoid
setCharge(int aCharge)
Setter for the chargevoid
setFilename(String aFilename)
Setter for the filenamevoid
setIntensity(double aIntensity)
Setter for the intensity.void
setPeaks(HashMap aPeaks)
Setter for the peaksvoid
setPrecursorMZ(double aPrecursorMZ)
Setter for the precursor MZvoid
writeToFile(File aParentDir)
Method to write to a given filevoid
writeToStream(OutputStream aOut)
Method to write to a givern stream
-
Constructor Details
-
IsotopicDistributionSpectrum
public IsotopicDistributionSpectrum()
-
-
Method Details
-
getCharge
public int getCharge()Getter for the charge- Specified by:
getCharge
in interfaceSpectrumFile
- Returns:
- int with the charge
-
setCharge
public void setCharge(int aCharge)Setter for the charge- Specified by:
setCharge
in interfaceSpectrumFile
- Parameters:
aCharge
- int with the charge of the precursor ion.
-
getFilename
Getter for the filename- Specified by:
getFilename
in interfaceSpectrumFile
- Returns:
- String with "Isotopic distribution"
-
setFilename
Setter for the filename- Specified by:
setFilename
in interfaceSpectrumFile
- Parameters:
aFilename
- String with the filename for the file.
-
getPeaks
Getter for the peaks- Specified by:
getPeaks
in interfaceSpectrumFile
- Returns:
- HashMap with the peaks (key = mass, value = intensity)
-
setPeaks
Setter for the peaks- Specified by:
setPeaks
in interfaceSpectrumFile
- 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 interfaceSpectrumFile
- Returns:
- double with the precursor MZ
-
setPrecursorMZ
public void setPrecursorMZ(double aPrecursorMZ)Setter for the precursor MZ- Specified by:
setPrecursorMZ
in interfaceSpectrumFile
- Parameters:
aPrecursorMZ
- double with the precursor M/Z
-
getIntensity
public double getIntensity()Getter for the precursor intensity (here always zero)- Specified by:
getIntensity
in interfaceSpectrumFile
- 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 interfaceSpectrumFile
- 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 interfaceSpectrumFile
- 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 interfaceSpectrumFile
- Returns:
- double with the intensity of the most intense peak
-
writeToStream
Method to write to a givern stream- Specified by:
writeToStream
in interfaceSpectrumFile
- Parameters:
aOut
- OutputStream to write the file to. This Stream will NOT be closed by this method.- Throws:
IOException
- if an IOException occurs
-
writeToFile
Method to write to a given file- Specified by:
writeToFile
in interfaceSpectrumFile
- Parameters:
aParentDir
- File with the parent directory to put the file in.- Throws:
IOException
- if an IOException occurs
-
compareTo
Method that compares an IsotopicDistributionSpectrum- Specified by:
compareTo
in interfaceComparable
- Parameters:
o
- Another IsotopicDistributionSpectrum- Returns:
- int (always zero)
-