find closest value to k/ploidy for medianValue
| 1725 | |
| 1726 | //find closest value to k/ploidy for medianValue |
| 1727 | float ChrCopyNumber::getLevelAt(int unsigned i, int ploidy) { |
| 1728 | float value = medianValues_[i]; |
| 1729 | float valueToReturn; |
| 1730 | if (value >0) |
| 1731 | valueToReturn = float(int(value*ploidy + 0.5))/ploidy; |
| 1732 | else |
| 1733 | valueToReturn = float(int(value*ploidy))/ploidy; |
| 1734 | |
| 1735 | //use BAF for ambigious cases: |
| 1736 | if (valueToReturn>0 && estBAFuncertaintyPerFrag_.size()>i && BAFsymbPerFrag_[i].compare("-")!=0 &&BAFsymbPerFrag_[i]!="" && BAFsymbPerFrag_[i].length()!=valueToReturn*ploidy && (estBAFuncertaintyPerFrag_[i] < MAXUncertainty)) { |
| 1737 | //change Level value if there is no incertainty: |
| 1738 | valueToReturn=BAFsymbPerFrag_[i].length()*1./ploidy; |
| 1739 | } |
| 1740 | |
| 1741 | return valueToReturn; |
| 1742 | |
| 1743 | } |
| 1744 | |
| 1745 | |
| 1746 | void ChrCopyNumber::setRCountToZeroForNNNN() { |
no test coverage detected