java.lang.Object
com.compomics.util.experiment.io.mass_spectrometry.MsFileExporter

public class MsFileExporter extends Object
This class writes ms files in various formats.
Author:
Marc Vaudel, Harald Barsnes
  • Constructor Details

    • MsFileExporter

      public MsFileExporter()
  • Method Details

    • writeMsFile

      public static void writeMsFile(SpectrumProvider spectrumProvider, boolean includeAllSpectrumLevels, String fileNameWithoutExtension, File destinationFile, MsFileExporter.Format format, SearchParameters searchParameters, WaitingHandler waitingHandler)
      Writes the spectra of a file in the given format.
      Parameters:
      spectrumProvider - The spectrum provider to use to get the spectra.
      includeAllSpectrumLevels - If true, all spectrum levels will be included, if false only MS2 spectra are included.
      fileNameWithoutExtension - The name of the file to export.
      destinationFile - The file where to write.
      format - The format to write in.
      searchParameters - The search parameters.
      waitingHandler - The waiting handler to use to inform on progress and allow cancelling.
    • writeAplFile

      public static void writeAplFile(SpectrumProvider spectrumProvider, boolean includeAllSpectrumLevels, String fileNameWithoutExtension, File destinationFile, SearchParameters searchParameters, WaitingHandler waitingHandler)
      Writes the spectra of a file in the Andromeda peak list (apl) format.
      Parameters:
      spectrumProvider - The spectrum provider to use to get the spectra.
      includeAllSpectrumLevels - If true, all spectrum levels will be included, if false only MS2 spectra are included.
      fileNameWithoutExtension - The name of the file to export.
      destinationFile - The file where to write.
      searchParameters - The search parameters.
      waitingHandler - The waiting handler to use to inform on progress and allow cancelling.
    • writeMgfFile

      public static void writeMgfFile(SpectrumProvider spectrumProvider, boolean includeAllSpectrumLevels, String fileNameWithoutExtension, File destinationFile, WaitingHandler waitingHandler)
      Writes the spectra of a file in the Mascot Generic File (mgf) format.
      Parameters:
      spectrumProvider - The spectrum provider to use to get the spectra.
      includeAllSpectrumLevels - If true, all spectrum levels will be included, if false only MS2 spectra are included.
      fileNameWithoutExtension - The name of the file to export.
      destinationFile - The file where to write.
      waitingHandler - The waiting handler to use to inform on progress and allow cancelling.
    • writeMs2File

      public static void writeMs2File(SpectrumProvider spectrumProvider, boolean includeAllSpectrumLevels, String fileNameWithoutExtension, File destinationFile, WaitingHandler waitingHandler)
      Writes the spectra of a file in the ms2 format.
      Parameters:
      spectrumProvider - The spectrum provider to use to get the spectra.
      includeAllSpectrumLevels - If true, all spectrum levels will be included, if false only MS2 spectra are included.
      fileNameWithoutExtension - The name of the file to export.
      destinationFile - The file where to write.
      waitingHandler - The waiting handler to use to inform on progress and allow cancelling.