forked from marbl/canu
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgfa.H
99 lines (68 loc) · 1.88 KB
/
gfa.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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
/******************************************************************************
*
* This file is part of canu, a software program that assembles whole-genome
* sequencing reads into contigs.
*
* This software is based on:
* 'Celera Assembler' r4587 (http://wgs-assembler.sourceforge.net)
* the 'kmer package' r1994 (http://kmer.sourceforge.net)
*
* Except as indicated otherwise, this is a 'United States Government Work',
* and is released in the public domain.
*
* File 'README.licenses' in the root directory of this distribution
* contains full conditions and disclaimers.
*/
#ifndef AS_UTL_GFA_H
#define AS_UTL_GFA_H
#include "runtime.H"
#include "strings.H"
// Features assumed to hold only the length, and we don't use it.
class gfaSequence {
public:
gfaSequence();
gfaSequence(char *inLine);
gfaSequence(char *name, uint32 id, uint32 len);
~gfaSequence();
void load(char *inLine);
void save(FILE *outFile);
public:
char *_name;
uint32 _id;
char *_sequence;
char *_features;
uint32 _length;
};
class gfaLink {
public:
gfaLink();
gfaLink(char *inLine);
gfaLink(char *Aname, uint32 Aid, bool Afwd,
char *Bname, uint32 Bid, bool Bfwd, char *cigar);
~gfaLink();
void load(char *inLine);
void save(FILE *outFile);
void alignmentLength(int32 &queryLen, int32 &refceLen, int32 &alignLen);
public:
char *_Aname;
uint32 _Aid; // Canu specific.
bool _Afwd;
char *_Bname;
uint32 _Bid; // Canu specific.
bool _Bfwd;
char *_cigar;
char *_features;
};
class gfaFile {
public:
gfaFile();
gfaFile(char const *inName);
~gfaFile();
bool loadFile(char const *inName);
bool saveFile(char const *outName);
public:
char *_header;
vector<gfaSequence *> _sequences;
vector<gfaLink *> _links;
};
#endif // AS_UTL_GFA_H