-
Notifications
You must be signed in to change notification settings - Fork 0
/
gbfp.h
89 lines (79 loc) · 2.21 KB
/
gbfp.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
#define LINELEN 65536
#define MEGA 1048576
#define INITGBFSEQNUM 4
#define INITREFERENCENUM 8
#define INITFEATURENUM 64
#define INITQUALIFIERNUM 128
#define FIELDLEN 16
#define FEATURELEN 16
#define QUALIFIERLEN 16
#define LOCUSLEN 16
#define TYPELEN 9
#define TOPOLOGYSTRLEN 8
#define DIVISIONCODELEN 3
#define DATESTRLEN 11
#define QUALIFIERSTART 21
#define INELSE 0
#define INFEATURE 1
#define INQUALIFIER 2
#define NORMAL 'N'
#define REVCOM 'C'
#define LINEAR 'L'
#define CIRCULAR 'C'
#define CHARACTER 'C'
#define LONG 'L'
#define STRING 'S'
typedef char *gb_string;
typedef struct tReference {
gb_string sAuthors;
gb_string sConsrtm;
gb_string sTitle;
gb_string sJournal;
gb_string sPubMed;
unsigned int iNum;
} gb_reference;
typedef struct tLocation {
unsigned long lStart;
unsigned long lEnd;
} gb_location;
typedef struct tQualifier {
gb_string sQualifier;
gb_string sValue;
} gb_qualifier;
typedef struct tFeature {
gb_location *ptLocation;
gb_qualifier *ptQualifier;
unsigned long lStart;
unsigned long lEnd;
unsigned int iNum;
unsigned int iLocationNum;
unsigned int iQualifierNum;
char sFeature[FEATURELEN + 1];
char cDirection;
} gb_feature;
typedef struct tGBFFData {
gb_string sAccession;
gb_string sComment;
gb_string sDef;
gb_string sGI;
gb_string sKeywords;
gb_string sLineage;
gb_string sOrganism;
gb_string sSequence;
gb_string sSource;
gb_string sVersion;
gb_reference *ptReferences;
gb_feature *ptFeatures;
unsigned int iFeatureNum;
unsigned int iReferenceNum;
unsigned long lLength;
unsigned long lRegion[2];
char sLocusName[LOCUSLEN + 1];
char sType[TYPELEN + 1];
char sTopology[TOPOLOGYSTRLEN + 1];
char sDivisionCode[DIVISIONCODELEN + 1];
char sDate[DATESTRLEN + 1];
} gb_data;
gb_data **parseGBFF(gb_string spFileName);
void freeGBData(gb_data **pptGBFFData);
gb_string getSequence(gb_string sSequence, gb_feature *ptFeature);