Skip to content

Commit

Permalink
src/falco.cpp: removing the progress bar from the runs when the input…
Browse files Browse the repository at this point in the history
… is BAM because we can't properly track progress. This happens via the quiet variable in a function within falco.cpp and not the code where the BAM is actually read
  • Loading branch information
andrewdavidsmith committed Aug 10, 2024
1 parent cac5bcc commit 6821528
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions src/falco.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

#include <fstream>
#include <chrono>
#include <type_traits>

#include "smithlab_utils.hpp"
#include "OptionParser.hpp"
Expand Down Expand Up @@ -77,18 +76,11 @@ read_stream_into_stats(T &in, FastqStats &stats, FalcoConfig &falco_config) {
size_t file_size = in.load();
size_t tot_bytes_read = 0;

// decide whether to report progress
const bool quiet = falco_config.quiet
#ifdef USE_HTS
|| std::is_same<T, BamReader>::value // can't do progress for bam
#endif
;

// Read record by record
const bool quiet = falco_config.quiet;
ProgressBar progress(file_size, "running falco");
if (!quiet)
progress.report(cerr, 0);

// Read record by record
while (in.read_entry(stats, tot_bytes_read)) {
if (!quiet && progress.time_to_report(tot_bytes_read))
progress.report(cerr, tot_bytes_read);
Expand Down Expand Up @@ -706,7 +698,7 @@ int main(int argc, const char **argv) {
if (!falco_config.quiet)
log_process("reading file as gzipped FASTQ format");
GzFastqReader in(falco_config, stats.SHORT_READ_THRESHOLD);
read_stream_into_stats(in, stats, falco_config);
read_stream_into_stats(in,stats,falco_config);
}
else if (falco_config.is_fastq) {
if (!falco_config.quiet)
Expand Down

0 comments on commit 6821528

Please sign in to comment.