#ifndef __ALEVIN_UTILS_HPP__ #define __ALEVIN_UTILS_HPP__ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "spdlog/spdlog.h" #include #include #include #include #include "cereal/archives/json.hpp" #include "metro/metrohash.h" #include "nonstd/optional.hpp" #include "AlevinOpts.hpp" #include "SingleCellProtocols.hpp" #include "BarcodeGroup.hpp" #include "SalmonDefaults.hpp" #include "SalmonConfig.hpp" #include "SalmonUtils.hpp" #include "SalmonOpts.hpp" namespace alevin{ namespace utils{ namespace apt = alevin::protocols; constexpr uint32_t uint32_max = std::numeric_limits::max(); void getIndelNeighbors( const std::string& barcodeSeq, std::unordered_set& neighbors); void findNeighbors(size_t length, const std::string& barcode, std::unordered_set& neighbors); //template bool sequenceCheck(const std::string& barcode, //AlevinOpts& aopt, //std::mutex& iomutex, Sequence seq = Sequence::BARCODE); template bool processAlevinOpts(AlevinOpts& aopt, SalmonOpts& sopt, boost::program_options::variables_map& vm); template bool extractUMI(std::string& read, ProtocolT& pt, std::string& umi); template nonstd::optional extractBarcode(std::string& read, ProtocolT& pt); template bool writeCmdInfo(boost::filesystem::path cmdInfoPath, OrderedOptionsT& orderedOptions) { namespace bfs = boost::filesystem; std::ofstream os(cmdInfoPath.string()); cereal::JSONOutputArchive oa(os); oa(cereal::make_nvp("Salmon_version:", std::string(salmon::version))); for (auto& opt : orderedOptions.options) { if (opt.value.size() == 1) { oa(cereal::make_nvp(opt.string_key, opt.value.front())); } else { oa(cereal::make_nvp(opt.string_key, opt.value)); } } return true; } bool checkSetCoverage(std::vector>& tgroup, std::vector txps); void combinationUtil(std::vector& arr, int n, int r, int index, std::vector data, int i, std::vector>& comb); bool hasOneGene(const std::vector& txps, uint32_t& geneId, spp::sparse_hash_map& txpToGeneMap, const size_t numGenes); } } #endif // __ALEVIN_UTILS_HPP__