Skip to content

Commit 3eb7e6c

Browse files
hmr.cpp: ensuring the summary yaml output file reflects the HMRs written to the output file that passed the score cutoff
1 parent 0510896 commit 3eb7e6c

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/analysis/hmr.cpp

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -574,15 +574,20 @@ main_hmr(int argc, const char **argv) {
574574
build_domains(cpgs, reset_points, state_ids, domains);
575575

576576
std::ofstream of;
577-
if (!outfile.empty()) of.open(outfile.c_str());
577+
if (!outfile.empty()) of.open(outfile);
578578
std::ostream out(outfile.empty() ? std::cout.rdbuf() : of.rdbuf());
579579

580580
size_t good_hmr_count = 0;
581581
for (auto i = 0u; i < size(domains); ++i)
582582
if (p_values[i] < domain_score_cutoff) {
583-
domains[i].set_name("HYPO" + to_string(good_hmr_count++));
584-
out << domains[i] << '\n';
583+
domains[good_hmr_count] = domains[i];
584+
domains[good_hmr_count].set_name("HYPO" + to_string(good_hmr_count));
585+
++good_hmr_count;
585586
}
587+
domains.resize(good_hmr_count);
588+
589+
for (const auto &d: domains)
590+
out << d << '\n';
586591

587592
if (!hypo_post_outfile.empty()) {
588593
if (verbose)

0 commit comments

Comments
 (0)