#ifndef COLLAPSED_CELL_OPTIMIZER_HPP #define COLLAPSED_CELL_OPTIMIZER_HPP #include #include #include #include #include "tbb/atomic.h" #include "tbb/task_scheduler_init.h" #include #include "ReadExperiment.hpp" #include "SalmonOpts.hpp" #include "GZipWriter.hpp" #include "EquivalenceClassBuilder.hpp" #include "AlevinOpts.hpp" #include "SingleCellProtocols.hpp" #include "WhiteList.hpp" #include "DedupUMI.hpp" #include "TranscriptGroup.hpp" #include "cuckoohash_map.hh" #include "Eigen/Dense" #include "concurrentqueue.h" using JqueueT = moodycamel::ConcurrentQueue; using eqMapT = cuckoohash_map; using tgrouplabelt = std::vector; using tgroupweightvec = std::vector; namespace bfs = boost::filesystem; using SCExpT = ReadExperiment>; using EqMapT = cuckoohash_map; struct CellState { bool inActive; }; class CollapsedCellOptimizer { public: using VecType = std::vector>; using SerialVecType = std::vector; CollapsedCellOptimizer(); template bool optimize(EqMapT& freqMap, spp::sparse_hash_map& txpToGeneMap, spp::sparse_hash_map& geneIdxMap, AlevinOpts& aopt, GZipWriter& gzw, std::vector& trueBarcodes, std::vector& umiCount, CFreqMapT& freqCounter, size_t numLowConfidentBarcode); }; bool runPerCellEM(double& totalNumFrags, size_t numGenes, CollapsedCellOptimizer::SerialVecType& alphas, std::vector& salmonEqclasses, std::shared_ptr& jointlog, bool initUniform); void optimizeCell(std::vector& trueBarcodes, std::atomic& barcode, size_t totalCells, eqMapT& eqMap, std::deque>& orderedTgroup, std::shared_ptr& jointlog, bfs::path& outDir, std::vector& umiCount, std::vector& skippedCBcount, bool verbose, GZipWriter& gzw, size_t umiLength, bool noEM, bool quiet, tbb::atomic& totalDedupCounts, tbb::atomic& totalExpGeneCounts, spp::sparse_hash_map& txpToGeneMap, uint32_t numGenes, bool inDebugMode, uint32_t numBootstraps, bool naiveEqclass, bool dumpUmiGraph, bool useAllBootstraps, bool initUniform, std::atomic& totalUniEdgesCounts, std::atomic& totalBiEdgesCounts); using VecT = CollapsedCellOptimizer::SerialVecType; #endif // COLLAPSED_CELL_OPTIMIZER_HPP