Changeset 867 for trunk/yat/utility


Ignore:
Timestamp:
Sep 13, 2007, 9:36:50 PM (14 years ago)
Author:
Peter
Message:

adding function doing a SSEARCH between two strings

Location:
trunk/yat/utility
Files:
2 edited

Legend:

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

    r865 r867  
    3333namespace yat {
    3434namespace utility {
     35
     36  unsigned int ssearch(std::string first, std::string second)
     37  {
     38    matrix m(first.size(), second.size());
     39    for (size_t i=0; i<first.size(); ++i)
     40      for (size_t j=0; j<second.size(); ++j)
     41        m(i,j) = (first[i]==second[j] ? 1 : 0);
     42    std::vector<std::pair<size_t, size_t> > path;
     43    return static_cast<unsigned int>(NeedlemanWunsch(m,path,0));
     44  }
     45
    3546
    3647  double NeedlemanWunsch(const utility::matrix& s,
  • trunk/yat/utility/Alignment.h

    r865 r867  
    6060                         const double gap);
    6161
     62  /**
     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.
     67
     68     @return number of matches
     69   */
     70  unsigned int ssearch(std::string first, std::string second);
     71
    6272}}} // of namespace utility, yat, and theplu
    6373
Note: See TracChangeset for help on using the changeset viewer.