void SVLocusSet:: merge( const SVLocusSet& inputSet) { // TODO: check for compatible bam headers between inputSet and this assert(getMinMergeEdgeCount() == inputSet.getMinMergeEdgeCount()); for (const SVLocus& locus : inputSet._loci) { if (locus.empty()) continue; try { merge(locus); } catch (...) { log_os << "ERROR: SVLocusSet merge failed.\n" << "\tSVLocusSet source: " << inputSet.getSource() << "\n" << "\tSVLocus index: " << locus.getIndex() << "\n"; throw; } } _totalCleaned += inputSet._totalCleaned; _counts.merge(inputSet._counts); _highestSearchCount = std::max(_highestSearchCount, inputSet._highestSearchCount); _isMaxSearchCount = (_isMaxSearchCount || inputSet._isMaxSearchCount); _highestSearchDensity = std::max(_highestSearchDensity, inputSet._highestSearchDensity); _isMaxSearchDensity = (_isMaxSearchDensity || inputSet._isMaxSearchDensity); _buildTime.merge(inputSet._buildTime); _mergeTime.merge(inputSet._mergeTime); // this one is more of a formality... }
static void runCSL(const CSLOptions& opt) { SVLocusSet set; set.load(opt.graphFilename.c_str()); set.finalize(); set.checkState(true,true); }
static void runCSL(const CSLOptions& opt) { log_os << "INFO: loading graph: " << opt.graphFilename << "\n"; SVLocusSet set; set.load(opt.graphFilename.c_str()); log_os << "INFO: cleaning/finalizing graph: " << opt.graphFilename << "\n"; set.finalize(); log_os << "INFO: checking cleaned graph: " << opt.graphFilename << "\n"; set.checkState(true,true); log_os << "INFO: finished checking graph: " << opt.graphFilename << "\n"; }
static void runSSL(const SSLOptions& opt) { SVLocusSet set; set.load(opt.graphFilename.c_str()); std::ostream& os(std::cout); if (opt.isGlobalStats) { set.dumpStats(os); } else { set.dumpLocusStats(os); } }
static void runDSL(const DSLOptions& opt) { SVLocusSet set; set.load(opt.graphFilename.c_str()); const SVLocusSet& cset(set); std::ostream& os(std::cout); // add this handy map of chromosome id to chromosome label at the start of all output types: os << cset.header << "\n"; if (! opt.region.empty()) { int32_t tid,beginPos,endPos; parse_bam_region(set.header, opt.region, tid, beginPos, endPos); // parse the region set.dumpRegion(os,GenomeInterval(tid,beginPos,endPos)); } else if (opt.isLocusIndex) { const SVLocus& locus(cset.getLocus(opt.locusIndex)); if (opt.locusFilename.empty()) { os << locus; } else { std::ofstream ofs(opt.locusFilename.c_str(), std::ios::binary); boost::archive::binary_oarchive oa(ofs); oa << locus; } } else { cset.dump(os); } }
static unsigned testOverlap( SVLocusSet& locusSet, const int32_t tid, const int32_t beginPos, const int32_t endPos) { std::set<SVLocusSet::NodeAddressType> intersect; locusSet.getRegionIntersect(GenomeInterval(tid,beginPos,endPos),intersect); return intersect.size(); }
SVCandidateProcessor:: SVCandidateProcessor( const GSCOptions& opt, const SVLocusScanner& readScanner, const char* progName, const char* progVersion, const SVLocusSet& cset, EdgeRuntimeTracker& edgeTracker, GSCEdgeStatsManager& edgeStatMan) : _opt(opt), _cset(cset), _edgeTracker(edgeTracker), _edgeStatMan(edgeStatMan), _svRefine(opt, cset.header, cset.getCounts(), _edgeTracker), _svWriter(opt, readScanner, cset, progName, progVersion) {}