| 460 | } |
| 461 | |
| 462 | void ChrCopyNumber::calculateRatio(ChrCopyNumber control, const double * a, const int degree){ |
| 463 | if ((int)ratio_.size()!=length_) |
| 464 | ratio_.resize(length_); |
| 465 | for (int i = 0; i<length_; i++) { |
| 466 | if ((control.getLength()>i)&&(control.getValueAt(i) != 0)){ |
| 467 | |
| 468 | if (mappabilityProfile_.size() == 0 || mappabilityProfile_[i] > minMappabilityPerWindow) { |
| 469 | ratio_[i] = readCount_[i]/polynomial(control.getValueAt(i),a,1,degree); |
| 470 | if (ratio_[i]<0) |
| 471 | ratio_[i] = NA; |
| 472 | } else |
| 473 | ratio_[i] = NA; |
| 474 | |
| 475 | } else |
| 476 | if (readCount_[i]==0) |
| 477 | //ratio_[i] = 1; |
| 478 | ratio_[i] = NA; |
| 479 | else |
| 480 | ratio_[i] = NA; |
| 481 | //cout << readCount_[i] << "\t" << control.getValueAt(i) << "\t" << ratio_[i] << "\n"; |
| 482 | } |
| 483 | } |
| 484 | |
| 485 | void ChrCopyNumber::recalculateRatio(ChrCopyNumber control){ |
| 486 | for (int i = 0; i<length_; i++) { |
no test coverage detected