File: chaincat.cpp

package info (click to toggle)
bowtie 1.2.2+dfsg-4
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 16,704 kB
  • sloc: cpp: 35,614; perl: 5,903; ansic: 1,247; sh: 1,128; python: 483; makefile: 426
file content (37 lines) | stat: -rw-r--r-- 638 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/*
 * chaincat.cpp
 *
 * Print out a chained-hit file.
 *
 *  Created on: Jul 31, 2009
 *      Author: Ben Langmead
 */

#include <iostream>
#include <stdexcept>
#include "hit_set.h"
#include "filebuf.h"

using namespace std;

int main(int argc, char **argv) {
	try {
		if(argc <= 1) {
			cerr << "Error: must specify chain file as first argument" << endl;
			return 1;
		}
		FILE *in = fopen(argv[1], "rb");
		if(in == NULL) {
			cerr << "Could not open " << argv[1] << endl;
			return 1;
		}
		FileBuf fb(in);
		while(!fb.eof()) {
			HitSet s(fb);
			s.reportUpTo(cout);
		}
		fb.close();
	} catch(std::exception& e) {
		return 1;
	}
}