Skip to content

Commit

Permalink
r198: made VERBOSE_GFA a CL option --dbg-gfa
Browse files Browse the repository at this point in the history
  • Loading branch information
lh3 committed Apr 5, 2020
1 parent 31356f9 commit 0f1994f
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 7 deletions.
12 changes: 10 additions & 2 deletions CommandLines.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@

hifiasm_opt_t asm_opt;

static ko_longopt_t long_options[] = {
{ "version", ko_no_argument, 300 },
{ "dbg-gfa", ko_no_argument, 301 },
{ 0, 0, 0 }
};

double Get_T(void)
{
struct timeval t;
Expand Down Expand Up @@ -90,6 +96,7 @@ void init_opt(hifiasm_opt_t* asm_opt)
asm_opt->max_short_tip = 3;
asm_opt->min_cnt = 2;
asm_opt->mid_cnt = 5;
asm_opt->verbose_gfa = 0;
}

void destory_opt(hifiasm_opt_t* asm_opt)
Expand Down Expand Up @@ -301,13 +308,13 @@ int CommandLine_process(int argc, char *argv[], hifiasm_opt_t* asm_opt)

int c;

while ((c = ketopt(&opt, argc, argv, 1, "hvt:o:k:lw:m:n:r:a:b:z:x:y:p:c:d:M:P:if:D:FN:", 0)) >= 0) {
while ((c = ketopt(&opt, argc, argv, 1, "hvt:o:k:lw:m:n:r:a:b:z:x:y:p:c:d:M:P:if:D:FN:", long_options)) >= 0) {
if (c == 'h')
{
Print_H(asm_opt);
return 0;
}
else if (c == 'v')
else if (c == 'v' || c == 300)
{
puts(HA_VERSION);
return 0;
Expand Down Expand Up @@ -335,6 +342,7 @@ int CommandLine_process(int argc, char *argv[], hifiasm_opt_t* asm_opt)
else if (c == 'p') asm_opt->small_pop_bubble_size = atoll(opt.arg);
else if (c == 'm') asm_opt->large_pop_bubble_size = atoll(opt.arg);
else if (c == 'n') asm_opt->max_short_tip = atoll(opt.arg);
else if (c == 301) asm_opt->verbose_gfa = 1;
else if (c == ':')
{
fprintf(stderr, "[ERROR] missing option argument in \"%s\"\n", argv[opt.i - 1]);
Expand Down
4 changes: 2 additions & 2 deletions CommandLines.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@

#include <pthread.h>

#define HA_VERSION "0.3.0-dirty-r197"
#define HA_VERSION "0.3.0-dirty-r198"

#define VERBOSE 0
#define VERBOSE_GFA 1

typedef struct {
int num_reads;
Expand Down Expand Up @@ -38,6 +37,7 @@ typedef struct {
int max_short_tip;
int min_cnt;
int mid_cnt;
int verbose_gfa;

float max_hang_rate;
float min_drop_rate;
Expand Down
4 changes: 2 additions & 2 deletions Overlaps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26464,7 +26464,7 @@ ma_sub_t **coverage_cut_ptr, int debug_g)

asg_arc_del_simple_circle_untig(sources, coverage_cut, sg, 100, 0);

if(VERBOSE_GFA >= 1)
if (asm_opt.verbose_gfa)
{
/*******************************for debug***************************************/
write_debug_graph(sg, sources, coverage_cut, output_file_name, n_read, reverse_sources, ruIndex);
Expand Down Expand Up @@ -26543,7 +26543,7 @@ long long bubble_dist, int read_graph, int write)
///actually min_thres = asm_opt.max_short_tip + 1 there are asm_opt.max_short_tip reads
min_thres = asm_opt.max_short_tip + 1;

if(VERBOSE_GFA >= 1)
if (asm_opt.verbose_gfa)
{
if(load_debug_graph(&sg, &sources, &coverage_cut, output_file_name, &reverse_sources, &ruIndex))
{
Expand Down
4 changes: 4 additions & 0 deletions hifiasm.1
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,11 @@ but occurs <
times in the other sample.


.SS Debugging options

.TP 10
.B --dbg-gfa
Write additional files to speed up the debugging of graph cleaning


.SH EXAMPLES
Expand Down
2 changes: 1 addition & 1 deletion ketopt.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ typedef struct {
} ketopt_t;

typedef struct {
char *name;
const char *name;
int has_arg;
int val;
} ko_longopt_t;
Expand Down

0 comments on commit 0f1994f

Please sign in to comment.