cawlign 0.0.1
Codon-aware pairwise sequence alignment
Loading...
Searching...
No Matches
argparse.hpp
1
2#ifndef ARGPARSE_H
3#define ARGPARSE_H
4
5#include <stdio.h>
6#include <string>
7#include <configparser.hpp>
8// argument defaults
9
10#define PROGNAME "cawlign"
11#define DEFAULT_DATA_TYPE nucleotide
12#define DEFAULT_GENETIC_CODE "universal"
13#define DEFAULT_REFERENCE "HXB2_pol"
14#define DEFAULT_SCORING "Nucleotide-BLAST"
15#define DEFAULT_SPACE quadratic
16#define DEFAULT_LOCAL_TYPE trim
17#define DEFAULT_OUTPUT_FORMAT refmap
18#define DEFAULT_RC_TYPE none
19
20#include "stringBuffer.h"
21
22#ifndef VERSION_NUMBER
23 #define VERSION_NUMBER "0.2.0"
24#endif
25
26#ifndef LIBRARY_PATH
27 #define LIBRARY_PATH "/usr/local/share/cawlign/"
28#endif
29
30#define SCORES_SUBPATH "scoring"
31#define REF_SUBPATH "references"
32#define GENETIC_CODES_SUBPATH "genetic_codes"
33
34namespace argparse
35{
36
37 enum data_t {
38 nucleotide,
39 codon,
40 protein
41 };
42
43 enum local_t {
44 trim,
45 global,
46 local
47 };
48
49 enum space_t {
50 quadratic,
51 linear
52 };
53
54 enum out_format_t {
55 refmap,
56 refalign,
57 pairwise
58 };
59
60 enum rc_t {
61 none,
62 silent,
63 annotated
64 };
65
66 class args_t {
67 public:
68
69 FILE * output,
70 * reference,
71 * input;
72
73 ConfigParser * scores;
74
75 data_t data_type;
76 local_t local_option;
77 space_t space_type;
78 out_format_t out_format;
79 rc_t reverse_complement;
80 ConfigParser * genetic_code;
81
82 bool quiet;
83 bool affine;
84 bool include_reference;
85
86 StringBuffer* memory_ref;
87
88
89 args_t( int, const char ** );
90 ~args_t();
91
92 private:
93 void parse_input ( const char * );
94 void parse_reference ( const char * );
95 void parse_output ( const char * );
96 void parse_scores ( const char * );
97 void parse_quiet ( void );
98 void parse_affine ( void );
99 void parse_include_ref ( void );
100 void parse_rc ( const char * );
101 void parse_space_t ( const char * );
102 void parse_data_t ( const char * );
103 void parse_local_t ( const char * );
104 void parse_out_format_t ( const char * );
105 void parse_genetic_code ( const char * );
106
107 std::string code_name;
108
109 };
110
111 void ERROR_NO_USAGE ( const char * msg, ... );
112
113 // defined in argparse.cpp
114 std::ifstream check_file_path_stream (const char* path, const char * subpath);
115}
116
117#endif // ARGPARSE_H
Definition configparser.hpp:32
A simple string buffer class that allows for dynamic resizing.
Definition stringBuffer.h:12
~args_t()
Definition argparse.cpp:275
args_t(int, const char **)
Definition argparse.cpp:209