OpenSwathOSWWriter#

class pyopenms.OpenSwathOSWWriter#

Bases: object

Class to write out an OpenSwath OSW SQLite output (PyProphet input)

__init__(arg0: str, arg1: bool, /) → None#

Methods

__init__(arg0, arg1, /)

addRun(run_id, input_filename)

isActive()

prepareLine(pep, transition, output, id)

Prepare a single line (feature) for output

setRunId(run_id)

writeHeader()

Initializes file by generating SQLite tables

writeLines(to_osw_output)

Write data to disk

addRun(run_id: int, input_filename: str) → None#
isActive() → bool#
prepareLine(pep: pyopenms.LightCompound, transition: pyopenms.LightTransition, output: pyopenms.FeatureMap, id: str) → str#

Prepare a single line (feature) for output

The result can be flushed to disk using writeLines (either line by line or after collecting several lines)

Parameters:
  • pep – The compound (peptide/metabolite) used for extraction

  • transition – The transition used for extraction

  • output – The feature map containing all features (each feature will generate one entry in the output)

  • id – The transition group identifier (peptide/metabolite id)

Returns:

A string to be written using writeLines

setRunId(run_id: int) → None#
writeHeader() → None#

Initializes file by generating SQLite tables

writeLines(to_osw_output: list[str]) → None#

Write data to disk

Takes a set of pre-prepared data statements from prepareLine and flushes them to disk

Parameters:

to_osw_output – Statements generated by prepareLine