Skip to content

Commit

Permalink
Ignore target range for hit culling in frameshift mode.
Browse files Browse the repository at this point in the history
  • Loading branch information
bbuchfink committed Nov 21, 2022
1 parent cfc1524 commit 1938c34
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/align/legacy/query_mapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ void Target::inner_culling()
filter_evalue = DBL_MAX;
}
for (list<Hsp>::iterator i = hsps.begin(); i != hsps.end();) {
if (i->is_enveloped_by(hsps.begin(), i, 0.5))
if (i->query_range_enveloped_by(hsps.begin(), i, 0.5))
i = hsps.erase(i);
else
++i;
Expand Down
14 changes: 14 additions & 0 deletions src/basic/hssp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,20 @@ bool Hsp::is_enveloped_by(std::list<Hsp>::const_iterator begin, std::list<Hsp>::
return false;
}

bool Hsp::query_range_enveloped_by(const Hsp& hsp, double p) const
{
return query_source_range.overlap_factor(hsp.query_source_range) >= p;
}

bool Hsp::query_range_enveloped_by(std::list<Hsp>::const_iterator begin, std::list<Hsp>::const_iterator end, double p) const
{
for (list<Hsp>::const_iterator i = begin; i != end; ++i)
if (query_range_enveloped_by(*i, p))
return true;
return false;
}


void Hsp::push_match(Letter q, Letter s, bool positive)
{
if (q == s) {
Expand Down
2 changes: 2 additions & 0 deletions src/basic/match.h
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,8 @@ struct Hsp

bool is_enveloped_by(const Hsp &hsp, double p) const;
bool is_enveloped_by(std::list<Hsp>::const_iterator begin, std::list<Hsp>::const_iterator end, double p) const;
bool query_range_enveloped_by(const Hsp& hsp, double p) const;
bool query_range_enveloped_by(std::list<Hsp>::const_iterator begin, std::list<Hsp>::const_iterator end, double p) const;
bool is_weakly_enveloped_by(std::list<Hsp>::const_iterator begin, std::list<Hsp>::const_iterator end, int cutoff) const;
void push_back(const DiagonalSegment &d, const TranslatedSequence &query, const Sequence& subject, bool reversed);
void push_match(Letter q, Letter s, bool positive);
Expand Down

0 comments on commit 1938c34

Please sign in to comment.