Interface SpectrumProvider

All Superinterfaces:
AutoCloseable
All Known Implementing Classes:
CmsFileReader, MsFileHandler

public interface SpectrumProvider
extends AutoCloseable
Interface for objects providing spectra.
Author:
Marc Vaudel, Harald Barsnes
  • Method Details

    • getSpectrum

      Spectrum getSpectrum​(String fileNameWithoutExtension, String spectrumTitle)
      Returns the spectrum with the given title in the given file.
      Parameters:
      fileNameWithoutExtension - The name of the spectrum file without file extension.
      spectrumTitle - The title of the spectrum.
      Returns:
      The spectrum with the given title in the given file.
    • getPrecursor

      Precursor getPrecursor​(String fileNameWithoutExtension, String spectrumTitle)
      Returns the precursor. Null if none.
      Parameters:
      fileNameWithoutExtension - The name of the spectrum file without file extension.
      spectrumTitle - The title of the spectrum.
      Returns:
      The precursor.
    • getPrecursorMz

      double getPrecursorMz​(String fileNameWithoutExtension, String spectrumTitle)
      Returns the measured precursor m/z. NaN if none.
      Parameters:
      fileNameWithoutExtension - The name of the spectrum file without file extension.
      spectrumTitle - The title of the spectrum.
      Returns:
      The measured precursor m/z.
    • getPrecursorRt

      double getPrecursorRt​(String fileNameWithoutExtension, String spectrumTitle)
      Returns the precursor RT window. NaN if none.
      Parameters:
      fileNameWithoutExtension - The name of the spectrum file without file extension.
      spectrumTitle - The title of the spectrum.
      Returns:
      The precursor RT.
    • getPeaks

      double[][] getPeaks​(String fileNameWithoutExtension, String spectrumTitle)
      Returns the spectrum peaks.
      Parameters:
      fileNameWithoutExtension - The name of the spectrum file without file extension.
      spectrumTitle - The title of the spectrum.
      Returns:
      The peaks.
    • getMinPrecMz

      double getMinPrecMz​(String fileNameWithoutExtension)
      Returns the minimum precursor m/z in a given file.
      Parameters:
      fileNameWithoutExtension - The name of the spectrum file without file extension.
      Returns:
      The minimum precursor m/z in a given file.
    • getMaxPrecMz

      double getMaxPrecMz​(String fileNameWithoutExtension)
      Returns the maximum precursor m/z in a given file.
      Parameters:
      fileNameWithoutExtension - The name of the spectrum file without file extension.
      Returns:
      The maximum precursor m/z in a given file.
    • getMaxPrecInt

      double getMaxPrecInt​(String fileNameWithoutExtension)
      Returns the maximum precursor intensity in a given file.
      Parameters:
      fileNameWithoutExtension - The name of the spectrum file without file extension.
      Returns:
      The maximum precursor intensity in a given file.
    • getMaxPrecRT

      double getMaxPrecRT​(String fileNameWithoutExtension)
      Returns the maximum precursor RT in a given file.
      Parameters:
      fileNameWithoutExtension - The name of the spectrum file without file extension.
      Returns:
      The maximum precursor RT in a given file.
    • getMinPrecMz

      double getMinPrecMz()
      Returns the minimum precursor m/z among all files.
      Returns:
      The minimum precursor m/z among all files.
    • getMaxPrecMz

      double getMaxPrecMz()
      Returns the maximum precursor m/z among all files.
      Returns:
      The maximum precursor m/z among all files.
    • getMaxPrecInt

      double getMaxPrecInt()
      Returns the maximum precursor intensity among all files.
      Returns:
      The maximum precursor intensity among all files.
    • getMaxPrecRT

      double getMaxPrecRT()
      Returns the maximum precursor RT among all files.
      Returns:
      The maximum precursor RT among all files.
    • getOrderedFileNamesWithoutExtensions

      String[] getOrderedFileNamesWithoutExtensions()
      Returns the spectrum file names without file extensions.
      Returns:
      The spectrum file names without file extensions.
    • getSpectrumTitles

      String[] getSpectrumTitles​(String fileNameWithoutExtension)
      Returns the spectrum titles for the given mass spectrometry file name.
      Parameters:
      fileNameWithoutExtension - The mass spectrometry file name without file extension.
      Returns:
      The spectrum titles as array.
    • getFilePaths

      HashMap<String,​String> getFilePaths()
      Returns the absolute path to the original mass spec file containing the spectra in a map indexed by file name without file extension.
      Returns:
      The absolute path to the original mass spec file containing the spectra in a map indexed by file name.
    • getCmsFilePaths

      HashMap<String,​String> getCmsFilePaths()
      Returns the absolute path to the cms file indexed by ms file name without file extension. Null if none.
      Returns:
      The absolute path to the cms file indexed by ms file name.
    • close

      void close()
      Specified by:
      close in interface AutoCloseable