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;
}
Beispiel #2
0
inline unsigned getLaneNumber(const flowcell::TileMetadataList& tiles)
{
    ISAAC_ASSERT_MSG(
        tiles.end()
        == std::find_if(
            tiles.begin(),
            tiles.end(),
            boost::bind(&flowcell::TileMetadata::getLane, _1)
            != tiles.front().getLane()),
        "Expected all tiles to belong to the same lane");
    return tiles.front().getLane();
}
Beispiel #3
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;
}
Beispiel #4
0
void ParallelSeedLoader<ReaderT, KmerT>::loadSeeds(
    const flowcell::TileMetadataList &tiles,
    const matchFinder::TileClusterInfo &tileClusterBarcode,
    std::vector<Seed<KmerT> > &seeds,
    common::ScopedMallocBlock  &mallocBlock)
{

    // Start and execute the threads
    ISAAC_THREAD_CERR << "Loading data on " << inputLoadersMax_ << " threads" << std::endl;

    std::vector<flowcell::TileMetadata>::const_iterator nextTile = tiles.begin();
    BaseT::reset(tiles, seeds, tileClusterBarcode);

    threads_.execute(boost::bind(&ParallelSeedLoader::load, this,
                                 boost::ref(tileClusterBarcode),
                                 boost::ref(nextTile),
                                 tiles.end(), _1),
                                 inputLoadersMax_);

    BaseT::sortSeeds(seeds, mallocBlock, threads_, coresMax_);
}