256{
257
258 std::vector<pappso::specpeptidoms::Location> locations;
259 std::vector<double> potential_mass_errors;
260 const QString &sequence = protein_ptr->
getSequence();
261
262
264 {
265 if((sequence.size() >= 8) &&
267 return;
268
269 semi_global_alignment.
fastAlign(*experimental_spectrum.get(), protein_ptr);
270
272
273 qDebug() << "locations.size():" << locations.size();
274 for(auto loc : locations)
275 {
276 QCborMap new_cbor_psm;
277 qDebug() << "beginning=" << loc.beginning << "length=" << loc.length
278 << "tree=" << loc.tree << "score=" << loc.score
279 << "protein=" << loc.proteinPtr->getAccession();
281 *experimental_spectrum.get(), loc.proteinPtr, loc.beginning, loc.length);
282 qDebug() << "Completed preciseAlign";
283
286
287
288
289
290 if(best_alignment.
end > (std::size_t)sequence.size())
291 {
293 "(std::size_t)sequence.size() : %1 %2")
294 .arg(best_alignment.
end)
295 .arg(sequence.size()));
296 }
298 best_alignment.
shifts.size() > 0)
299 {
300 qDebug();
301 potential_mass_errors =
304 qDebug();
306 loc.proteinPtr,
307 loc.beginning,
308 loc.length,
309 potential_mass_errors);
310
311 qDebug() << "semi_global_alignment.getBestAlignment()";
314 if(best_post_processed_alignment.
SPC > best_alignment.
SPC)
315 {
316 qDebug() << "Best post-processed alignment"
318 << best_post_processed_alignment.
score <<
"SPC"
319 << best_post_processed_alignment.
SPC;
321 old_cbor_psm_map,
322 new_cbor_psm,
324 best_post_processed_alignment);
325 }
326 else
327 {
328 qDebug() << "no improvement in post-processing";
330 old_cbor_psm_map,
331 new_cbor_psm,
333 best_alignment);
334 }
335 }
336 else
337 {
338
340 old_cbor_psm_map,
341 new_cbor_psm,
343 best_alignment);
344 }
345
346 if(!new_cbor_psm.isEmpty())
347 {
348 new_psm_arr.push_back(new_cbor_psm);
349 }
350 }
351 }
352}
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