255{
256
257 std::vector<pappso::specpeptidoms::Location> locations;
258 std::vector<double> potential_mass_errors;
259 const QString &sequence = protein_ptr->
getSequence();
260
261
263 {
264 if((sequence.size() >= 8) &&
266 return;
267
268 semi_global_alignment.
fastAlign(*experimental_spectrum.get(), protein_ptr);
269
271
272 qDebug() << "locations.size():" << locations.size();
273 for(auto loc : locations)
274 {
275 QCborMap new_cbor_psm;
276 qDebug() << "beginning=" << loc.beginning << "length=" << loc.length
277 << "tree=" << loc.tree << "score=" << loc.score
278 << "protein=" << loc.proteinPtr->getAccession();
280 *experimental_spectrum.get(), loc.proteinPtr, loc.beginning, loc.length);
281 qDebug() << "Completed preciseAlign";
282
285
286
287
288
289 if(best_alignment.
end > (std::size_t)sequence.size())
290 {
292 "(std::size_t)sequence.size() : %1 %2")
293 .arg(best_alignment.
end)
294 .arg(sequence.size()));
295 }
297 best_alignment.
shifts.size() > 0)
298 {
299 qDebug();
300 potential_mass_errors =
303 qDebug();
305 loc.proteinPtr,
306 loc.beginning,
307 loc.length,
308 potential_mass_errors);
309
310 qDebug() << "semi_global_alignment.getBestAlignment()";
313 if(best_post_processed_alignment.
SPC > best_alignment.
SPC)
314 {
315 qDebug() << "Best post-processed alignment"
317 << best_post_processed_alignment.
score <<
"SPC"
318 << best_post_processed_alignment.
SPC;
320 old_cbor_psm_map,
321 new_cbor_psm,
323 best_post_processed_alignment);
324 }
325 else
326 {
327 qDebug() << "no improvement in post-processing";
329 old_cbor_psm_map,
330 new_cbor_psm,
332 best_alignment);
333 }
334 }
335 else
336 {
337
339 old_cbor_psm_map,
340 new_cbor_psm,
342 best_alignment);
343 }
344
345 if(!new_cbor_psm.isEmpty())
346 {
347 new_psm_arr.push_back(new_cbor_psm);
348 }
349 }
350 }
351}
void storeAlignment(bool is_reverse, const QCborMap &old_cbor_psm, QCborMap &new_cbor_psm, const QString &accession, const pappso::specpeptidoms::Alignment &alignment)
std::vector< Location > getLocations() const
Returns a vector containing the saved locations.
QString toInterpretation() const
const Alignment & getBestAlignment() const
Returns a const ref to m_best_alignment.
void postProcessingAlign(const SpOMSSpectrum &spectrum, const SpOMSProtein *protein_ptr, std::size_t beginning, std::size_t length, const std::vector< double > &shifts)
performs the post-processing : generates corrected spectra and align them
void preciseAlign(const SpOMSSpectrum &spectrum, const SpOMSProtein *protein_ptr, const std::size_t beginning, const std::size_t length)
performs the second alignment search between a protein subsequence and a spectrum.
void fastAlign(const SpOMSSpectrum &spectrum, const SpOMSProtein *protein_ptr)
perform the first alignment search between a protein sequence and a spectrum. The member location hea...
static bool checkSequenceDiversity(const QString &sequence, std::size_t window, std::size_t minimum_aa_diversity)
check that the sequence has a minimum of amino acid checkSequenceDiversity
static std::vector< double > getPotentialMassErrors(const pappso::AaCode &aa_code, const Alignment &alignment, const QString &protein_seq)
Returns a list of the potential mass errors corresponding to the provided alignment in the provided p...
LocationSaver getLocationSaver() const
Returns a copy of m_location_saver.
const QString & getSequence() const
const QString getAccession() const
std::vector< double > shifts
PeptideModel m_peptideModel