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

Method calculateSDAndMed

src/GenomeCopyNumber.cpp:3266–3303  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3264}
3265
3266void GenomeCopyNumber::calculateSDAndMed(int ploidy, map <float,float> &sds,map <float,float> &meds) {
3267
3268 float value,med;
3269 vector<ChrCopyNumber>::iterator it;
3270
3271 //fill the map
3272 map <float,vector <float> > mymap;
3273 for ( it=chrCopyNumber_.begin() ; it != chrCopyNumber_.end(); it++ ) {
3274 for (int i = 0; i<it->getLength(); i++) {
3275 med = it->getMedianProfileAtI(i);
3276 float level = round_by_ploidy(med, ploidy);
3277 value = it->getRatioAtBin(i);
3278 if (isRatioLogged_&& value!=NA)
3279 value=pow(2,value);
3280 if (value != NA) {
3281 if (mymap.count(level) == 0) {
3282 vector <float> a;
3283 mymap.insert ( pair<float,vector <float> >(level,a) );
3284 }
3285 mymap.find(level)->second.push_back(value);
3286 }
3287 }
3288 }
3289
3290 //get median and variance for each level
3291 map<float,vector <float> >::iterator it2;
3292 for ( it2=mymap.begin() ; it2 != mymap.end(); it2++ ) {
3293 float level = (*it2).first;
3294 float median = get_median((*it2).second);
3295 // float mean = get_mean((*it2).second);
3296 float sdev = sd((*it2).second,median);
3297 meds.insert(pair<float,float>(level,median));
3298 sds.insert(pair<float,float>(level,sdev));
3299 (*it2).second.clear();
3300 }
3301 mymap.clear();
3302
3303}
3304
3305void GenomeCopyNumber::calculateSDs(int ploidy, map <float,float> &sds) {
3306

Callers

nothing calls this directly

Calls 6

round_by_ploidyFunction · 0.85
get_medianFunction · 0.85
sdFunction · 0.85
getMedianProfileAtIMethod · 0.80
getRatioAtBinMethod · 0.80
getLengthMethod · 0.45

Tested by

no test coverage detected