com.compomics.util.interfaces
Interface SpectrumFile

All Superinterfaces:
Comparable
All Known Implementing Classes:
IsotopicDistributionSpectrum

public interface SpectrumFile
extends Comparable

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
 int getCharge()
          This method reports on the charge of the precursor ion.
 String getFilename()
          This method reports on the filename for the file.
 double getHighestIntensity()
          This method returns the intensity of the highest intensity peak in this spectrum.
 double getIntensity()
          This method reports on the intensity of the precursor ion.
 HashMap 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.
 double getPrecursorMZ()
          This method reports on the precursor M/Z
 double getTotalIntensity()
          This method returns the total intensity contributed by all the ions in this spectrum.
 void setCharge(int aCharge)
          This method sets the charge of the precursor ion.
 void setFilename(String aFilename)
          This method sets the filename for the file.
 void setIntensity(double aIntensity)
          This method sets the intensity of the precursor ion.
 void setPeaks(HashMap aPeaks)
          This method sets the peaks on the spectrum.
 void setPrecursorMZ(double aPrecursorMZ)
          This method sets the precursor M/Z on the file.
 void writeToFile(File aParentDir)
          This method allows the caller to write the spectrum file to the specified folder using its current filename.
 void writeToStream(OutputStream aOut)
          This method allows to write the spectrum file to the specified OutputStream.
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Method Detail

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

void setFilename(String aFilename)
This method sets the filename for the file.

Parameters:
aFilename - String with the filename for the file.

getPeaks

HashMap 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

void setPeaks(HashMap aPeaks)
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

void writeToStream(OutputStream aOut)
                   throws IOException
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

void writeToFile(File aParentDir)
                 throws IOException
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.


Copyright © 2012. All Rights Reserved.