| 1339 | } |
| 1340 | |
| 1341 | void ChrCopyNumber::recalcFlanksForIndeces (int i_start, int i_end) { |
| 1342 | vector <float> data; |
| 1343 | int notNA = 0; |
| 1344 | int totalCount = 0; |
| 1345 | int breakPointStart = 0; |
| 1346 | int breakPointEnd = 0; |
| 1347 | for (int i = i_start; i<=i_end; i++) { //collect data points: |
| 1348 | breakPointStart = 0; |
| 1349 | if (i>0) |
| 1350 | breakPointStart = bpfinal_[i-1]+1; |
| 1351 | breakPointEnd = bpfinal_[i]; |
| 1352 | for (int j = breakPointStart; j <= breakPointEnd; j++) |
| 1353 | if (ratio_[j] != NA) { |
| 1354 | data.push_back(ratio_[j]); |
| 1355 | notNA++; |
| 1356 | } |
| 1357 | totalCount += breakPointEnd-breakPointStart+1; |
| 1358 | } |
| 1359 | float median; |
| 1360 | if (notNA==0 ||(notNA == 1 && totalCount>2)) { |
| 1361 | // median = get_median(data); |
| 1362 | median = NA; |
| 1363 | } else { |
| 1364 | median = get_median(data); //including the last point!!!! |
| 1365 | } |
| 1366 | float sd_local = sd(data,median); |
| 1367 | |
| 1368 | for (int i = i_start; i<=i_end; i++) { |
| 1369 | medianValues_[i] = median; |
| 1370 | sd_[i] = sd_local; |
| 1371 | } |
| 1372 | |
| 1373 | breakPointStart = 0; |
| 1374 | if (i_start>0) |
| 1375 | breakPointStart = bpfinal_[i_start-1]+1; |
| 1376 | for (int j = breakPointStart; j<= breakPointEnd; j++) |
| 1377 | medianProfile_[j] = median; |
| 1378 | } |
| 1379 | |
| 1380 | void ChrCopyNumber::clearCGcontent () { |
| 1381 | GCprofile_.clear (); |
nothing calls this directly
no test coverage detected