Commit bf3a7423 authored by Mikaël Salson's avatar Mikaël Salson

segment.{h,cpp}: align_against_collections with or without banded DP

This can be useful to align against a collection without the bandwidth
optimisation (see #2767).
parent 3603cf3a
......@@ -836,12 +836,13 @@ bool comp_pair (pair<int,int> i,pair<int,int> j)
* @param local: if true, Local alignment (D segment), otherwise LocalEndWithSomeDeletions and onlyBottomTriangle (V and J segments)
* @param box: the AligBox to fill
* @param segment_cost: the cost used by the dynamic programing
* @param banded_dp: should we perform a banded DP?
* @post box is filled
*/
void align_against_collection(string &read, BioReader &rep, int forbidden_rep_id,
bool reverse_ref, bool reverse_both, bool local,
AlignBox *box, Cost segment_cost)
AlignBox *box, Cost segment_cost, bool banded_dp)
{
int best_score = MINUS_INF ;
......@@ -858,6 +859,7 @@ void align_against_collection(string &read, BioReader &rep, int forbidden_rep_id
// With reverse_ref, the read is reversed to prevent calling revcomp on each reference sequence
string sequence_or_rc = revcomp(read, reverse_ref);
bool onlyBottomTriangle = !local && banded_dp ;
for (int r = 0 ; r < rep.size() ; r++)
{
......@@ -870,7 +872,6 @@ void align_against_collection(string &read, BioReader &rep, int forbidden_rep_id
reverse_both, reverse_both,
rep.read(r).marked_pos);
bool onlyBottomTriangle = !local ;
int score = dp.compute(onlyBottomTriangle, BOTTOM_TRIANGLE_SHIFT);
if (local==true){
......
......@@ -390,6 +390,6 @@ class FineSegmenter : public Segmenter
void align_against_collection(string &read, BioReader &rep, int forbidden_rep_id,
bool reverse_ref, bool reverse_both, bool local,
AlignBox *box, Cost segment_cost);
AlignBox *box, Cost segment_cost, bool banded_dp=true);
#endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment