Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ namespace OpenMS
void updateMembers_() override;

/// Sequence similarity based on matching ions
double getSimilarity_(AASequence seq1, AASequence seq2) override;
double getSimilarity_(const AASequence& seq1, const AASequence& seq2) override;

};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ namespace OpenMS
ConsensusIDAlgorithmPEPMatrix& operator=(const ConsensusIDAlgorithmPEPMatrix&);

/// Sequence similarity based on substitution matrix (ignores PTMs)
double getSimilarity_(AASequence seq1, AASequence seq2) override;
double getSimilarity_(const AASequence& seq1, const AASequence& seq2) override;

// Docu in base class
void updateMembers_() override;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ namespace OpenMS

@return Similarity between two sequences in the range [0, 1]
*/
virtual double getSimilarity_(AASequence seq1, AASequence seq2) = 0;
virtual double getSimilarity_(const AASequence& seq1, const AASequence& seq2) = 0;

private:
/// Not implemented
Expand Down
8 changes: 4 additions & 4 deletions src/openms/source/ANALYSIS/ID/ConsensusIDAlgorithmPEPIons.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,12 @@ namespace OpenMS
}


double ConsensusIDAlgorithmPEPIons::getSimilarity_(AASequence seq1,
AASequence seq2)
double ConsensusIDAlgorithmPEPIons::getSimilarity_(const AASequence& seq1,
const AASequence& seq2)
{
if (seq1 == seq2) return 1.0;
// order of sequences matters for cache look-up:
if (seq2 < seq1) std::swap(seq1, seq2); // "operator>" not defined
// order of sequences matters for cache look-up:
if (seq2 < seq1) getSimilarity_(seq2, seq1); // "operator>" not defined
pair<AASequence, AASequence> seq_pair = make_pair(seq1, seq2);
SimilarityCache::iterator pos = similarities_.find(seq_pair);
if (pos != similarities_.end()) return pos->second; // score found in cache
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ namespace OpenMS
similarities_.clear();
}

double ConsensusIDAlgorithmPEPMatrix::getSimilarity_(AASequence seq1,
AASequence seq2)
double ConsensusIDAlgorithmPEPMatrix::getSimilarity_(const AASequence& seq1,
const AASequence& seq2)
{
// here we cannot take modifications into account:
String unmod_seq1 = seq1.toUnmodifiedString();
Expand Down
6 changes: 3 additions & 3 deletions src/openms/source/FORMAT/FASTAFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -198,9 +198,9 @@ namespace OpenMS
}
++entries_read_;

protein.identifier = std::move(id_);
protein.description = std::move(description_);
protein.sequence = std::move(seq_);
protein.identifier = id_;
protein.description = description_;
protein.sequence = seq_;

return true;
}
Expand Down