X-Git-Url: https://git.donarmstrong.com/?p=rsem.git;a=blobdiff_plain;f=bam2readdepth.cpp;h=d252e2e0f74a4fc84c5078bb1dbbeba54f48ec60;hp=87fb178a60ad08c146cb6b23e3979e4237cdd480;hb=412c1a2821c5a4cbe2e68e4e9f4e2026a86d25f7;hpb=0a534802ee9fa3d488995a68621ff04f0fc6be7f diff --git a/bam2readdepth.cpp b/bam2readdepth.cpp index 87fb178..d252e2e 100644 --- a/bam2readdepth.cpp +++ b/bam2readdepth.cpp @@ -1,20 +1,27 @@ #include #include #include -#include +#include +#include "my_assert.h" #include "wiggle.h" using namespace std; int main(int argc, char* argv[]) { - if (argc != 2) { - printf("Usage: rsem-bam2readdepth sorted_bam_input\n"); + if (argc != 3) { + printf("Usage: rsem-bam2readdepth sorted_bam_input readdepth_output\n"); exit(-1); } - ReadDepthWriter depth_writer(std::cout); - build_wiggles(argv[1], depth_writer); + ofstream fout(argv[2]); + general_assert(fout.is_open(), "Cannot write to " + cstrtos(argv[2]) + "!"); - return 0; + ReadDepthWriter depth_writer(fout); + + build_wiggles(argv[1], depth_writer); + + fout.close(); + + return 0; }