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

Method getXiSum

src/ChrCopyNumber.cpp:1165–1184  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1163
1164
1165double ChrCopyNumber::getXiSum(int ploidy, float minSD) {
1166 double sum = 0;
1167 const double PI = 3.141592;
1168
1169 for (int i = 0; i <= (int)bpfinal_.size();i++) {
1170
1171 double theta_i = getLevelAt(i,ploidy);
1172 //bpLengths_[i];
1173 //sd_[i];
1174 double d = medianValues_[i]-theta_i;
1175 if (!(d == 0 && fragmentNotNA_lengths_[i] == 0)) {
1176 double sqrtVar = sqrt(float(PI/2./fragmentNotNA_lengths_[i]))*max(minSD,sd_[i]);
1177 double term = pow(d/sqrtVar,2);
1178 sum += term;
1179 }
1180 }
1181
1182
1183 return sum;
1184}
1185
1186double ChrCopyNumber::calculateXiSum(int ploidy, map <float,float> &sds, map <float,float> &meds) {
1187 double sum = 0;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected