MCPcopy Create free account
hub / github.com/BoevaLab/FREEC / recalculateRatioWithContam

Method recalculateRatioWithContam

src/ChrCopyNumber.cpp:660–684  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

658}
659
660void ChrCopyNumber::recalculateRatioWithContam (float contamination, float normGenytype, bool isLogged) { //normGenytype==1 if AB, normGenytype==0.5 if A
661 if (!isLogged) {
662 for (int i = 0; i<length_; i++)
663 if (ratio_[i] != NA) {
664 //ratio_[i] = (ratio_[i]-contamination*normGenytype)/(1-contamination); //correct only for ploidy 2
665 ratio_[i] = (ratio_[i]*(1-contamination+2*contamination/ploidy_) -contamination*normGenytype/ploidy_*2)/(1-contamination);
666
667 if (ratio_[i]<0)
668 ratio_[i] = 0;
669 }
670 } else {
671 for (int i = 0; i<length_; i++)
672 if (ratio_[i] != NA) {
673 float realCopy = pow(2,ratio_[i]);
674 ratio_[i] = (realCopy*(1-contamination+2*contamination/ploidy_) -contamination*normGenytype/ploidy_*2)/(1-contamination);
675 if (ratio_[i]<0)
676 ratio_[i] = NA;
677 else {
678 ratio_[i]=log2(ratio_[i]);
679 }
680
681 }
682
683 }
684}
685
686
687int ChrCopyNumber::calculateBreakpoints(double threshold, int normalChrLength, int breakPointType) {

Callers 1

recalculateRatioMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected