|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.compomics.util.experiment.io.massspectrometry.MgfReader
public class MgfReader
This class will read an mgf file.
Constructor Summary | |
---|---|
MgfReader()
General constructor for an mgf reader. |
Method Summary | |
---|---|
static MgfIndex |
getIndexMap(java.io.File mgfFile)
Returns the index of all spectra in the given mgf file |
static Precursor |
getPrecursor(java.io.RandomAccessFile randomAccessFile,
long index,
java.lang.String fileName)
Returns the next precursor starting from the given index |
java.util.ArrayList<MSnSpectrum> |
getSpectra(java.io.File aFile)
Reads an mgf file and retrieves a list of spectra. |
static MSnSpectrum |
getSpectrum(java.io.RandomAccessFile randomAccessFile,
long index,
java.lang.String fileName)
Returns the next spectrum starting from the given index |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MgfReader()
Method Detail |
---|
public java.util.ArrayList<MSnSpectrum> getSpectra(java.io.File aFile) throws java.lang.Exception
aFile
- the mgf file
java.lang.Exception
- Exeption thrown if a problem is encountered reading the filepublic static MgfIndex getIndexMap(java.io.File mgfFile) throws java.io.FileNotFoundException, java.io.IOException
mgfFile
- the given mgf file
java.io.FileNotFoundException
- Exception thrown whenever the file is not found
java.io.IOException
- Exception thrown whenever an error occurs while reading the filepublic static MSnSpectrum getSpectrum(java.io.RandomAccessFile randomAccessFile, long index, java.lang.String fileName) throws java.io.IOException, java.lang.Exception
randomAccessFile
- The random access file of the inspected mgf fileindex
- The index where to start looking for the spectrumfileName
- The name of the mgf file (@TODO get this from the random access file?)
java.io.IOException
- Exception thrown whenever an error is encountered while reading the spectrum
java.lang.Exception
- Exception thrown whenever the file is not of a compatible formatpublic static Precursor getPrecursor(java.io.RandomAccessFile randomAccessFile, long index, java.lang.String fileName) throws java.io.IOException, java.lang.Exception
randomAccessFile
- The random access file of the inspected mgf fileindex
- The index where to start looking for the spectrumfileName
- The name of the mgf file (@TODO get this from the random access file?)
java.io.IOException
- Exception thrown whenever an error is encountered while reading the spectrum
java.lang.Exception
- Exception thrown whenever the file is not of a compatible format
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |