|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.compomics.util.experiment.massspectrometry.SpectrumFactory
public class SpectrumFactory
This factory will provide the spectra when needed
Method Summary | |
---|---|
void |
addSpectra(File spectrumFile)
Add spectra to the factory |
void |
closeFiles()
Closes all opened files |
int |
getCacheSize()
returns the cache size |
MgfIndex |
getIndex(File mgfIndex)
Deserializes the index of an mgf file |
static SpectrumFactory |
getInstance()
static method returning the instance of the factory |
static SpectrumFactory |
getInstance(int nCache)
Static method returning the instance of the factory with a new cache size |
Precursor |
getPrecursor(String fileName,
String spectrumTitle)
Returns the precursor of the desired spectrum |
Spectrum |
getSpectrum(String fileName,
String spectrumTitle)
Returns the spectrum desired |
void |
setCacheSize(int nCache)
Sets the cache size |
void |
writeIndex(MgfIndex mgfIndex,
File directory)
Writes the given mgf file index in the given directory |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static SpectrumFactory getInstance()
public static SpectrumFactory getInstance(int nCache)
nCache
-
public void setCacheSize(int nCache)
nCache
- the new cache sizepublic int getCacheSize()
public void addSpectra(File spectrumFile) throws FileNotFoundException, IOException, ClassNotFoundException, Exception
spectrumFile
- The spectrum file, can be mgf or mzML
FileNotFoundException
- Exception thrown whenever the file was not found
IOException
- Exception thrown whenever an error occurred while reading the file
ClassNotFoundException
- Exception thrown whenever an error occurred while deserializing the index .cui file.
Exception
- Exception thrown whenever the mgf file was not correctly parsedpublic Precursor getPrecursor(String fileName, String spectrumTitle) throws Exception
fileName
- the name of the spectrum filespectrumTitle
- the title of the spectrum
Exception
- exception thrown whenever the file was not parsed correctlypublic Spectrum getSpectrum(String fileName, String spectrumTitle) throws IOException, Exception
fileName
- name of the spectrum filespectrumTitle
- title of the spectrum
IOException
- exception thrown whenever an error occurred while reading the file
Exception
- exception thrown whenever an error occurred while parsing the filepublic void writeIndex(MgfIndex mgfIndex, File directory) throws IOException
mgfIndex
- the mgf file indexdirectory
- the destination directory
IOException
- exception thrown whenever an error is encountered while writing the filepublic MgfIndex getIndex(File mgfIndex) throws FileNotFoundException, IOException, ClassNotFoundException
mgfIndex
- the mgf index cuifile
FileNotFoundException
- exception thrown whenever the file was not found
IOException
- exception thrown whenever an error was encountered while reading the file
ClassNotFoundException
- exception thrown whenever an error occurred while deserializing the objectpublic void closeFiles() throws IOException
IOException
- exception thrown whenever an error occurred while closing the files
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |