Package com.compomics.util.general
Class IsotopicDistributionSpectrum
java.lang.Object
com.compomics.util.general.IsotopicDistributionSpectrum
- All Implemented Interfaces:
SpectrumFile,Comparable
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 -
Method Summary
Modifier and TypeMethodDescriptionintMethod that compares an IsotopicDistributionSpectrumintGetter for the chargeGetter for the filenamedoubleMethod that find the intensity of the most intense peakdoubleGetter for the precursor intensity (here always zero)getPeaks()Getter for the peaksdoubleGetter for the precursor MZdoubleMethod calculates the total intensity of the peaksvoidsetCharge(int aCharge) Setter for the chargevoidsetFilename(String aFilename) Setter for the filenamevoidsetIntensity(double aIntensity) Setter for the intensity.voidSetter for the peaksvoidsetPrecursorMZ(double aPrecursorMZ) Setter for the precursor MZvoidwriteToFile(File aParentDir) Method to write to a given filevoidwriteToStream(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:
getChargein interfaceSpectrumFile- Returns:
- int with the charge
-
setCharge
public void setCharge(int aCharge) Setter for the charge- Specified by:
setChargein interfaceSpectrumFile- Parameters:
aCharge- int with the charge of the precursor ion.
-
getFilename
Getter for the filename- Specified by:
getFilenamein interfaceSpectrumFile- Returns:
- String with "Isotopic distribution"
-
setFilename
Setter for the filename- Specified by:
setFilenamein interfaceSpectrumFile- Parameters:
aFilename- String with the filename for the file.
-
getPeaks
Getter for the peaks- Specified by:
getPeaksin interfaceSpectrumFile- Returns:
- HashMap with the peaks (key = mass, value = intensity)
-
setPeaks
Setter for the peaks- Specified by:
setPeaksin 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:
getPrecursorMZin interfaceSpectrumFile- Returns:
- double with the precursor MZ
-
setPrecursorMZ
public void setPrecursorMZ(double aPrecursorMZ) Setter for the precursor MZ- Specified by:
setPrecursorMZin interfaceSpectrumFile- Parameters:
aPrecursorMZ- double with the precursor M/Z
-
getIntensity
public double getIntensity()Getter for the precursor intensity (here always zero)- Specified by:
getIntensityin 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:
setIntensityin 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:
getTotalIntensityin 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:
getHighestIntensityin interfaceSpectrumFile- Returns:
- double with the intensity of the most intense peak
-
writeToStream
Method to write to a givern stream- Specified by:
writeToStreamin 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:
writeToFilein 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:
compareToin interfaceComparable- Parameters:
o- Another IsotopicDistributionSpectrum- Returns:
- int (always zero)
-