ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/gclib/tophat_cpp/align_status.cpp
(Generate patch)
# Line 29 | Line 29
29    _aligned = false;
30    _indelFreeAlignment = false;
31    _unannotatedSpliceFreeAlignment = false;
32 +  _edit_dist = 0xFF;
33   }
34  
35   /**
# Line 40 | Line 41
41    _aligned = cigar.size() > 0;
42    _indelFreeAlignment = true;
43    _unannotatedSpliceFreeAlignment = true;
44 <
44 >  _edit_dist = bh.edit_dist();
45    int j = bh.left();
46    for (size_t c = 0 ; c < cigar.size(); ++c)
47      {
# Line 84 | Line 85
85   */
86   bool AlignStatus::operator<(const AlignStatus& rhs) const
87   {
88 <        int lhs_value = _aligned ? 1 : 0;
89 <        lhs_value += _indelFreeAlignment ? 4 : 0;
88 >  if (rhs._aligned != _aligned) return rhs._aligned;
89 >  if (rhs._edit_dist!=_edit_dist)
90 >      return rhs._edit_dist < _edit_dist;
91 >  //int lhs_value = _aligned ? 1 : 0;
92 >        int lhs_value = _indelFreeAlignment ? 4 : 0;
93          lhs_value += _unannotatedSpliceFreeAlignment ? 2 : 0;
94  
95 <        int rhs_value = rhs._aligned ? 1 : 0;
96 <        rhs_value += rhs._indelFreeAlignment ? 4 : 0;
95 >        //int rhs_value = rhs._aligned ? 1 : 0;
96 >        int rhs_value = rhs._indelFreeAlignment ? 4 : 0;
97          rhs_value += rhs._unannotatedSpliceFreeAlignment ? 2 : 0;
98          return lhs_value < rhs_value;
99   }
# Line 99 | Line 103
103   */
104   bool AlignStatus::operator==(const AlignStatus& rhs) const
105   {
106 <        return ((_aligned == rhs._aligned) &&
106 >        return ((_aligned == rhs._aligned) && (rhs._edit_dist ==_edit_dist) &&
107                  (_indelFreeAlignment == rhs._indelFreeAlignment) &&
108                  (_unannotatedSpliceFreeAlignment == rhs._unannotatedSpliceFreeAlignment));
109   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines