| 1282 | } |
| 1283 | |
| 1284 | int GenomeCopyNumber::fillInRatio() { |
| 1285 | vector <float> countValues; |
| 1286 | vector<ChrCopyNumber>::iterator it; |
| 1287 | |
| 1288 | for ( it=chrCopyNumber_.begin() ; it != chrCopyNumber_.end(); it++ ) { |
| 1289 | if ((sex_.compare("XY")==0) && (it->getChromosome().find("X")!=string::npos || it->getChromosome().find("Y")!=string::npos)) { |
| 1290 | //should take into account that normally one has only one copy of X and Y.. |
| 1291 | it->fillInRatio(isRatioLogged_); |
| 1292 | } else { |
| 1293 | it->fillInRatio(isRatioLogged_); |
| 1294 | for (int i = 0; i< it->getLength(); i++) { |
| 1295 | if (it->getValueAt(i)>0) { |
| 1296 | countValues.push_back(it->getRatioAtBin(i)); |
| 1297 | } |
| 1298 | } |
| 1299 | } |
| 1300 | } |
| 1301 | float median=get_medianNotNA(countValues); |
| 1302 | for ( it=chrCopyNumber_.begin() ; it != chrCopyNumber_.end(); it++ ) { |
| 1303 | if (!isRatioLogged_) { |
| 1304 | it->recalculateRatio(median); |
| 1305 | } else { |
| 1306 | it->recalculateLogRatio(median); |
| 1307 | } |
| 1308 | } |
| 1309 | return 1; |
| 1310 | } |
| 1311 | |
| 1312 | int GenomeCopyNumber::calculateRatio( GenomeCopyNumber & controlCopyNumber, int degree, bool intercept) { |
| 1313 |
nothing calls this directly
no test coverage detected