| 1 |
// Author: David Alexander |
| 2 |
// (Based on the original "Partial Order Aligner" by Lee, Grasso, and Sharlow, |
| 3 |
// and an implementation in C# by Patrick Marks) |
| 4 |
|
| 5 |
#include <ConsensusCore/Poa/PoaGraph.hpp> |
| 6 |
|
| 7 |
#include "PoaGraphImpl.hpp" |
| 8 |
|
| 9 |
namespace ConsensusCore { |
| 10 |
struct PoaConsensus; |
| 11 |
|
| 12 |
// |
| 13 |
// PIMPL idiom delegation |
| 14 |
// |
| 15 |
void PoaGraph::AddRead(const std::string& sequence, const AlignConfig& config, |
| 16 |
detail::SdpRangeFinder* rangeFinder, std::vector<Vertex>* readPathOutput) |
| 17 |
{ |
| 18 |
impl->AddRead(sequence, config, rangeFinder, readPathOutput); |
| 19 |
} |
| 20 |
|
| 21 |
void PoaGraph::AddFirstRead(const std::string& sequence, std::vector<Vertex>* readPathOutput) |
| 22 |
{ |
| 23 |
impl->AddFirstRead(sequence, readPathOutput); |
| 24 |
} |
| 25 |
|
| 26 |
PoaAlignmentMatrix* PoaGraph::TryAddRead(const std::string& sequence, const AlignConfig& config, |
| 27 |
detail::SdpRangeFinder* rangeFinder) const |
| 28 |
{ |
| 29 |
return impl->TryAddRead(sequence, config, rangeFinder); |
| 30 |
} |
| 31 |
|
| 32 |
void PoaGraph::CommitAdd(PoaAlignmentMatrix* mat, std::vector<Vertex>* readPathOutput) |
| 33 |
{ |
| 34 |
impl->CommitAdd(mat, readPathOutput); |
| 35 |
} |
| 36 |
|
| 37 |
size_t PoaGraph::NumReads() const { return impl->NumReads(); } |
| 38 |
|
| 39 |
const PoaConsensus* PoaGraph::FindConsensus(const AlignConfig& config, int minCoverage) const |
| 40 |
{ |
| 41 |
return impl->FindConsensus(config, minCoverage); |
| 42 |
} |
| 43 |
|
| 44 |
string PoaGraph::ToGraphViz(int flags, const PoaConsensus* pc) const |
| 45 |
{ |
| 46 |
return impl->ToGraphViz(flags, pc); |
| 47 |
} |
| 48 |
|
| 49 |
void PoaGraph::WriteGraphVizFile(string filename, int flags, const PoaConsensus* pc) const |
| 50 |
{ |
| 51 |
impl->WriteGraphVizFile(filename, flags, pc); |
| 52 |
} |
| 53 |
|
| 54 |
PoaGraph::PoaGraph() { impl = new detail::PoaGraphImpl(); } |
| 55 |
|
| 56 |
PoaGraph::PoaGraph(const PoaGraph& other) { impl = new detail::PoaGraphImpl(*other.impl); } |
| 57 |
|
| 58 |
PoaGraph::PoaGraph(const detail::PoaGraphImpl& o) { impl = new detail::PoaGraphImpl(o); } |
| 59 |
|
| 60 |
PoaGraph::~PoaGraph() { delete impl; } |
| 61 |
} |