Changeset 1052


Ignore:
Timestamp:
May 7, 2009, 12:28:07 AM (12 years ago)
Author:
Jari Häkkinen
Message:

Fixes #208. Reverted changeset:1045 and added requirement on yat 0.5.3.

Location:
plugins/base2/net.sf.basedb.normalizers/trunk/src/c++
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • plugins/base2/net.sf.basedb.normalizers/trunk/src/c++/README

    r1009 r1052  
    2525Requirements
    2626
    27 You need to have a successful install of yat 0.5 or later.
     27You need to have a successful install of yat 0.5.3 or later. The
     28program can be made to compile with any 0.5 version of yat but the
     29qQuantileNormalizer implementation in yat previous to 0.5.3 contains a
     30serious bug. The configure script will check that your yat version is
     31equal to or greater than 0.5.3.
    2832
    2933
  • plugins/base2/net.sf.basedb.normalizers/trunk/src/c++/bin/qQN.cc

    r1050 r1052  
    4444
    4545
    46 void create_target_and_fix_nans(std::vector<double>&, MatrixWeighted&);
    47 void create_target_and_fix_nans(std::vector<double>&, MatrixWeighted&,
    48                                 const std::string&);
     46void create_target_and(std::vector<double>&, const MatrixWeighted&);
     47void create_target_and(std::vector<double>&, const MatrixWeighted&,
     48                       const std::string&);
    4949
    5050void exp_numbers(MatrixWeighted&);
     
    106106
    107107  std::vector<double> target;
    108   ( assay.present() ? create_target_and_fix_nans(target,m,assay.value()) :
    109                       create_target_and_fix_nans(target,m) );
     108  ( assay.present() ? create_target_and(target,m,assay.value()) :
     109                      create_target_and(target,m) );
    110110  log_numbers(target.begin(),target.end());
    111111  log_numbers(m);
     
    134134
    135135
    136 void create_target_and_fix_nans(std::vector<double>& t, MatrixWeighted& m,
    137                                 const std::string& assay)
     136void create_target_and(std::vector<double>& t, const MatrixWeighted& m,
     137                       const std::string& assay)
    138138{
    139139  std::ifstream is(assay.c_str());
     
    144144  while (getline(is, line)) {
    145145    size_t found=line.find("yes");
    146 
    147146    if (found!=std::string::npos) {
    148147      // use this assay as a part of reference
     
    152151          ++column_contribs[row];
    153152        }
    154         else
    155           m(row,column).data()=0;
    156153    }
    157     else
    158       // this assay as not a part of the reference but fix nan
    159       for (size_t row=0; row<m.rows(); ++row)
    160         if (!m(row,column).weight()) // weight either 0 or 1
    161           m(row,column).data()=0;
    162 
    163154    ++column;
    164155    if (column>m.columns())
     
    174165
    175166
    176 void create_target_and_fix_nans(std::vector<double>& t, MatrixWeighted& m)
     167void create_target_and(std::vector<double>& t, const MatrixWeighted& m)
    177168{
    178169  std::vector<double> temp_target(m.rows(),0.0);
     
    185176        ++column_contribs;
    186177      }
    187       else
    188         m(row,column).data()=0;
    189178    if (column_contribs)
    190179      t.push_back(temp_target[row]/=column_contribs);
     
    230219  for(size_t i=0, j=0; i<m.rows(); i++)
    231220    for (j=0; j<m.columns(); j++) {
    232       if (m(i,j).weight())
    233         s << m(i,j).data();
    234       else
    235         s << "nan";
     221      s << m(i,j).data();
    236222      if (j<m.columns()-1)
    237223        s << s.fill();
  • plugins/base2/net.sf.basedb.normalizers/trunk/src/c++/configure.ac

    r1041 r1052  
    6969else
    7070  yat_found="no"
    71   yat_version="0.5"
     71  yat_version="0.5.3"
    7272  YAT_CHECK_YAT([${yat_version}],[yat_found="yes"])
    7373  if (test "${yat_found}" = "yes") ; then
Note: See TracChangeset for help on using the changeset viewer.