-
Notifications
You must be signed in to change notification settings - Fork 0
/
vgsgsql.h
73 lines (55 loc) · 1.61 KB
/
vgsgsql.h
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
/*
* Copyright (C) 2015 by Glenn Hickey (hickey@soe.ucsc.edu)
*
* Released under the MIT license, see LICENSE.cactus
*/
#ifndef _VGSGSQL_H
#define _VGSGSQL_H
#include <cstdlib>
#include <set>
#include <vector>
#include <string>
#include <iostream>
#include <fstream>
#include <cassert>
#include "sgsql.h"
#include "pathmapper.h"
/*
* write a SideGraph to GA4GH SQL format. This will be a fasta file with
* the sequence information and a .sql file with a bunch of INSERT statements
* that can be loaded into a db. This class has the VG conversion
* specific logic coming from SGBuilder...
*/
class VGSGSQL : public SGSQL
{
public:
VGSGSQL();
virtual ~VGSGSQL();
/** write out the graph as a database
*/
void exportGraph(const PathMapper* pm,
const std::string& sqlInsertPath,
const std::string& fastaPath, const std::string& vgPath);
protected:
/** write path INSERTs (makes a VariantSet for each Genome and
* an Allele for each sequence
*/
void writePathInserts();
/** get DNA string corresponding to a sequence
*/
void getSequenceString(const SGSequence* seq,
std::string& outString) const;
/** determine name of input sequence from which this sequence was
* derived.
*/
std::string getOriginName(const SGSequence* seq) const;
/** Which origin name do we consider primary? Used to name ReferenceSet
*/
std::string getPrimaryOriginName() const;
/** Get description for reference set
*/
std::string getDescription() const;
protected:
const PathMapper* _pm;
};
#endif