OpenMS
Loading...
Searching...
No Matches
PercolatorTypes.h
Go to the documentation of this file.
1// Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin
2// SPDX-License-Identifier: BSD-3-Clause
3//
4// --------------------------------------------------------------------------
5// $Maintainer: Timo Sachsenberg $
6// $Authors: Timo Sachsenberg $
7// --------------------------------------------------------------------------
8
9#pragma once
10
14
15#include <string>
16#include <vector>
17
18namespace OpenMS
19{
27 struct OPENMS_DLLAPI RescoreInput
28 {
31 std::vector<std::vector<double>> features;
33 std::vector<bool> is_decoy;
39 std::vector<int> cv_group_keys;
42
63 std::vector<int> scan_numbers;
64 std::vector<int> spec_file_numbers;
65 std::vector<double> exp_masses;
66 std::vector<double> calc_masses;
67
80 std::vector<double> feature_matrix;
81
85 std::vector<std::string> peptide_keys;
86
88 size_t rowCount() const
89 {
90 return features.empty() && !feature_matrix.empty() ? is_decoy.size() : features.size();
91 }
92
94 size_t featureCount() const
95 {
96 if (!features.empty()) return features.front().size();
97 return feature_matrix.empty() ? 0 : feature_names.size();
98 }
99
101 const double* row(size_t i) const
102 {
103 return !features.empty() ? features[i].data() : feature_matrix.data() + i * feature_names.size();
104 }
105 };
106
108 struct OPENMS_DLLAPI RescoreOutput
109 {
110 std::vector<double> scores;
111 std::vector<double> q_values;
112 std::vector<double> peps;
116 std::vector<double> peptide_q_values;
117 std::vector<double> peptide_peps;
118 };
119
136 struct OPENMS_DLLAPI PercolatorModel
137 {
139 int format_version = 1;
146 std::vector<double> weights;
153 std::string normalizer_type;
155 int seed = 0;
156 };
157}
std::vector< std::string > StringList
Vector of String.
Definition TypeAliases.h:39
Main OpenMS namespace.
Definition openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19
std::vector< double > peps
Definition PercolatorTypes.h:112
std::vector< double > scores
SVM discriminant score per row.
Definition PercolatorTypes.h:110
std::vector< double > peptide_peps
Definition PercolatorTypes.h:117
std::vector< double > q_values
q-value per row
Definition PercolatorTypes.h:111
StringList feature_names
Definition PercolatorTypes.h:144
std::vector< double > peptide_q_values
Definition PercolatorTypes.h:116
std::string normalizer_type
Definition PercolatorTypes.h:153
std::vector< double > weights
Size = n_features + 1. The last entry is the bias.
Definition PercolatorTypes.h:146
Trained Percolator model: averaged SVM weights in raw feature space.
Definition PercolatorTypes.h:137
Output from Percolator::rescore. Aligned 1:1 with the rows of the RescoreInput (RescoreInput::rowCoun...
Definition PercolatorTypes.h:109
Input to domain-agnostic Percolator::rescore.
Definition PercolatorTypes.h:28
size_t rowCount() const
Number of rows: of features, or else of the dense feature_matrix.
Definition PercolatorTypes.h:88
size_t featureCount() const
Number of features per row: of the first row of features, or else feature_names.size() (0 without row...
Definition PercolatorTypes.h:94
std::vector< double > calc_masses
Definition PercolatorTypes.h:66
std::vector< int > scan_numbers
Optional per-row PIN-compatible fields.
Definition PercolatorTypes.h:63
std::vector< bool > is_decoy
Target (false) or decoy (true) label per row.
Definition PercolatorTypes.h:33
std::vector< std::vector< double > > features
Definition PercolatorTypes.h:31
std::vector< int > cv_group_keys
Definition PercolatorTypes.h:39
std::vector< int > spec_file_numbers
Definition PercolatorTypes.h:64
std::vector< double > exp_masses
Definition PercolatorTypes.h:65
StringList feature_names
Names aligned 1:1 with feature columns; used for logging only.
Definition PercolatorTypes.h:41
std::vector< std::string > peptide_keys
Definition PercolatorTypes.h:85
const double * row(size_t i) const
The featureCount() values of row i: of features, or else of the dense feature_matrix.
Definition PercolatorTypes.h:101
std::vector< double > feature_matrix
The feature matrix in one dense block, in place of features.
Definition PercolatorTypes.h:80