File: rbasm_main.c

package info (click to toggle)
bio-rainbow 2.0.4+dfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 560 kB
  • sloc: ansic: 7,475; perl: 172; makefile: 129; sh: 49
file content (41 lines) | stat: -rw-r--r-- 1,153 bytes parent folder | download | duplicates (2)
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
38
39
40
41
#include "asm_R2.h"

int main(int argc, char **argv){
	FileReader *in;
	FILE *out;
	uint32_t min_ol, min_read, max_read;
	float min_sm;
	char *infile, *outfile;
	int c;
	infile = NULL;
	outfile = NULL;
	min_ol = 5;
	min_sm = 0.9;
	min_read = 5;
	max_read = 200;
	while((c = getopt(argc, argv, "hi:o:r:R:l:s:")) != -1){
		switch(c){
			case 'i': infile = optarg; break;
			case 'o': outfile = optarg; break;
			case 'l': min_ol = atoi(optarg); break;
			case 's': min_sm = atof(optarg); break;
			case 'r': min_read = atoi(optarg); break;
			case 'R': max_read = atoi(optarg); break;
			case 'h': return ef_usage();
		}
	}
	if(infile == NULL) in = stdin_filereader();
	else if((in = fopen_filereader(infile)) == NULL){
		fprintf(stderr, " -- Cannot open %s in %s -- %s:%d --\n", infile, __FUNCTION__, __FILE__, __LINE__);
		abort();
	}
	if(outfile == NULL) out = stdout;
	else if((out = fopen(outfile, "w")) == NULL){
		fprintf(stderr, " -- Cannot write %s in %s -- %s:%d --\n", outfile, __FUNCTION__, __FILE__, __LINE__);
		abort();
	}
	asm_ef(in, out, min_ol, min_sm, min_read, max_read);
	fclose_filereader(in);
	if(outfile) fclose(out);
	return 0;
}