Пример #1
0
const std::vector<std::vector<unsigned > > SeedMemoryManager<KmerT>::getNotFoundMatchesCount(
    const flowcell::TileMetadataList &unprocessedTiles,
    const flowcell::BarcodeMetadataList &barcodeMetadataList,
    const ReadMetadataList &readMetadataList,
    const matchFinder::TileClusterInfo &foundMatches) const
{
    ISAAC_ASSERT_MSG(unprocessedTiles.front().getIndex() <= unprocessedTiles.back().getIndex(),
                     "Expected tiles ordered by index");
    std::vector<std::vector<unsigned > > ret(readMetadataList.size(), std::vector<unsigned>(
        unprocessedTiles.back().getIndex() + 1));

    BOOST_FOREACH(const flowcell::ReadMetadata &readMetadata, readMetadataList_)
    {
        const unsigned readIndex = readMetadata.getIndex();
        BOOST_FOREACH(const flowcell::TileMetadata &tileMetadata, unprocessedTiles)
        {
            const unsigned tileIndex = tileMetadata.getIndex();
            const std::vector<matchFinder::ClusterInfo> &oneTileInfo = foundMatches.at(tileIndex);
            // match only clusters where no matches were found so far
            ISAAC_ASSERT_MSG(oneTileInfo.size() == tileMetadata.getClusterCount(), "allTiles and foundMatches geometries must match");
            ret.at(readIndex).at(tileIndex) =
                std::count_if(oneTileInfo.begin(), oneTileInfo.end(),
                              boost::bind(&willLoadSeeds,
                                          boost::ref(barcodeMetadataList), _1, readIndex));
        }
    }
    return ret;
}
Пример #2
0
MatchFinder<KmerT>::MatchFinder(
    const reference::SortedReferenceMetadataList &sortedReferenceList,
    const bfs::path & tempDirectory,
    const flowcell::TileMetadataList &tiles,
    const flowcell::ReadMetadataList &readMetadataList,
    const SeedMetadataList &seedMetadataList,
    const unsigned iteration,
    const bool ignoreNeighbors,
    const bool ignoreRepeats,
    const unsigned repeatThreshold,
    const unsigned neighborhoodSizeThreshold,
    MatchTally &matchTally,
    matchFinder::TileClusterInfo &foundMatches,
    common::ThreadVector &threads,
    const unsigned coresMax,
    const unsigned tempSaversMax,
    const unsigned unavailableFileHandles)
    : kmerSourceMetadataList_(getMaskFilesList(sortedReferenceList))
    , referenceContigKaryotypes_(getReferenceContigKaryotypes(sortedReferenceList))
    , seedMetadataList_(seedMetadataList)
    , iteration_(iteration)
    , ignoreNeighbors_(ignoreNeighbors)
    , ignoreRepeats_(ignoreRepeats)
    , repeatThreshold_(repeatThreshold)
    , neighborhoodSizeThreshold_(neighborhoodSizeThreshold)
    , foundExactMatchesOnly_(foundMatches)
    , threads_(threads)
    , threadsMax_(coresMax)
    , maxTilesAtATime_(verifyMaxTileCount(unavailableFileHandles, tempSaversMax, tiles.size()))
    , threadRepeatLists_(threadsMax_, std::vector<ReferenceKmer>(repeatThreshold_ + 1))
    , threadNeighborsLists_(threadsMax_, std::vector<ReferenceKmer>(neighborhoodSizeThreshold_ + 1))
    , threadMatchDistributions_(threadsMax_, MatchDistribution(sortedReferenceList))
    , matchWriter_(matchTally, maxTilesAtATime_, tiles.back().getIndex())
    , threadReferenceFileBuffers_(
        threadsMax_,
        io::FileBufCache<io::FileBufWithReopen>(1, std::ios_base::binary|std::ios_base::in,
                                                std::max_element(kmerSourceMetadataList_.begin(), kmerSourceMetadataList_.end(),
                                                                 boost::bind(&KmerSourceMetadata::getPathSize, _1)<
                                                                 boost::bind(&KmerSourceMetadata::getPathSize, _2))->getPathSize()))
{
    ISAAC_THREAD_CERR << "Constructing the match finder" << std::endl;

    ISAAC_THREAD_CERR << "Constructing the match finder done" << std::endl;
}