ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/gclib/tophat_cpp/align_status.cpp
(Generate patch)
# Line 30 | Line 30
30    _indelFreeAlignment = false;
31    _unannotatedSpliceFreeAlignment = false;
32    _edit_dist = 0xFF;
33 +  _fusionFreeAlignment = 0;
34   }
35  
36   /**
37   * Parse the cigar string of a BowtieHit in order to determine the alignment status.
38   */
39 < AlignStatus::AlignStatus(const BowtieHit& bh, const JunctionSet& gtf_junctions)
39 < {
39 > AlignStatus::AlignStatus(const BowtieHit& bh, const JunctionSet& gtf_junctions){
40    const vector<CigarOp>& cigar = bh.cigar();
41    _aligned = cigar.size() > 0;
42    _indelFreeAlignment = true;
43 +  _fusionFreeAlignment = true;
44    _unannotatedSpliceFreeAlignment = true;
45    _edit_dist = bh.edit_dist();
46    int j = bh.left();
# Line 68 | Line 69
69          case INS:
70            _indelFreeAlignment = false;
71            break;
72 +        case FUSION_FF:
73 +        case FUSION_FR:
74 +        case FUSION_RF:
75 +        case FUSION_RR:
76 +          _fusionFreeAlignment = false;
77 +          break;
78          default:
79            break;
80          }
# Line 88 | Line 95
95    if (rhs._aligned != _aligned) return rhs._aligned;
96    if (rhs._edit_dist!=_edit_dist)
97        return rhs._edit_dist < _edit_dist;
98 <  //int lhs_value = _aligned ? 1 : 0;
99 <        int lhs_value = _indelFreeAlignment ? 4 : 0;
100 <        lhs_value += _unannotatedSpliceFreeAlignment ? 2 : 0;
101 <
102 <        //int rhs_value = rhs._aligned ? 1 : 0;
103 <        int rhs_value = rhs._indelFreeAlignment ? 4 : 0;
104 <        rhs_value += rhs._unannotatedSpliceFreeAlignment ? 2 : 0;
105 <        return lhs_value < rhs_value;
98 >  
99 >  // int lhs_value = _aligned ? 1 : 0;
100 >  int lhs_value = _fusionFreeAlignment ? 4 : 0;
101 >  lhs_value += _indelFreeAlignment ? 4 : 0;
102 >  lhs_value += _unannotatedSpliceFreeAlignment ? 2 : 0;
103 >
104 >  // int rhs_value = rhs._aligned ? 1 : 0;
105 >  int rhs_value = rhs._fusionFreeAlignment ? 4 : 0;
106 >  rhs_value += rhs._indelFreeAlignment ? 4 : 0;
107 >  rhs_value += rhs._unannotatedSpliceFreeAlignment ? 2 : 0;
108 >  
109 >  return lhs_value < rhs_value;
110   }
111  
112   /**
# Line 105 | Line 116
116   {
117          return ((_aligned == rhs._aligned) && (rhs._edit_dist ==_edit_dist) &&
118                  (_indelFreeAlignment == rhs._indelFreeAlignment) &&
119 <                (_unannotatedSpliceFreeAlignment == rhs._unannotatedSpliceFreeAlignment));
119 >                (_unannotatedSpliceFreeAlignment == rhs._unannotatedSpliceFreeAlignment) &&
120 >                (_fusionFreeAlignment == rhs._fusionFreeAlignment));
121   }
122  
123   bool AlignStatus::operator!=(const AlignStatus& rhs) const
124   {
125          return !((*this) == rhs);
126   }
115
116
117

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines