OpenMS
2.7.0
|
Holds all or partial information from an OSW file. More...
#include <OpenMS/DATASTRUCTURES/OSWData.h>
Public Member Functions | |
void | addTransition (const OSWTransition &tr) |
Adds a transition; do this before adding Proteins. More... | |
void | addProtein (OSWProtein &&prot) |
const std::vector< OSWProtein > & | getProteins () const |
void | setProtein (const Size index, OSWProtein &&protein) |
Size | transitionCount () const |
get the total number of transitions (chromatograms) More... | |
const OSWTransition & | getTransition (const UInt32 id) const |
obtain a certain transition meta information with id (this matches the ID of a chromatogram in an sqMass file). More... | |
const std::map< UInt32, OSWTransition > & | getTransitions () const |
get all transitions mapped by their ID (UInt32) More... | |
void | setSqlSourceFile (const String &filename) |
const String & | getSqlSourceFile () const |
void | setRunID (const UInt64 run_id) |
UInt64 | getRunID () const |
void | clear () |
forget all data More... | |
void | clearProteins () |
only forget protein data More... | |
void | buildNativeIDResolver (const MSExperiment &chrom_traces) |
Create an internal mapping from the nativeIDs of all chromatograms (extracted by OpenSwathWorkflow (e.g. as sqMass file)) to their index (.getChromatograms[index]) More... | |
UInt | fromNativeID (int transition_id) const |
Protected Member Functions | |
void | checkTransitions_ (const OSWProtein &prot) const |
Private Attributes | |
std::map< UInt32, OSWTransition > | transitions_ |
std::vector< OSWProtein > | proteins_ |
String | source_file_ |
remember from which sql OSW file this data is loaded (to lazy load more data) More... | |
UInt64 | run_id_ |
the ID of this run from the SQL RUN table More... | |
std::map< UInt32, UInt32 > | transID_to_index_ |
map a Transition.ID (==native_id) to a chromatogram index in the sqMass experiment which contains the raw data More... | |
Holds all or partial information from an OSW file.
First, fill in all transitions and only then add proteins (which reference transitions via their transition-ids deep down). References will be checked and enforced (exception otherwise – see addProtein()).
void addProtein | ( | OSWProtein && | prot | ) |
Adds a protein, which has all its subcomponents already populated All transition references internally are checked to make sure they are valid. You can add stub proteins, by omitting their peptide references.
Exception::Precondition() | if transition IDs within protein are unknown |
|
inline |
Adds a transition; do this before adding Proteins.
References OSWTransition::getID().
void buildNativeIDResolver | ( | const MSExperiment & | chrom_traces | ) |
Create an internal mapping from the nativeIDs of all chromatograms (extracted by OpenSwathWorkflow (e.g. as sqMass file)) to their index (.getChromatograms[index])
The mapping is stored internally and can be used to translate transition.ids (which are native_ids) to a chromatogram index of the external sqMass file.
The mapping can be queried using fromNativeID(int transition.id).
Make sure that the other OSW data is loaded (at least via OSWFile::readMinimal()) before building this mapping here.
chrom_traces | The external sqMass file, which we build the mapping on |
Exception::MissingInformation | if any nativeID is not known internally |
Exception::Precondition | if the run_ids do not match |
|
protected |
All transition references are checked against transitions_ to make sure they are valid.
Exception::Precondition() | if transition IDs within protein are unknown |
void clear | ( | ) |
forget all data
void clearProteins | ( | ) |
only forget protein data
UInt fromNativeID | ( | int | transition_id | ) | const |
resolve a transition.id (=nativeID) to a simple chromatogram index (.getChromatograms[index]) of the corresponding sqMass file Requires prior call to buildNativeIDResolver(), throws Exception::InvalidValue otherwise (or when nativeID is not known)
|
inline |
constant accessor to proteins. There is no mutable access to prevent accidental violation of invariants (i.e. no matching transitions)
|
inline |
|
inline |
|
inline |
obtain a certain transition meta information with id
(this matches the ID of a chromatogram in an sqMass file).
|
inline |
get all transitions mapped by their ID (UInt32)
|
inline |
Replace existing protein at position @index Note: this is NOT the protein ID, but the index into the internal protein vector. See getProteins()
index | A valid index into the getProteins() vector |
protein | The protein to replace the existing one |
Exception::Precondition() | if transition IDs within protein are unknown |
|
inline |
|
inline |
|
inline |
get the total number of transitions (chromatograms)
|
private |
|
private |
the ID of this run from the SQL RUN table
|
private |
remember from which sql OSW file this data is loaded (to lazy load more data)
map a Transition.ID (==native_id) to a chromatogram index in the sqMass experiment which contains the raw data
|
private |