X-Git-Url: https://git.donarmstrong.com/?p=rsem.git;a=blobdiff_plain;f=bam2readdepth.cpp;h=d252e2e0f74a4fc84c5078bb1dbbeba54f48ec60;hp=87fb178a60ad08c146cb6b23e3979e4237cdd480;hb=1b2999c4407ef8419fb89b66b843b7141caff4da;hpb=6eec553ba4ab1cb1c6f48cd14d9e5c92c7d85798 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; }