Skip to content

Commit e1ea5ba

Browse files
committed
Make --aemb work with -o
Previously, output would always be sent to stdout, even when -o was provided.
1 parent 11aaa5c commit e1ea5ba

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

src/main.cpp

+3-6
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,9 @@ InputBuffer get_input_buffer(const CommandLineOptions& opt) {
105105
}
106106
}
107107

108-
void output_abundance(const std::vector<double>& abundances, const References& references){
108+
void output_abundance(std::ostream& out, const std::vector<double>& abundances, const References& references){
109109
for (size_t i = 0; i < references.size(); ++i) {
110-
std::cout << references.names[i] << '\t' << std::fixed << std::setprecision(6) << abundances[i] / double(references.sequences[i].size()) << std::endl;
110+
out << references.names[i] << '\t' << std::fixed << std::setprecision(6) << abundances[i] / double(references.sequences[i].size()) << std::endl;
111111
}
112112
}
113113

@@ -349,11 +349,8 @@ int run_strobealign(int argc, char **argv) {
349349
abundances[j] += worker_abundances[i][j];
350350
}
351351
}
352-
353-
// output the abundance file
354-
output_abundance(abundances, references);
352+
output_abundance(out, abundances, references);
355353
}
356-
357354

358355
logger.info() << "Total mapping sites tried: " << tot_statistics.tot_all_tried << std::endl
359356
<< "Total calls to ssw: " << tot_statistics.tot_aligner_calls << std::endl

0 commit comments

Comments
 (0)