Class MzmlFileIterator
java.lang.Object
com.compomics.util.experiment.io.mass_spectrometry.mzml.MzmlFileIterator
- All Implemented Interfaces:
MsFileIterator,AutoCloseable
An iterator of the spectra in an mzml file. Based on code from jmzML.
- Author:
- Harald Barsnes
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumThe supported precision types for the binary data as defined in the mzML specifications and the PSI-MS ontology. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Number[]getBinaryDataAsNumberArray(String compression, MzmlFileIterator.Precision precision, byte[] binary) Retrieve the binary data as an array of numeric values.Returns the spectrum corresponding to the title returned by the last call to the next() method.booleanneedsUncompressing(String compression) Reads true if the binary data is compressed.next()Returns the title of the next spectrum, null if none.
-
Constructor Details
-
MzmlFileIterator
Constructor.- Parameters:
mzmlFile- the mzml file to go throughwaitingHandler- the waiting handler
-
-
Method Details
-
next
Description copied from interface:MsFileIteratorReturns the title of the next spectrum, null if none.- Specified by:
nextin interfaceMsFileIterator- Returns:
- The title of the next spectrum.
-
getSpectrum
Description copied from interface:MsFileIteratorReturns the spectrum corresponding to the title returned by the last call to the next() method.- Specified by:
getSpectrumin interfaceMsFileIterator- Returns:
- The spectrum corresponding to the title returned by the last call to the next() method.
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceMsFileIterator
-
needsUncompressing
Reads true if the binary data is compressed.- Parameters:
compression- the compression level- Returns:
- true if the data is compressed
-
getBinaryDataAsNumberArray
public Number[] getBinaryDataAsNumberArray(String compression, MzmlFileIterator.Precision precision, byte[] binary) Retrieve the binary data as an array of numeric values.- Parameters:
compression- the compression accession numberprecision- the precision typebinary- the binary data, base64 encoded- Returns:
- a Number array representation of the binary data
-