java.lang.Object
com.compomics.util.experiment.io.mass_spectrometry.mzml.MzmlFileIterator
All Implemented Interfaces:
MsFileIterator, AutoCloseable

public class MzmlFileIterator
extends Object
implements MsFileIterator
An iterator of the spectra in an mzml file. Based on code from jmzML.
Author:
Harald Barsnes
  • Constructor Details

    • MzmlFileIterator

      public MzmlFileIterator​(File mzmlFile, WaitingHandler waitingHandler)
      Constructor.
      Parameters:
      mzmlFile - the mzml file to go through
      waitingHandler - the waiting handler
  • Method Details

    • next

      public String next()
      Description copied from interface: MsFileIterator
      Returns the title of the next spectrum, null if none.
      Specified by:
      next in interface MsFileIterator
      Returns:
      The title of the next spectrum.
    • getSpectrum

      public Spectrum getSpectrum()
      Description copied from interface: MsFileIterator
      Returns the spectrum corresponding to the title returned by the last call to the next() method.
      Specified by:
      getSpectrum in interface MsFileIterator
      Returns:
      The spectrum corresponding to the title returned by the last call to the next() method.
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface MsFileIterator
    • needsUncompressing

      public boolean needsUncompressing​(String compression)
      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 number
      precision - the precision type
      binary - the binary data, base64 encoded
      Returns:
      a Number array representation of the binary data