| 234 | } |
| 235 | |
| 236 | void GenomeCopyNumber::calculateBAFBreakpoints(double breakPointThreshold, int breakPointType) { |
| 237 | cout << "..Calculating breakpoints for BAF, breakPointThreshold = " <<breakPointThreshold<<"\n"; |
| 238 | #if 1 |
| 239 | ThreadPool* thrPool = ThreadPoolManager::getInstance()->newThreadPool("ChrCopyNumber_calculateBAFBreakpoint"); |
| 240 | for (vector<ChrCopyNumber>::iterator it = chrCopyNumber_.begin(); it != chrCopyNumber_.end(); it++) { |
| 241 | ChrCopyNumber& chrCopyNumber = *it; |
| 242 | ChrCopyNumberCalculateBreakpointArgWrapper* bkpArg = new ChrCopyNumberCalculateBreakpointArgWrapper(chrCopyNumber, breakPointThreshold, breakPointType); |
| 243 | thrPool->addThread(ChrCopyNumber_calculateBAFBreakpoint_wrapper, bkpArg); |
| 244 | } |
| 245 | |
| 246 | thrPool->run(); |
| 247 | delete thrPool; |
| 248 | #else |
| 249 | vector<ChrCopyNumber>::iterator it=chrCopyNumber_.begin(); |
| 250 | //calculate breakpoints for the first chromosome and get its length to normalize other graphs |
| 251 | int firstChromLen = 0; //we don't know it |
| 252 | if (it != chrCopyNumber_.end()) { |
| 253 | cout << "..processing chromosome " <<it->getChromosome()<<"\n"; |
| 254 | firstChromLen = it->calculateBAFBreakpoints(breakPointThreshold, firstChromLen,breakPointType); |
| 255 | if (firstChromLen == 0) { |
| 256 | cerr << "..failed to run segmentation on chr" << it->getChromosome() << "\n..no chromosome length normalization will be performed\n"; |
| 257 | } |
| 258 | } |
| 259 | it++; |
| 260 | for ( ; it != chrCopyNumber_.end(); it++ ) { |
| 261 | cout << "..processing chromosome " <<it->getChromosome()<<"\n"; |
| 262 | int result = it->calculateBAFBreakpoints(breakPointThreshold, firstChromLen,breakPointType); |
| 263 | if (result == 0) { |
| 264 | cerr << "..failed to run segmentation on chr" << it->getChromosome() << "\n"; |
| 265 | } |
| 266 | } |
| 267 | #endif |
| 268 | } |
| 269 | |
| 270 | void GenomeCopyNumber::fillMyHash(std::string const& mateFileName ,std::string const& inputFormat_str, std::string const& matesOrientation_str, int windowSize , int step, std::string targetBed) { |
| 271 | //read mateFileName and calculate copyNumber |
nothing calls this directly
no test coverage detected