OpenMS
2.8.0
|
This class serves for reading in and writing OpenSWATH OSW files. More...
#include <OpenMS/FORMAT/OSWFile.h>
Classes | |
struct | PercolatorFeature |
Public Types | |
enum class | OSWLevel { MS1 , MS2 , TRANSITION , SIZE_OF_OSWLEVEL } |
for Percolator data read/write operations More... | |
Public Member Functions | |
OSWFile (const String &filename) | |
OSWFile (const OSWFile &rhs)=default | |
OSWFile & | operator= (const OSWFile &rhs)=default |
void | read (OSWData &swath_result) |
void | readMinimal (OSWData &swath_result) |
void | readProtein (OSWData &swath_result, const Size index) |
populates a protein at index index within swath_results with Peptides, unless the protein already has peptides More... | |
UInt64 | getRunID () const |
Static Public Member Functions | |
static void | readToPIN (const std::string &filename, const OSWFile::OSWLevel osw_level, std::ostream &pin_output, const double ipf_max_peakgroup_pep, const double ipf_max_transition_isotope_overlap, const double ipf_min_transition_sn) |
Reads an OSW SQLite file and returns the data on MS1-, MS2- or transition-level as ostream (e.g. stringstream or ofstream). More... | |
static void | writeFromPercolator (const std::string &osw_filename, const OSWFile::OSWLevel osw_level, const std::map< std::string, PercolatorFeature > &features) |
Updates an OpenSWATH OSW SQLite file with the MS1-, MS2- or transition-level results of Percolator. More... | |
Static Public Attributes | |
static constexpr Size | ALL_PROTEINS = -1 |
query all proteins, not just one with a particular ID More... | |
static const std::array< std::string,(Size) OSWLevel::SIZE_OF_OSWLEVEL > | names_of_oswlevel |
Protected Member Functions | |
void | readTransitions_ (OSWData &swath_result) |
void | getFullProteins_ (OSWData &swath_result, Size prot_index=ALL_PROTEINS) |
fill one (prot_id ) or all proteins into swath_result More... | |
void | readMeta_ (OSWData &data) |
set source file and sqMass run-ID More... | |
Private Attributes | |
String | filename_ |
sql file to open/write to More... | |
SqliteConnector | conn_ |
SQL connection. Stays open as long as this object lives. More... | |
bool | has_SCOREMS2_ |
database contains pyProphet's score_MS2 table with qvalues More... | |
This class serves for reading in and writing OpenSWATH OSW files.
See OpenSwathOSWWriter for more functionality.
The reader and writer returns data in a format suitable for PercolatorAdapter. OSW files have a flexible data structure. They contain all peptide query parameters of TraML/PQP files with the detected and quantified features of OpenSwathWorkflow (feature, feature_ms1, feature_ms2 & feature_transition).
The OSWFile reader extracts the feature information from the OSW file for each level (MS1, MS2 & transition) separately and generates Percolator input files. For each of the three Percolator reports, OSWFile writer adds a table (score_ms1, score_ms2, score_transition) with the respective confidence metrics. These tables can be mapped to the corresponding feature tables, are very similar to PyProphet results and can thus be used interchangeably.
|
strong |
opens an OSW file for reading.
Exception::FileNotReadable | if filename does not exist |
|
protected |
fill one (prot_id
) or all proteins into swath_result
[out] | swath_result | Output data. Proteins are cleared before if ALL_PROTEINS is used. |
prot_index | Using ALL_PROTEINS queries all proteins (could take some time) |
UInt64 getRunID | ( | ) | const |
extract the RUN::ID from the sqMass file
Exception::SqlOperationFailed | more than on run exists |
void read | ( | OSWData & | swath_result | ) |
read data from an SQLLite OSW file into swath_result
Depending on the number of proteins, this could take a while.
|
protected |
set source file and sqMass run-ID
void readMinimal | ( | OSWData & | swath_result | ) |
Reads in transitions and a list of protein names/IDs but no peptide/feature/transition mapping data (which could be very expensive). Use in conjunction with on-demand readProtein() to fully populate proteins with peptide/feature data as needed.
populates a protein at index index
within swath_results
with Peptides, unless the protein already has peptides
Internally uses the proteins ID to search for cross referencing peptides and transitions in the OSW file.
swath_result | OSWData obtained from the readMinimal() method |
index | Index into swath_result.getProteins()[index]. Make sure the index is within the vector's size. |
Exception::InvalidValue | if the protein at index does not have any peptides present in the OSW file |
|
static |
Reads an OSW SQLite file and returns the data on MS1-, MS2- or transition-level as ostream (e.g. stringstream or ofstream).
|
protected |
populate transitions of swath_result
Clears swath_result entirely (incl. proteins) before adding transitions.
|
static |
Updates an OpenSWATH OSW SQLite file with the MS1-, MS2- or transition-level results of Percolator.
|
staticconstexpr |
query all proteins, not just one with a particular ID
|
private |
SQL connection. Stays open as long as this object lives.
|
private |
sql file to open/write to
|
private |
database contains pyProphet's score_MS2 table with qvalues
|
static |