diff --git a/src/axe.c b/src/axe.c index d68bbb3..b91ed69 100644 --- a/src/axe.c +++ b/src/axe.c @@ -23,6 +23,57 @@ * from now(). */ char _time_now[10] = ""; +const char *progress_bar_chars = "|/-\\"; +unsigned int format_call_number; + +char * +axe_formatter(struct qes_log_entry *entry) +{ + char *buf = NULL; + const char *colour = ANSIRST; + const char *reset = ANSIRST; + char marker = ' '; + int res = 0; + + if (entry == NULL || entry->message == NULL) return NULL; + + if (entry->level <= QES_LOG_DEBUG) { + marker = '.'; + colour = ANSIBEG ATDIM FGCYN BGBLK ANSIEND; + reset = ""; + } else if (entry->level == AXE_LOG_PROGRESS) { + marker = progress_bar_chars[format_call_number++ % 4]; + colour = ANSIBEG ATNRM FGGRN BGBLK ANSIEND; + } else if (entry->level == AXE_LOG_BOLD) { + marker = '\0'; + colour = ANSIBEG ATBLD FGCYN BGBLK ANSIEND; + } else if (entry->level <= QES_LOG_INFO) { + marker = '\0'; + colour = ANSIBEG ATNRM FGGRN BGBLK ANSIEND; + } else if (entry->level <= QES_LOG_WARNING) { + marker = '!'; + colour = ANSIBEG ATULN FGYEL BGBLK ANSIEND; + } else if (entry->level <= QES_LOG_ERROR) { + marker = 'E'; + colour = ANSIBEG ATBLD FGMAG BGBLK ANSIEND; + } else { + marker = 'F'; + colour = ANSIBEG ATBLD ATBNK FGRED BGBLK ANSIEND; + } + if (marker == '\0') { + res = asprintf(&buf, "%s%s%s", colour, entry->message, reset); + } else { + res = asprintf(&buf, "%s[%c] %s%s", colour, marker, entry->message, reset); + } + if (res > 0) { + return buf; + } else { + return NULL; + } +} + +/* Axe barcode struct ctor/dtor */ + struct axe_barcode * axe_barcode_create(void) { @@ -44,11 +95,14 @@ axe_barcode_destroy_(struct axe_barcode *barcode) qes_free(barcode); } +/* Axe config struct ctor/dtor */ + struct axe_config * axe_config_create(void) { struct axe_config *config = qes_calloc(1, sizeof(*config)); + config->logger = qes_logger_create(); /* qes_calloc never returns null, we use errprintexit as the err handler */ return config; } @@ -61,6 +115,8 @@ axe_config_destroy_(struct axe_config *config) if (config == NULL) { return; } + qes_log_message_debug(config->logger, + "Destroying config structure\n"); /* File names */ qes_free(config->barcode_file); qes_free(config->table_file); @@ -93,6 +149,9 @@ axe_config_destroy_(struct axe_config *config) /* Tries */ axe_trie_destroy(config->fwd_trie); axe_trie_destroy(config->rev_trie); + /* Logger */ + qes_logger_destroy(config->logger); + /* config stuct */ qes_free(config); } @@ -103,18 +162,37 @@ _axe_format_outfile_path (const char *prefix, const char *id, int read, { char buf[4096]; int res = 0; + char *our_prefix = NULL; + char lastchr = '\0'; + size_t prefix_len = 0; if (prefix == NULL || id == NULL) { return NULL; } + + prefix_len = strlen(prefix); + lastchr = prefix[prefix_len - 1]; + if (lastchr == '/' || lastchr == '\\') { + /* Our prefix is a directory, don't add '_' */ + our_prefix = strdup(prefix); + } else { + /* Duplicate and append an underscore to prefix */ + our_prefix = qes_malloc(prefix_len + 2); + our_prefix[prefix_len + 1] = '\0'; + strncpy(our_prefix, prefix, prefix_len); + our_prefix[prefix_len] = '_'; + } + if (read > 0) { - res = snprintf(buf, 4096, "%s_%s_R%d.%s", prefix, id, read, ext); + res = snprintf(buf, 4096, "%s%s_R%d.%s", our_prefix, id, read, ext); } else { - res = snprintf(buf, 4096, "%s_%s_il.%s", prefix, id, ext); + res = snprintf(buf, 4096, "%s%s_il.%s", our_prefix, id, ext); } if (res >= 4096) { + qes_free(our_prefix); return NULL; } + qes_free(our_prefix); return strndup(buf, 4096); } @@ -175,7 +253,6 @@ read_barcode_combo(char *line) } res = sscanf(line, "%99s\t%99s\t%99s", seq1, seq2, id); if (res < 3) { - fprintf(stderr, "Error, sscanf returned %i\n", res); return NULL; } barcode = axe_barcode_create(); @@ -280,7 +357,11 @@ axe_read_barcodes(struct axe_config *config) this_barcode = read_barcode_single(line); } if (this_barcode == NULL) { - fprintf(stderr, "Couldn't parse barcode line '%s'\n", line); + qes_log_format_fatal(config->logger, + "Couldn't parse barcode line '%s'\n", line); + qes_log_message_warning(config->logger, + "Check that the format is correct and has " + "UNIX line endings."); goto error; } /* Replace all bad chars with '-' */ @@ -299,8 +380,9 @@ axe_read_barcodes(struct axe_config *config) qes_file_close(qf); qes_free(line); if (config->verbosity > 0) { - fprintf(stderr, "[read_barcodes] (%s) Read in barcodes\n", - nowstr()); + qes_log_format_info(config->logger, + "read_barcodes -- (%s) Read in barcodes\n", + nowstr()); } return 0; @@ -362,7 +444,9 @@ setup_barcode_lookup_combo(struct axe_config *config) for (iii = 0; iii < config->n_barcode_pairs; iii++) { this_barcode = config->barcodes[iii]; if (!axe_barcode_ok(this_barcode)) { - fprintf(stderr, "[setup_lookup] Bad barcode at %" PRIu64 "\n", iii); + qes_log_format_fatal(config->logger, + "setup_lookup -- Bad barcode at %" PRIu64 "\n", + iii); goto error; } if (!axe_trie_get(seq1_trie, this_barcode->seq1, &tmp)) { @@ -438,7 +522,9 @@ axe_make_tries(struct axe_config *config) return 0; error: - fprintf(stderr, "[make_tries] ERROR: axe_trie_create returned NULL\n"); + qes_log_message_fatal( + config->logger, + "make_tries -- ERROR: axe_trie_create returned NULL\n"); axe_trie_destroy(config->fwd_trie); if (config->match_combo) { axe_trie_destroy(config->rev_trie); @@ -498,7 +584,8 @@ load_tries_combo(struct axe_config *config) for (iii = 0; iii < config->n_barcode_pairs; iii++) { this_bcd = config->barcodes[iii]; if (!axe_barcode_ok(this_bcd)) { - fprintf(stderr, "[load_tries] Bad R1 barcode at %" PRIu64 "\n", iii); + qes_log_format_fatal(config->logger, + "load_tries -- Bad R1 barcode at %" PRIu64 "\n", iii); ret = -1; goto exit; } @@ -508,7 +595,8 @@ load_tries_combo(struct axe_config *config) if (!axe_trie_get(config->fwd_trie, this_bcd->seq1, &tmp)) { ret = axe_trie_add(config->fwd_trie, this_bcd->seq1, ++bcd1); if (ret != 0) { - fprintf(stderr, "ERROR: Could not load barcode %s into trie %" PRIu64 "\n", + qes_log_format_fatal(config->logger, + "load_tries -- Could not load barcode %s into trie %" PRIu64 "\n", this_bcd->seq1, iii); ret = 1; goto exit; @@ -529,17 +617,17 @@ load_tries_combo(struct axe_config *config) if (ret != 0) { if (config->permissive) { if (config->verbosity >= 0) { - fprintf(stderr, - "[%s] warning: Will only match to %dmm\n", - __func__, (int)jjj - 1); + qes_log_format_warning(config->logger, + "load_tries -- warning: Will only match to %dmm\n", + (int)jjj - 1); } axe_trie_delete(config->fwd_trie, mutated[mmm]); qes_free(mutated[mmm]); continue; } - fprintf(stderr, - "[%s] ERROR: Barcode %s already in fwd trie (%dmm) %s\n", - __func__, mutated[mmm], (int)jjj, this_bcd->seq1); + qes_log_format_fatal(config->logger, + "load_tries -- Barcode %s already in fwd trie (%dmm) %s\n", + mutated[mmm], (int)jjj, this_bcd->seq1); retval = 1; goto exit; } @@ -555,7 +643,8 @@ load_tries_combo(struct axe_config *config) if (!axe_trie_get(config->rev_trie, this_bcd->seq2, &tmp)) { ret = axe_trie_add(config->rev_trie, this_bcd->seq2, ++bcd2); if (ret != 0) { - fprintf(stderr, "ERROR: Could not load barcode %s into trie %" PRIu64 "\n", + qes_log_format_fatal(config->logger, + "load_tries -- Could not load barcode %s into trie %" PRIu64 "\n", this_bcd->seq2, iii); retval = 1; goto exit; @@ -576,18 +665,18 @@ load_tries_combo(struct axe_config *config) if (ret != 0) { if (config->permissive) { if (config->verbosity >= 0) { - fprintf(stderr, - "[%s] warning: Will only match %s to %dmm\n", - __func__, this_bcd->id, (int)jjj - 1); + qes_log_format_warning(config->logger, + "load_tries -- Will only match %s to %dmm\n", + this_bcd->id, (int)jjj - 1); } trie_delete(config->rev_trie->trie, mutated[mmm]); qes_free(mutated[mmm]); continue; } - fprintf(stderr, - "[%s] ERROR: Barcode %s already in rev trie (%dmm)\n", - __func__, mutated[mmm], (int)jjj); + qes_log_format_fatal(config->logger, + "load_tries -- Barcode %s already in rev trie (%dmm) %s\n", + mutated[mmm], (int)jjj, this_bcd->seq1); retval = 1; goto exit; } @@ -877,7 +966,7 @@ write_barcoded_read_combo(struct axe_output *out, struct qes_seq *seq1, ret = qes_seqfile_write(out->rev_file, seq2); if (ret < 1) { fprintf(stderr, - "[process_file] Error: writing to rev file %s failed\n%s\n", + "process_file -- Error: writing to rev file %s failed\n%s\n", out->rev_file->qf->path, qes_file_error(out->rev_file->qf)); return 1; @@ -896,8 +985,10 @@ increment_reads_print_progress(struct axe_config *config) config->reads_processed++; if (config->reads_processed % 100000 == 0) { if (config->verbosity >= 0) { - fprintf(stderr, "%s: Processed %.1fM %s\r", - nowstr(), (float)(config->reads_processed/1000000.0), + axe_format_progress(config->logger, + "%s: Processed %.1fM %s\r", + nowstr(), + (float)(config->reads_processed/1000000.0), config->out_mode == READS_SINGLE ? "reads" : "read pairs"); } } @@ -913,7 +1004,7 @@ process_read_pair_single(struct axe_config *config, struct qes_seq *seq1, struct axe_output *outfile = NULL; size_t bcd_len = 0; - ret = axe_match_read(&bcd, config->fwd_trie, seq1); + ret = axe_match_read(config, &bcd, config->fwd_trie, seq1); increment_reads_print_progress(config); if (ret != 0) { /* No match */ @@ -973,8 +1064,9 @@ process_read_pair_single(struct axe_config *config, struct qes_seq *seq1, if (outfile->mode == READS_INTERLEAVED) { ret = qes_seqfile_write(outfile->fwd_file, seq2); if (ret < 1) { - fprintf(stderr, - "[process_file] Error: writing to il file %s failed\n%s\n", + qes_log_format_fatal( + config->logger, + "process_file -- Writing to file %s failed\n%s\n", outfile->fwd_file->qf->path, qes_file_error(outfile->fwd_file->qf)); return 1; @@ -982,8 +1074,9 @@ process_read_pair_single(struct axe_config *config, struct qes_seq *seq1, } else if (outfile->mode == READS_PAIRED) { ret = qes_seqfile_write(outfile->rev_file, seq2); if (ret < 1) { - fprintf(stderr, - "[process_file] Error: writing to rev file %s failed\n%s\n", + qes_log_format_fatal( + config->logger, + "process_file -- Writing to file %s failed\n%s\n", outfile->rev_file->qf->path, qes_file_error(outfile->rev_file->qf)); return 1; @@ -1009,13 +1102,13 @@ process_file_single(struct axe_config *config) int retval = -1; if (!axe_config_ok(config)) { - fprintf(stderr, "[process_file] Bad config struct\n"); return -1; } fwdsf = qes_seqfile_create(config->infiles[0], "r"); if (fwdsf == NULL) { - fprintf(stderr, "[process_file] Couldn't open seqfile %s\n", - config->infiles[0]); + qes_log_format_fatal(config->logger, + "process_file -- Couldn't open seqfile %s\n", + config->infiles[0]); goto exit; } switch(config->in_mode) { @@ -1028,16 +1121,18 @@ process_file_single(struct axe_config *config) case READS_PAIRED: revsf = qes_seqfile_create(config->infiles[1], "r"); if (revsf == NULL) { - fprintf(stderr, "[process_file] Couldn't open seqfile %s\n", - config->infiles[1]); + qes_log_format_fatal(config->logger, + "process_file -- Couldn't open seqfile %s\n", + config->infiles[1]); goto exit; } goto paired; break; case READS_UNKNOWN: default: - fprintf(stderr, "[process_file_single] Bad infile mode %ui\n", - config->in_mode); + qes_log_format_fatal(config->logger, + "process_file_single -- Bad infile mode %u\n", + config->in_mode); goto exit; break; } @@ -1085,8 +1180,8 @@ process_read_pair_combo(struct axe_config *config, struct qes_seq *seq1, size_t bcd2_len = 0; struct axe_output *outfile = NULL; - r1_ret = axe_match_read(&bcd1, config->fwd_trie, seq1); - r2_ret = axe_match_read(&bcd2, config->rev_trie, seq2); + r1_ret = axe_match_read(config, &bcd1, config->fwd_trie, seq1); + r2_ret = axe_match_read(config, &bcd2, config->rev_trie, seq2); increment_reads_print_progress(config); if (r1_ret != 0 || r2_ret != 0) { /* No match */ @@ -1130,13 +1225,13 @@ process_file_combo(struct axe_config *config) int have_error = 0; if (!axe_config_ok(config)) { - fprintf(stderr, "[process_file] Bad config struct\n"); return -1; } fwdsf = qes_seqfile_create(config->infiles[0], "r"); if (fwdsf == NULL) { - fprintf(stderr, "[process_file] Couldn't open seqfile %s\n", - config->infiles[0]); + qes_log_format_fatal(config->logger, + "process_file -- Couldn't open seqfile %s\n", + config->infiles[0]); goto error; } switch(config->in_mode) { @@ -1146,8 +1241,9 @@ process_file_combo(struct axe_config *config) case READS_PAIRED: revsf = qes_seqfile_create(config->infiles[1], "r"); if (revsf == NULL) { - fprintf(stderr, "[process_file] Couldn't open seqfile %s\n", - config->infiles[1]); + qes_log_format_fatal(config->logger, + "process_file -- Couldn't open seqfile %s\n", + config->infiles[0]); goto error; } goto paired; @@ -1155,8 +1251,9 @@ process_file_combo(struct axe_config *config) case READS_SINGLE: case READS_UNKNOWN: default: - fprintf(stderr, "[process_file_combo] Bad infile mode %ui\n", - config->in_mode); + qes_log_format_fatal(config->logger, + "process_file_combo -- Bad infile mode %u\n", + config->in_mode); goto error; break; } @@ -1203,8 +1300,9 @@ axe_process_file(struct axe_config *config) } start = clock(); if (config->verbosity >= 0) { - fprintf(stderr, "[process_file] (%s) Starting demultiplexing\n", - nowstr()); + axe_format_bold(config->logger, + "process_file -- (%s) Starting demultiplexing\n", + nowstr()); } if (config->match_combo) { ret = process_file_combo(config); @@ -1213,8 +1311,11 @@ axe_process_file(struct axe_config *config) } config->time_taken = (float)(clock() - start) / CLOCKS_PER_SEC; if (config->verbosity >= 0) { - fprintf(stderr, "\r[process_file] (%s) Finished demultiplexing\n", - nowstr()); + /* Jump to new line so we don't clobber the progress bar */ + fprintf(stderr, "\n"); + axe_format_bold(config->logger, + "process_file -- (%s) Finished demultiplexing\n", + nowstr()); } return ret; } @@ -1379,8 +1480,8 @@ axe_trie_add(struct axe_trie *trie, const char *str, intptr_t data) } inline int -axe_match_read (ssize_t *value, struct axe_trie *trie, - const struct qes_seq *seq) +axe_match_read (struct axe_config *config, ssize_t *value, + struct axe_trie *trie, const struct qes_seq *seq) { TrieState *trie_iter = NULL; TrieState *last_good_state = NULL; @@ -1399,7 +1500,8 @@ axe_match_read (ssize_t *value, struct axe_trie *trie, /* Grab tree root iter, and check it. */ trie_iter = trie_root(trie->trie); if (trie_iter == NULL) { - fprintf(stderr, "[match_read] trie_root() returned NULL!\n"); + qes_log_message_fatal(config->logger, + "match_read -- trie_root() returned NULL!\n"); return -1; } /* Consume seq until we can't */ @@ -1451,8 +1553,8 @@ axe_write_table(const struct axe_config *config) } tab_fp = fopen(config->table_file, "w"); if (tab_fp == NULL) { - fprintf(stderr, "[write_table] ERROR: Could not open %s\n%s\n", - config->table_file, strerror(errno)); + qes_log_format_fatal(config->logger, "write_table -- ERROR: Could not open %s\n%s\n", + config->table_file, strerror(errno)); return 1; } if (config->match_combo) { @@ -1478,19 +1580,20 @@ axe_write_table(const struct axe_config *config) } res = fclose(tab_fp); if (res != 0) { - fprintf(stderr, "[write_table] ERROR: Couldn't close tab file %s\n%s\n", - config->table_file, strerror(errno)); + qes_log_format_error(config->logger, + "[write_table] Couldn't close tab file %s\n%s\n", + config->table_file, strerror(errno)); return 1; } return 0; } int -axe_print_summary(const struct axe_config *config, FILE *stream) +axe_print_summary(const struct axe_config *config) { const char *tmp; -#define print(...) fprintf(stream, __VA_ARGS__) +#define million(r) ((float)(r / 1000000.0)) if (!axe_config_ok(config)) { return -1; } @@ -1498,18 +1601,22 @@ axe_print_summary(const struct axe_config *config, FILE *stream) /* Say nothing if we're being quiet */ return 0; } - fprintf(stream, "\nRun Summary:\n"); + axe_message_bold(config->logger, "\nRun Summary:\n"); if (config->verbosity > 1) { - print("Being verbose (not that you'll notice)\n"); + qes_log_message_debug(config->logger, + "Being verbose (not that you'll notice)\n"); } tmp = config->out_mode == READS_SINGLE ? "reads" : "read pairs"; - print("Processed %" PRIu64 " %s in %0.1f seconds (%0.3fk %s/sec)\n", - config->reads_processed, tmp, config->time_taken, - (float)(config->reads_processed / 1000) / config->time_taken, tmp); - print("%" PRIu64 " %s contained valid barcodes\n", - config->reads_demultiplexed, tmp); - print("%" PRIu64 " %s could not be demultiplexed\n", - config->reads_failed, tmp); -#undef print + axe_format_bold(config->logger, + "Processed %.2fM %s in %0.1f seconds (%0.1fK %s/sec)\n", + million(config->reads_processed), tmp, config->time_taken, + (float)(config->reads_processed / 1000) / config->time_taken, tmp); + axe_format_bold(config->logger, + "%.2fM %s contained valid barcodes\n", + million(config->reads_demultiplexed), tmp); + axe_format_bold(config->logger, + "%.2fM %s could not be demultiplexed (%0.1f%%)\n", + million(config->reads_failed), tmp, + ((float)config->reads_failed/(float)(config->reads_processed)*100.0)); return 0; } diff --git a/src/axe.h b/src/axe.h index 74ec655..68f6fdd 100644 --- a/src/axe.h +++ b/src/axe.h @@ -27,6 +27,7 @@ #include #include #include +#include #include "datrie/trie.h" #include "datrie/alpha-map.h" @@ -82,16 +83,18 @@ struct axe_config { Values will be 0 <= x < n_barcode_pairs. barcodes or outputs can then be indexed w/ this number */ ssize_t **barcode_lookup; + size_t *mismatch_counts; size_t n_barcodes_1; /* Number of first read barcodes */ size_t n_barcodes_2; /* Number of second read barcodes */ size_t n_barcode_pairs; struct axe_output *unknown_output; /* output for unknown files */ + struct axe_trie *fwd_trie; + struct axe_trie *rev_trie; + struct qes_logger *logger; enum read_mode in_mode; enum read_mode out_mode; int out_compress_level; size_t mismatches; - struct axe_trie *fwd_trie; - struct axe_trie *rev_trie; uint64_t reads_processed; uint64_t reads_demultiplexed; uint64_t reads_failed; @@ -101,8 +104,26 @@ struct axe_config { int match_combo :1; /* Match using combinatorial strategy */ int permissive :1; /* Don't error on mutated bcd confict */ int trim_rev :1; /* Trim rev read same as fwd read */ + int debug :1; /* Enable debug mode */ }; +extern unsigned int format_call_number; + +char * +axe_formatter(struct qes_log_entry *entry); + +#define AXE_LOG_PROGRESS 11 +#define axe_format_progress(log, fmt, ...) \ + qes_log_format(log, AXE_LOG_PROGRESS, fmt, __VA_ARGS__) +#define axe_message_progress(log, msg) \ + qes_log_message(log, AXE_LOG_PROGRESS, msg) + +#define AXE_LOG_BOLD 12 +#define axe_format_bold(log, fmt, ...) \ + qes_log_format(log, AXE_LOG_BOLD, fmt, __VA_ARGS__) +#define axe_message_bold(log, msg) \ + qes_log_message(log, AXE_LOG_BOLD, msg) + static inline int axe_config_ok(const struct axe_config *config) { @@ -148,12 +169,6 @@ axe_output_ok(const struct axe_output *output) return 1; } -#ifndef NDEBUG -#define AXE_DEBUG_LOG(x) STMT_BEGIN fprintf(stderr, x); STMT_END -#else -#define AXE_DEBUG_LOG(x) (void)(x); -#endif - /*=== FUNCTION ============================================================* Name: axe_config_create @@ -244,11 +259,11 @@ int axe_load_tries(struct axe_config *config); int axe_make_outputs(struct axe_config *config); int axe_process_file(struct axe_config *config); int axe_write_table(const struct axe_config *config); -int axe_print_summary(const struct axe_config *config, FILE *stream); +int axe_print_summary(const struct axe_config *config); /* Libraries or inner functions */ -extern int axe_match_read(intptr_t *value, struct axe_trie *trie, - const struct qes_seq *seq); +extern int axe_match_read(struct axe_config *config, intptr_t *value, + struct axe_trie *trie, const struct qes_seq *seq); int product(int64_t len, int64_t elem, uintptr_t *choices, int at_start); char **hamming_mutate_dna(size_t *n_results_o, const char *str, size_t len, unsigned int dist, int keep_original); diff --git a/src/main.c b/src/main.c index 60840b3..d396ab4 100644 --- a/src/main.c +++ b/src/main.c @@ -88,7 +88,7 @@ print_usage(void) fprintf(stderr, "\n"); } -static const char *axe_opts = "m:z:c2pb:f:F:r:R:i:I:t:hVvq"; +static const char *axe_opts = "m:z:c2pb:f:F:r:R:i:I:t:hVvqd"; static const struct option axe_longopts[] = { { "mismatch", optional_argument, NULL, 'm' }, { "ziplevel", required_argument, NULL, 'z' }, @@ -106,6 +106,7 @@ static const struct option axe_longopts[] = { { "help", no_argument, NULL, 'h' }, { "version", no_argument, NULL, 'V' }, { "verbose", no_argument, NULL, 'v' }, + { "debug", no_argument, NULL, 'd' }, { NULL, 0, NULL, 0 } }; @@ -195,6 +196,9 @@ parse_args(struct axe_config *config, int argc, char * const *argv) case 'q': config->verbosity -= 1; break; + case 'd': + config->debug = 1; + break; case '?': default: /* Getopt long prints its own error msg */ @@ -319,6 +323,10 @@ parse_args(struct axe_config *config, int argc, char * const *argv) } } config->have_cli_opts = 1; + format_call_number = 0; + qes_logger_init(config->logger, "[axe] ", QES_LOG_DEBUG); + qes_logger_add_destination_formatted(config->logger, stderr, QES_LOG_DEBUG, + &axe_formatter); return 0; error: fprintf(stderr, @@ -345,7 +353,6 @@ main (int argc, char * const *argv) goto end; } ret = parse_args(config, argc, argv); - AXE_DEBUG_LOG("[main] CLI args parsed\n"); if (ret != 0) { print_usage(); if (ret == 2) { @@ -354,7 +361,6 @@ main (int argc, char * const *argv) goto end; } ret = axe_read_barcodes(config); - AXE_DEBUG_LOG("[main] axe_read_barcodes done\n"); if (ret != 0) { fprintf(stderr, "[main] ERROR: axe_read_barcodes returned %i\n", ret); fprintf(stderr, "\tThis indicates that the barcode file is invalid.\n"); @@ -362,44 +368,37 @@ main (int argc, char * const *argv) goto end; } ret = axe_setup_barcode_lookup(config); - AXE_DEBUG_LOG("[main] axe_setup_barcode_lookup done\n"); if (ret != 0) { fprintf(stderr, "[main] ERROR: axe_setup_barcode_lookup returned %i\n", ret); goto end; } ret = axe_make_tries(config); - AXE_DEBUG_LOG("[main] axe_make_tries done\n"); if (ret != 0) { fprintf(stderr, "[main] ERROR: axe_make_tries returned %i\n", ret); goto end; } ret = axe_load_tries(config); - AXE_DEBUG_LOG("[main] axe_load_tries done\n"); if (ret != 0) { fprintf(stderr, "[main] ERROR: axe_load_tries returned %i\n", ret); goto end; } ret = axe_make_outputs(config); - AXE_DEBUG_LOG("[main] axe_make_outputs done\n"); if (ret != 0) { fprintf(stderr, "[main] ERROR: axe_make_outputs returned %i\n", ret); goto end; } ret = axe_process_file(config); - AXE_DEBUG_LOG("[main] axe_process_file done\n"); if (ret != 0) { fprintf(stderr, "[main] ERROR: axe_process_file returned %i\n", ret); goto end; } - ret = axe_print_summary(config, stderr); - AXE_DEBUG_LOG("[main] axe_print_summary done\n"); + ret = axe_print_summary(config); if (ret != 0) { fprintf(stderr, "[main] ERROR: axe_print_summary returned %i\n", ret); goto end; } ret = axe_write_table(config); - AXE_DEBUG_LOG("[main] axe_write_table done\n"); if (ret != 0) { fprintf(stderr, "[main] ERROR: axe_write_table returned %i\n", ret); goto end;