-
Notifications
You must be signed in to change notification settings - Fork 3
/
argparse.h
31 lines (26 loc) · 1.38 KB
/
argparse.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
#ifndef ARGPARSE_H
#define ARGPARSE_H
#include "common.h"
// struct to store program args
struct args_t {
char* in_reads_fn = nullptr; // input reads filename (CRAM/BAM/SAM)
char* in_ref_fn = nullptr; // input reference genome filename (FASTA)
char* out_consensus_fn = nullptr; // output consensus genome filename (FASTA)
char* out_pos_counts_fn = nullptr; // output position counts filename (TSV)
char* out_ins_counts_fn = nullptr; // output insertion counts filename (JSON)
uint8_t min_qual = DEFAULT_MIN_QUAL; // minimum base quality to count base in counts
COUNT_T min_depth = DEFAULT_MIN_DEPTH; // minimum depth to call base in consensus
long double min_freq = DEFAULT_MIN_FREQ; // minimum frequency to call base in consensus
char ambig = DEFAULT_AMBIG; // ambiguous symbol
char* primer_bed_fn = nullptr; // primer bed filename
int16_t primer_offset = DEFAULT_PRIMER_OFFSET; // number of bases after primer to also trim
};
// parse user args
args_t parse_args(int const argc, char** const argv);
// check user args
void check_args(args_t const & user_args);
// print user args (for debugging)
void print_args(args_t const & user_args);
// print usage
void print_usage(const char* const exe_name, std::ostream & out);
#endif