63{
64
65 if(keys().contains("psm_list"))
66 {
68
71 qualified_mass_spectrum.get()->getPrecursorMz(),
72 qualified_mass_spectrum.get()->getPrecursorCharge());
73
74 QCborArray new_psm_arr;
75 for(QCborValue cbor_psm : value("psm_list").toArray())
76 {
77 QCborMap cbor_psm_map = cbor_psm.
toMap();
78 QCborMap cbor_psm_features;
81
82
83 std::size_t peptide_size = peptide_sp.get()->size();
84 cbor_psm_features.insert(QString("peptide_size"), (unsigned int)peptide_size);
85
87 peptide_sp,
88 qualified_mass_spectrum.get()->getPrecursorCharge(),
91 true);
92 cbor_psm_features.insert(QString("hyperscore"), QCborValue(hyperscore.getHyperscore()));
93
94
96 peptide_sp,
97 qualified_mass_spectrum.get()->getMassSpectrumSPtr().get(),
98 qualified_mass_spectrum.get()->getPrecursorCharge(),
99 2);
100
101 cbor_psm_features.insert(QString("total_intensity"),
103
104 cbor_psm_features.insert(QString("max_intensity"),
105 checkInf(std::log(qualified_mass_spectrum.get()
106 ->getMassSpectrumSPtr()
107 .get()
108 ->maxIntensityDataPoint()
109 .y)));
110
111
112 cbor_psm_features.insert(
113 QString("MaxYionInt"),
115
116
117 cbor_psm_features.insert(
118 QString("MaxBionInt"),
120
121
122 cbor_psm_features.insert(
123 QString("SumYmatchInt"),
125
126
127 cbor_psm_features.insert(
128 QString("SumBmatchInt"),
130
131
132 cbor_psm_features.insert(
133 QString("FracYmatchInt"),
136
137 cbor_psm_features.insert(
138 QString("FracBmatchInt"),
141
142
143 cbor_psm_features.insert(
144 QString("SeqCoverYion"),
146 (double)peptide_size);
147
148 cbor_psm_features.insert(
149 QString("SeqCoverBion"),
151 (double)peptide_size);
152
153
154
155 cbor_psm_features.insert(
156 QString("ConsecutiveYion"),
158
159 cbor_psm_features.insert(
160 QString("ConsecutiveBion"),
162
163
165
166
168
169
170 cbor_psm_features.insert(QString("NumofAnnoPeaks"),
172
173
175 cbor_psm_features.insert(QString("NumofComplementPeaks"), (unsigned int)num_of_pairs);
176 if(num_of_pairs > 0)
177 {
178
179 cbor_psm_features.insert(
180 QString("SumComplementPeaksInt"),
182
183
184 cbor_psm_features.insert(
185 QString("FracComplementPeaksInt"),
188
189 cbor_psm_features.insert(
190 QString("SeqCoverComplementPeaks"),
192 (double)peptide_size);
193 }
195 cbor_psm_features.insert(QString(
"lrSize"), (
unsigned int)lr.
getSize());
196
197
199 if(std::isnan(coeff_of_determination))
200 {
201 }
202 else
203 {
204 cbor_psm_features.insert(QString("lrCoeffDet"), coeff_of_determination);
205 }
206
207
208 QCborMap psm_eval = cbor_psm_map.value("eval").toMap();
209 psm_eval.remove(QString("features"));
210 psm_eval.insert(QString("features"), cbor_psm_features);
211 cbor_psm_map.remove(QString("eval"));
212 cbor_psm_map.insert(QString("eval"), psm_eval);
213
214 new_psm_arr.push_back(cbor_psm_map);
215 }
216
217 insert(QString("psm_list"), new_psm_arr);
218 }
219}
std::size_t getSize() const
get data size
double getCoefficientOfDetermination() const
get Coefficient of determination (R2)
Class to represent a mass spectrum.
std::size_t getNumberOfMatchedIons() const
number of matched ions (peaks)
double getTotalIntensity() const
sum of all peak intensities (matched or not)
double getMatchedMzDiffMean() const
get mean deviation of matched peak mass delta
double getTotalIntensityOfMatchedIonComplementPairs() const
intensity of matched ion complement
std::size_t countMatchedIonComplementPairs() const
count the number of matched ion complement
std::size_t getComplementPairsAaSequenceCoverage()
number of amino acid covered by matched complement pairs of ions
LinearRegression getIonIsotopeLinearRegression() const
double getMaxIntensityPeakIonMatch(PeptideIon ion_type) const
std::size_t getMaxConsecutiveIon(PeptideIon ion_type)
get the maximum consecutive fragments of one ion type
void setPeptideSpectrumCharge(const pappso::PeptideSp peptideSp, const MassSpectrum *p_spectrum, unsigned int parent_charge, unsigned int max_isotope_number)
double getIntensityOfMatchedIon(PeptideIon ion_type)
get the sum of intensity of a specific ion
double getMatchedMzDiffSd() const
get standard deviation of matched peak mass delta
std::size_t getAaSequenceCoverage(PeptideIon ion_type)
number of amino acid covered by matched ions
std::map< pappso_double, pappso_double > toMap() const
MassSpectrum process(const MassSpectrum &spectrum, pappso_double parent_ion_mass, unsigned int parent_charge) const
process raw spectrum to prepare hyperscore computation
pappso::QualifiedMassSpectrumSPtr getCurrentQualifiedMassSpectrumSPtr() const
double checkInf(double input) const
std::shared_ptr< QualifiedMassSpectrum > QualifiedMassSpectrumSPtr
std::shared_ptr< const Peptide > PeptideSp