Package eu.isas.peptideshaker.followup
Class SpectrumExporter
java.lang.Object
eu.isas.peptideshaker.followup.SpectrumExporter
This class can be used to export spectra.
- Author:
- Marc Vaudel
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumEnum of the different types of export implemented. -
Constructor Summary
ConstructorsConstructorDescriptionSpectrumExporter(com.compomics.util.experiment.identification.Identification identification, com.compomics.util.experiment.mass_spectrometry.SpectrumProvider spectrumProvider) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionexportSpectra(File destinationFolder, com.compomics.util.waiting.WaitingHandler waitingHandler, SpectrumExporter.ExportType exportType, com.compomics.util.parameters.identification.advanced.SequenceMatchingParameters sequenceMatchingPreferences) Exports the spectra from different categories of PSMs according to the export type.static FilegetDestinationFile(File destinationFolder, String originalFileName, SpectrumExporter.ExportType exportType) Returns the destination file for the given export.static StringgetSuffix(SpectrumExporter.ExportType exportType) Returns the suffix for a spectrum file name.static booleaninclude(String spectrumFile, String spectrumTitle, com.compomics.util.experiment.identification.Identification identification, com.compomics.util.parameters.identification.advanced.SequenceMatchingParameters sequenceMatchingParameters, SpectrumExporter.ExportType exportType) Indicates whether a spectrum should be exported.
-
Constructor Details
-
SpectrumExporter
public SpectrumExporter(com.compomics.util.experiment.identification.Identification identification, com.compomics.util.experiment.mass_spectrometry.SpectrumProvider spectrumProvider) Constructor.- Parameters:
identification- The identification object.spectrumProvider- The spectrum provider.
-
-
Method Details
-
exportSpectra
public ArrayList<File> exportSpectra(File destinationFolder, com.compomics.util.waiting.WaitingHandler waitingHandler, SpectrumExporter.ExportType exportType, com.compomics.util.parameters.identification.advanced.SequenceMatchingParameters sequenceMatchingPreferences) throws IOException Exports the spectra from different categories of PSMs according to the export type. Export format is mgf and only MS2 spectra are included.- Parameters:
destinationFolder- the folder where to write the spectrawaitingHandler- waiting handler used to display progress and cancel the process. Can be null.exportType- the type of PSM to exportsequenceMatchingPreferences- the sequence matching preferences- Returns:
- ArrayList files containing exported spectra
- Throws:
IOException- thrown if an error occurred while writing the file
-
getDestinationFile
public static File getDestinationFile(File destinationFolder, String originalFileName, SpectrumExporter.ExportType exportType) Returns the destination file for the given export.- Parameters:
destinationFolder- the destination folderoriginalFileName- the original file nameexportType- the export type- Returns:
- the destination file
-
include
public static boolean include(String spectrumFile, String spectrumTitle, com.compomics.util.experiment.identification.Identification identification, com.compomics.util.parameters.identification.advanced.SequenceMatchingParameters sequenceMatchingParameters, SpectrumExporter.ExportType exportType) Indicates whether a spectrum should be exported.- Parameters:
spectrumFile- the name of the file of the spectrumspectrumTitle- the spectrum titleidentification- the identification objectsequenceMatchingParameters- the sequence matching preferencesexportType- the export type- Returns:
- a boolean indicating whether a spectrum should be exported
-
getSuffix
Returns the suffix for a spectrum file name.- Parameters:
exportType- the type of PSM to be exported- Returns:
- the suffix for a spectrum file name
-