Changeset 2816


Ignore:
Timestamp:
Aug 28, 2012, 4:44:03 AM (9 years ago)
Author:
Peter
Message:

change name of function cigar => alignment

Location:
trunk/yat/utility
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/yat/utility/Aligner.cc

    r2815 r2816  
    7474
    7575    columns_ = x.columns();
    76     cigar_.resize(columns_*x.rows(), none);
     76    alignment_.resize(columns_*x.rows(), none);
    7777
    7878    for (size_t i=1; i<x.rows(); ++i)
     
    8181        if (x(i-1, j-1) + score(i-1, j-1) > x(i,j)) {
    8282          x(i,j) = x(i-1, j-1) + score(i-1, j-1);
    83           cigarp(i, j) = diagonal;
     83          cigar(i, j) = diagonal;
    8484        }
    8585
     
    8787          if (x(i-1, j)-horizon_gap_ > x(i,j)) {
    8888            x(i,j) = x(i,j-1) - horizon_gap_;
    89             cigarp(i,j) = right;
     89            cigar(i,j) = right;
    9090          }
    9191        }
    9292        else if(x(i,j-1)-horizon_gap_-open_horizon_gap_ > x(i,j)) {
    9393          x(i,j) = x(i,j-1) - horizon_gap_ - open_horizon_gap_;
    94           cigarp(i,j) = right;
     94          cigar(i,j) = right;
    9595        }
    9696
     
    9898          if (x(i-1,j) - vertical_gap_ > x(i,j)) {
    9999            x(i,j) = x(i-1,j) - vertical_gap_;
    100             cigarp(i,j) = down;
     100            cigar(i,j) = down;
    101101          }
    102102        }
    103103        else if (x(i-1,j) - vertical_gap_ - open_vertical_gap_ > x(i,j)) {
    104104          x(i,j) = x(i-1,j) - vertical_gap_ - open_vertical_gap_;
    105           cigarp(i,j) = down;
     105          cigar(i,j) = down;
    106106        }
    107107      }
     
    109109
    110110
    111   const Aligner::direction& Aligner::cigar(size_t i, size_t j) const
     111  const Aligner::direction& Aligner::alignment(size_t i, size_t j) const
    112112  {
    113     return cigar_[i*columns_ + j];
     113    return alignment_[i*columns_ + j];
    114114  }
    115115
    116116
    117   Aligner::direction& Aligner::cigarp(size_t i, size_t j)
     117  Aligner::direction& Aligner::cigar(size_t i, size_t j)
    118118  {
    119     return cigar_[i*columns_ + j];
     119    return alignment_[i*columns_ + j];
    120120  }
    121121
  • trunk/yat/utility/Aligner.h

    r2815 r2816  
    5151       Enum used to describe alignment.
    5252
    53        \see cigar
     53       \see alignment
    5454     */
    5555    enum direction { none, right, down, diagonal };
     
    120120       was aligned with element j-1 in second sequence.
    121121    */
    122     const direction& cigar(size_t i, size_t j) const;
     122    const direction& alignment(size_t i, size_t j) const;
    123123
    124124  private:
    125     direction& cigarp(size_t i, size_t j);
     125    direction& cigar(size_t i, size_t j);
    126126
    127127    size_t columns_;
     
    130130    double horizon_gap_;
    131131    double open_horizon_gap_;
    132     std::vector<direction> cigar_;
     132    std::vector<direction> alignment_;
    133133  };
    134134
  • trunk/yat/utility/Alignment.cc

    r2815 r2816  
    5151    path.clear();
    5252    while (i && j) {
    53       if (aligner.cigar(i,j)==Aligner::diagonal) {
     53      if (aligner.alignment(i,j)==Aligner::diagonal) {
    5454        --i;
    5555        --j;
    5656        path.push_back(std::make_pair(i,j));
    5757      }
    58       else if (aligner.cigar(i,j)==Aligner::right)
     58      else if (aligner.alignment(i,j)==Aligner::right)
    5959        --j;
    6060      else
Note: See TracChangeset for help on using the changeset viewer.