-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathseed-extension-aligner.cpp
55 lines (47 loc) · 1.3 KB
/
seed-extension-aligner.cpp
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/*
* GPU-PerM
* Haifeng Chen
* University of Southern California
* July 1, 2013
*
* Compiler C99
*/
/*
* File name: all the letters are lower case
* Function name: the first letter of every word are upper case, \
* the others are lower case
* Variable name: the first letter of each word except \
* the first word are upper case, the others are lower case
*
* make it as simple as possible
*/
#include "option.h"
#include "match.h"
#include "bitscode.h"
#include "hash.h"
#include "refin.h"
int main(int argc, const char* argv[]) {
/* (1) Get parameters */
Option opt;
GetParameter(argc, argv, opt);
CReference refGenome;
CHashTable hashTable;
if (opt.bIndexExist) {
/* (2) Read Reference and Hash Table from index */
TIME_INFO(ReadIndexAndRef(opt, &refGenome, &hashTable),
"Read reference and hash table");
} else {
/* (3) Read Reference */
TIME_INFO(GetReference(&refGenome, opt), "Encode reference");
/* (4) Build Reference Index */
TIME_INFO(BuildHashTable(opt, &refGenome, &hashTable), "Build hash table");
}
/* (5) Build Reference Index */
TIME_INFO(Matching(opt, &refGenome, &hashTable), "Mapping");
/* release memory*/
free(refGenome.refInBits);
free(hashTable.counter);
free(hashTable.index);
free(opt.seedStartPos);
return 0;
}