File: PoaConsensus.hpp

package info (click to toggle)
consensuscore 1.1.1%2Bdfsg-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 3,404 kB
  • sloc: cpp: 38,940; python: 2,083; ansic: 542; sh: 184; makefile: 82; cs: 10
file content (60 lines) | stat: -rw-r--r-- 1,801 bytes parent folder | download | duplicates (4)
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
56
57
58
59
60
// Author: David Alexander

#pragma once

#include <boost/utility.hpp>
#include <climits>
#include <string>
#include <utility>
#include <vector>

#include <ConsensusCore/Align/AlignConfig.hpp>
#include <ConsensusCore/Poa/PoaGraph.hpp>

namespace ConsensusCore {
using boost::noncopyable;

class PoaGraph;
class PoaGraphPath;
class ScoredMutation;

AlignConfig DefaultPoaConfig(AlignMode mode = GLOBAL);

/// \brief A multi-sequence consensus obtained from a partial-order alignment
struct PoaConsensus : private noncopyable
{
    const std::string Sequence;
    PoaGraph Graph;
    std::vector<PoaGraph::Vertex> Path;

    PoaConsensus(const std::string& css, const PoaGraph& g,
                 const std::vector<PoaGraph::Vertex>& ConsensusPath);

    // NB: this constructor exists to provide a means to avoid an unnecessary copy
    // of the
    // boost graph.  If we had move semantics (C++11) we would be able to get by
    // without
    // this.
    PoaConsensus(const std::string& css, const detail::PoaGraphImpl& g,
                 const std::vector<PoaGraph::Vertex>& ConsensusPath);

    ~PoaConsensus();

    static const PoaConsensus* FindConsensus(const std::vector<std::string>& reads);

    static const PoaConsensus* FindConsensus(const std::vector<std::string>& reads,
                                             const AlignConfig& config, int minCoverage = -INT_MAX);

    static const PoaConsensus* FindConsensus(const std::vector<std::string>& reads, AlignMode mode,
                                             int minCoverage = -INT_MAX);

public:
    // Additional accessors, which do things on the graph/graphImpl
    // LikelyVariants

public:
    std::string ToGraphViz(int flags = 0) const;

    void WriteGraphVizFile(std::string filename, int flags = 0) const;
};
}