Ignore:
Timestamp:
Sep 14, 2007, 8:59:46 PM (16 years ago)
Author:
Peter
Message:

Adding Smith-Waterman local alignment and modified ssearch to use this instead. Also added some convenient max functions in stl_utility.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/yat/utility/Alignment.h

    r867 r869  
    2727*/
    2828
     29#include <string>
    2930#include <utility>
    3031#include <vector>
     
    6162
    6263  /**
    63      SSearch does a rigorous Smith-Waterman (Needleman-Wunsch with no gap
    64      cost) search for similarity between a sequnces. For long sequences this
    65      may be very expensive (both in time and space) and BLAST or FASTA is
    66      preferable.
     64     \brief Local alignment following the Smith-Waterman
     65     algorithm.
    6766
    68      @return number of matches
     67     The original paper can be found here:
     68     http://gel.ym.edu.tw/~chc/AB_papers/03.pdf
     69
     70     Instead of looking at each sequence in its entirety the S-W algorithm
     71     compares segemnt of all possible lengths (LOCAL alignment) and chooses
     72     whichever maximises the similarity measure.
     73
     74     \param s score matrix in which element $(i,j)$ is the score between
     75     element $i$ in first sequence vs element $j$ in second sequence.
     76     \param gap cost for having a gap (insertion or deletion)
     77     \param open_gap cost for open up a gap in sequence, in other words, for a
     78     gap of length $l$ the total cost is $open_gap + l*gap$.
    6979   */
    70   unsigned int ssearch(std::string first, std::string second);
     80  double SmithWaterman(const utility::matrix& s,
     81                       double gap, double open_gap);
     82
     83  /**
     84     SSearch does a rigorous Smith-Waterman search for similarity between
     85     sequnces. For long sequences this may be very expensive (both in time and
     86     space) and BLAST or FASTA is preferable.
     87
     88     @return score
     89   */
     90  double ssearch(std::string first, std::string second, double gap,
     91                 double open_gap);
    7192
    7293}}} // of namespace utility, yat, and theplu
Note: See TracChangeset for help on using the changeset viewer.