1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
|
#pragma once
#include <ConsensusCore/Interval.hpp>
#include <ConsensusCore/Poa/PoaGraph.hpp>
#include <cstddef>
#include <map>
#include <string>
#include <utility>
#include <vector>
namespace ConsensusCore {
namespace detail {
// an Anchor represents a point (cssPos, readPos)
typedef std::pair<size_t, size_t> SdpAnchor;
typedef std::vector<SdpAnchor> SdpAnchorVector;
class PoaGraphImpl;
using ConsensusCore::PoaGraph;
using ConsensusCore::Interval;
//
// SdpRangeFinder objects are responsible for identifying the range
// of read positions that we should seek to align to a POA vertex;
// this implementation uses SDP to identify fairly narrow bands,
// enabling sparse memory usage.
//
// This is an abstract class that will be inherited in a client
// library that has access to an SDP method.
//
// RangeFinder state goes away on next call to InitRangeFinder. We could
// have dealt with this using a factory pattern but bleh.
//
class SdpRangeFinder
{
private:
std::map<PoaGraph::Vertex, Interval> alignableReadIntervalByVertex_;
public:
virtual ~SdpRangeFinder();
void InitRangeFinder(const PoaGraphImpl& poaGraph,
const std::vector<PoaGraph::Vertex>& consensusPath,
const std::string& consensusSequence, const std::string& readSequence);
Interval FindAlignableRange(PoaGraph::Vertex v);
protected:
virtual SdpAnchorVector FindAnchors(const std::string& consensusSequence,
const std::string& readSequence) const = 0;
};
}
}
|