ms2pip.spectrum_output
Write spectrum files from MS2PIP predictions.
- exception ms2pip.spectrum_output.InvalidWriteModeError[source]
Bases:
ValueError
- class ms2pip.spectrum_output.SpectrumOutput(results, output_filename='ms2pip_predictions', write_mode='wt+', return_stringbuffer=False, is_log_space=True)[source]
Bases:
object
Write MS2PIP predictions to various output formats.
- Parameters:
results (List['ProcessingResult']) – List of ProcessingResult objects
output_filename (str, optional) – path and name for output files, will be suffexed with _predictions and the relevant file extension (default: ms2pip_predictions)
write_mode (str, optional) – write mode to use: “wt+” to append to start a new file, “at” to append to an existing file (default: “wt+”)
return_stringbuffer (bool, optional) – If True, files are written to a StringIO object, which the write function returns. If False, files are written to a file on disk.
is_log_space (bool, optional) – Set to true if predicted intensities in all_preds are in log-space. In that case, intensities will first be transformed to “normal”-space.
Example
>>> so = ms2pip.spectrum_tools.spectrum_output.SpectrumOutput( results ) >>> so.write_msp() >>> so.write_spectronaut()
- write_results(output_formats)[source]
Write MS2PIP predictions in output formats defined by output_formats.
- write_bibliospec()[source]
Write MS2PIP predictions to BiblioSpec/Skyline SSL and MS2 spectral library files.