File: Contigs.h

package info (click to toggle)
abyss 2.3.10-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 8,284 kB
  • sloc: cpp: 78,182; ansic: 6,512; makefile: 2,252; perl: 672; sh: 509; haskell: 412; python: 4
file content (93 lines) | stat: -rw-r--r-- 2,506 bytes parent folder | download | duplicates (2)
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
#ifndef RRESOLVER_CONTIGS_H
#define RRESOLVER_CONTIGS_H 1

#include "Common/ConstString.h"
#include "Common/ContigNode.h"
#include "Common/ContigPath.h"
#include "Common/ContigProperties.h"
#include "Common/Histogram.h"
#include "Common/IOUtil.h"
#include "Common/Options.h"
#include "Common/Sequence.h"
#include "Common/StringUtil.h"
#include "DataLayer/FastaReader.h"
#include "Graph/ContigGraph.h"
#include "Graph/ContigGraphAlgorithms.h"
#include "Graph/DirectedGraph.h"
#include "Graph/GraphIO.h"
#include "Graph/GraphUtil.h"

#include <set>
#include <string>
#include <vector>

typedef ContigGraph<DirectedGraph<ContigProperties, Distance>> Graph;
typedef Graph::vertex_descriptor vertex_descriptor;
typedef Graph::edge_descriptor edge_descriptor;
typedef Graph::adjacency_iterator adjacency_iterator;
typedef Graph::in_edge_iterator in_edge_iterator;
typedef Graph::out_edge_iterator out_edge_iterator;

class ContigSequence : public const_string
{
public:
	ContigSequence(const std::string& s)
	  : const_string(s)
	{
		strSize = const_string::size();
	}

	size_t size() const { return strSize; }

private:
	size_t strSize;
};

typedef std::vector<std::pair<std::string, std::string>> ContigSequencesInfo;
typedef std::vector<ContigSequence> ContigSequences;
typedef std::vector<ContigNode> ContigPath;
typedef std::vector<ContigPath> ContigPaths;
typedef std::vector<std::pair<ContigNode, int>>
    ImaginaryContigPath; // Each element is a pair of contig and distance to the next
typedef std::set<ImaginaryContigPath> ImaginaryContigPaths;

extern Graph g_contigGraph;
extern std::vector<std::string> g_contigComments;
extern ContigSequences g_contigSequences;

int
distanceBetween(const ContigNode& node1, const ContigNode& node2);
const ContigSequence&
getContigSequence(const ContigNode& node);
int
getContigSize(const ContigNode& node);
const std::string&
getContigComment(const ContigNode& node);
Sequence
getPathSequence(const ContigPath& path);
Sequence
getPathSequence(const ImaginaryContigPath& path);
long
getContigNumOfKmers(const ContigNode& node);
double
getContigBaseCoverage(const ContigNode& node);

void
loadContigGraph(const std::string& contigGraphPath);
void
loadContigs(const std::string& contigsPath);
void
storeContigGraph(
    const std::string& contigGraphPath,
    const std::string& program,
    const std::string& commandLine);
void
storeContigs(const std::string& contigsPath);

unsigned
numVerticesRemoved(const Graph& contigGraph);

void
assembleContigs();

#endif