| 3225 | } |
| 3226 | |
| 3227 | void GenomeCopyNumber::calculatePloidy(int minCNAlength) { |
| 3228 | //check if median for copy numbers is calculated |
| 3229 | if (chrCopyNumber_[0].getMedianValues().size()==0) |
| 3230 | calculateCopyNumberMedians(minCNAlength,0,0); |
| 3231 | cout << "..Getting ploidy information\n"; |
| 3232 | int ploidy[] = {1,2,3,4,5,6,7,8,9,10}; |
| 3233 | vector <double> scores; |
| 3234 | for (int i = 0; i < 6 ; i++) { |
| 3235 | scores.push_back(calculateXiSum(ploidy[i])); |
| 3236 | } |
| 3237 | int i = argmin(scores); |
| 3238 | ploidy_ = ploidy[i]; |
| 3239 | cout << "..selected ploidy: " <<ploidy_<<"\n"; |
| 3240 | } |
| 3241 | |
| 3242 | double GenomeCopyNumber::calculateXiSum(int ploidy) { |
| 3243 | int totalNumberOfBP = 0; |
nothing calls this directly
no test coverage detected