Class MgfFileWriter
java.lang.Object
com.compomics.util.experiment.io.mass_spectrometry.mgf.MgfFileWriter
- All Implemented Interfaces:
AutoCloseable
This class writes spectrum files in Mascot Generic File (mgf) format.
- Author:
- Marc Vaudel, Harald Barsnes
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
MgfFileWriter
public MgfFileWriter()Empty default constructor. -
MgfFileWriter
Constructor.- Parameters:
destinationFile- The file where to write.
-
-
Method Details
-
writeSpectrum
Writes the given spectrum to the file.- Parameters:
spectrumTitle- The title of the spectrum to write.spectrum- The spectrum to write.
-
close
public void close()- Specified by:
closein interfaceAutoCloseable
-
asMgf
Returns the spectrum as an mgf bloc.- Parameters:
spectrumTitle- The title of the spectrum.spectrum- The spectrum.- Returns:
- the spectrum as an mgf bloc
-
asMgf
public static String asMgf(String spectrumTitle, Spectrum spectrum, TreeMap<String, String> additionalTags) Returns the spectrum as an mgf bloc.- Parameters:
spectrumTitle- The title of the spectrum.spectrum- The spectrum.additionalTags- additional tags which will be added after the BEGIN IONS tag in alphabetic order- Returns:
- the peak list as an mgf bloc
-