Package com.compomics.util.interfaces
Interface SpectrumFile
- All Superinterfaces:
Comparable
- All Known Implementing Classes:
IsotopicDistributionSpectrum
This interface describes the behaviour for a spectrum file
(ie., PKL file, Mascot Generic file, dat file, ...).
- Version:
- $Id: SpectrumFile.java,v 1.2 2009/06/22 09:10:18 lennart Exp $
- Author:
- Lennart Martens
-
Method Summary
Modifier and TypeMethodDescriptionintThis method reports on the charge of the precursor ion.This method reports on the filename for the file.doubleThis method returns the intensity of the highest intensity peak in this spectrum.doubleThis method reports on the intensity of the precursor ion.getPeaks()This method reports on the peaks in the spectrum, with the Doubles for the masses as keys in the HashMap, and the intensities for each peak as Double value for that mass key.doubleThis method reports on the precursor M/ZdoubleThis method returns the total intensity contributed by all the ions in this spectrum.voidsetCharge(int aCharge) This method sets the charge of the precursor ion.voidsetFilename(String aFilename) This method sets the filename for the file.voidsetIntensity(double aIntensity) This method sets the intensity of the precursor ion.voidThis method sets the peaks on the spectrum.voidsetPrecursorMZ(double aPrecursorMZ) This method sets the precursor M/Z on the file.voidwriteToFile(File aParentDir) This method allows the caller to write the spectrum file to the specified folder using its current filename.voidwriteToStream(OutputStream aOut) This method allows to write the spectrum file to the specified OutputStream.Methods inherited from interface java.lang.Comparable
compareTo
-
Method Details
-
getCharge
int getCharge()This method reports on the charge of the precursor ion. Note that when the charge could not be determined, this method will return '0'.- Returns:
- int with the charge of the precursor, or '0' if no charge state is known.
-
setCharge
void setCharge(int aCharge) This method sets the charge of the precursor ion. When the charge is not known, it should be set to '0'.- Parameters:
aCharge- int with the charge of the precursor ion.
-
getFilename
String getFilename()This method reports on the filename for the file.- Returns:
- String with the filename for the file.
-
setFilename
This method sets the filename for the file.- Parameters:
aFilename- String with the filename for the file.
-
getPeaks
This method reports on the peaks in the spectrum, with the Doubles for the masses as keys in the HashMap, and the intensities for each peak as Double value for that mass key.- Returns:
- HashMap with Doubles as keys (the masses) and Doubles as values (the intensities).
-
setPeaks
This method sets the peaks on the spectrum. Doubles for the masses as keys in the HashMap, and the intensities for each peak as Double value for that mass key.- Parameters:
aPeaks- HashMap with Doubles as keys (the masses) and Doubles as values (the intensities).
-
getPrecursorMZ
double getPrecursorMZ()This method reports on the precursor M/Z- Returns:
- double with the precursor M/Z
-
setPrecursorMZ
void setPrecursorMZ(double aPrecursorMZ) This method sets the precursor M/Z on the file.- Parameters:
aPrecursorMZ- double with the precursor M/Z
-
getIntensity
double getIntensity()This method reports on the intensity of the precursor ion.- Returns:
- double with the intensity of the precursor ion.
-
setIntensity
void setIntensity(double aIntensity) This method sets the intensity of the precursor ion.- Parameters:
aIntensity- double with the intensity of the precursor ion.
-
getTotalIntensity
double getTotalIntensity()This method returns the total intensity contributed by all the ions in this spectrum.- Returns:
- double with the total intensity.
-
getHighestIntensity
double getHighestIntensity()This method returns the intensity of the highest intensity peak in this spectrum.- Returns:
- double with the intensity of the highest intensity peak in this spectrum.
-
writeToStream
This method allows to write the spectrum file to the specified OutputStream.- Parameters:
aOut- OutputStream to write the file to. This Stream will NOT be closed by this method.- Throws:
IOException- when the write operation fails.
-
writeToFile
This method allows the caller to write the spectrum file to the specified folder using its current filename.- Parameters:
aParentDir- File with the parent directory to put the file in.- Throws:
IOException- whenever the write process failed.
-