| 1 |
#include <cstdint> |
| 2 |
#include <fstream> |
| 3 |
#include <iostream> |
| 4 |
#include <iterator> |
| 5 |
#include <map> |
| 6 |
#include <regex> |
| 7 |
#include <sstream> |
| 8 |
|
| 9 |
#ifndef parse_gff |
| 10 |
#define parse_gff |
| 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 |
const std::string EDIT_POSITION = "EditPosition"; |
| 38 |
const std::string EDIT_SEQUENCE = "EditSequence"; |
| 39 |
|
| 40 |
class gff3_feature { |
| 41 |
public: |
| 42 |
gff3_feature(std::string line); |
| 43 |
int print(); |
| 44 |
|
| 45 |
std::string get_seqid(); |
| 46 |
std::string get_source(); |
| 47 |
std::string get_type(); |
| 48 |
uint64_t get_start(); |
| 49 |
uint64_t get_end(); |
| 50 |
char get_strand(); |
| 51 |
int get_phase(); |
| 52 |
std::map<std::string, std::string> get_attributes(); |
| 53 |
std::string get_attribute(std::string key); |
| 54 |
|
| 55 |
int set_seqid(); |
| 56 |
int set_source(); |
| 57 |
int set_type(); |
| 58 |
int set_start(); |
| 59 |
int set_end(); |
| 60 |
int set_strand(); |
| 61 |
int set_phase(); |
| 62 |
int set_attributes(std::string attr); |
| 63 |
int64_t get_edit_position(); |
| 64 |
std::string get_edit_sequence(); |
| 65 |
|
| 66 |
private: |
| 67 |
std::string seqid, source, type; |
| 68 |
std::map<std::string, std::string> attributes; |
| 69 |
uint64_t start, end; |
| 70 |
float score; |
| 71 |
char strand; |
| 72 |
int phase; |
| 73 |
}; |
| 74 |
|
| 75 |
class gff3 { |
| 76 |
public: |
| 77 |
gff3(); |
| 78 |
gff3(std::string path); |
| 79 |
std::vector<gff3_feature> get_features(); |
| 80 |
int print(); |
| 81 |
int read_file(std::string path); |
| 82 |
std::vector<gff3_feature> query_features(uint64_t pos, std::string type); |
| 83 |
int get_count(); |
| 84 |
bool empty(); |
| 85 |
|
| 86 |
private: |
| 87 |
std::vector<gff3_feature> features; |
| 88 |
|
| 89 |
bool is_empty; |
| 90 |
}; |
| 91 |
|
| 92 |
#endif |