Changeset 1052
- Timestamp:
- May 7, 2009, 12:28:07 AM (14 years ago)
- 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 25 25 Requirements 26 26 27 You need to have a successful install of yat 0.5 or later. 27 You need to have a successful install of yat 0.5.3 or later. The 28 program can be made to compile with any 0.5 version of yat but the 29 qQuantileNormalizer implementation in yat previous to 0.5.3 contains a 30 serious bug. The configure script will check that your yat version is 31 equal to or greater than 0.5.3. 28 32 29 33 -
plugins/base2/net.sf.basedb.normalizers/trunk/src/c++/bin/qQN.cc
r1050 r1052 44 44 45 45 46 void create_target_and _fix_nans(std::vector<double>&,MatrixWeighted&);47 void create_target_and _fix_nans(std::vector<double>&,MatrixWeighted&,48 46 void create_target_and(std::vector<double>&, const MatrixWeighted&); 47 void create_target_and(std::vector<double>&, const MatrixWeighted&, 48 const std::string&); 49 49 50 50 void exp_numbers(MatrixWeighted&); … … 106 106 107 107 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) ); 110 110 log_numbers(target.begin(),target.end()); 111 111 log_numbers(m); … … 134 134 135 135 136 void create_target_and _fix_nans(std::vector<double>& t,MatrixWeighted& m,137 136 void create_target_and(std::vector<double>& t, const MatrixWeighted& m, 137 const std::string& assay) 138 138 { 139 139 std::ifstream is(assay.c_str()); … … 144 144 while (getline(is, line)) { 145 145 size_t found=line.find("yes"); 146 147 146 if (found!=std::string::npos) { 148 147 // use this assay as a part of reference … … 152 151 ++column_contribs[row]; 153 152 } 154 else155 m(row,column).data()=0;156 153 } 157 else158 // this assay as not a part of the reference but fix nan159 for (size_t row=0; row<m.rows(); ++row)160 if (!m(row,column).weight()) // weight either 0 or 1161 m(row,column).data()=0;162 163 154 ++column; 164 155 if (column>m.columns()) … … 174 165 175 166 176 void create_target_and _fix_nans(std::vector<double>& t,MatrixWeighted& m)167 void create_target_and(std::vector<double>& t, const MatrixWeighted& m) 177 168 { 178 169 std::vector<double> temp_target(m.rows(),0.0); … … 185 176 ++column_contribs; 186 177 } 187 else188 m(row,column).data()=0;189 178 if (column_contribs) 190 179 t.push_back(temp_target[row]/=column_contribs); … … 230 219 for(size_t i=0, j=0; i<m.rows(); i++) 231 220 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(); 236 222 if (j<m.columns()-1) 237 223 s << s.fill(); -
plugins/base2/net.sf.basedb.normalizers/trunk/src/c++/configure.ac
r1041 r1052 69 69 else 70 70 yat_found="no" 71 yat_version="0.5 "71 yat_version="0.5.3" 72 72 YAT_CHECK_YAT([${yat_version}],[yat_found="yes"]) 73 73 if (test "${yat_found}" = "yes") ; then
Note: See TracChangeset
for help on using the changeset viewer.