-
Notifications
You must be signed in to change notification settings - Fork 17
/
testTabixReader.cpp
54 lines (44 loc) · 1.91 KB
/
testTabixReader.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
#include <cassert>
#include "TabixReader.h"
int main(int argc, char *argv[])
{
{
const char path[] = "/net/fantasia/home/zhanxw/anno/resources/dbNSFP/content/hg19/dbNSFP_light1.3.hg19.gz";
TabixReader tr(path, 1, 7, 3, 4); // dbNSFP chromosome
tr.addAnnotation("1", 1, "A", "C");
assert(tr.getAnnotation().size() == 0);
tr.addTag("GerpNR", 16);
tr.addTag("GerpRS", 17);
tr.addTag("Last", 20);
tr.addAnnotation("1", 1, "A", "C");
assert(tr.getAnnotation()[0] == "NA");
assert(tr.getAnnotation()[0] == tr.getAnnotation()[1]);
assert(tr.getAnnotation()[0] == tr.getAnnotation()[2]);
tr.addAnnotation("1", 69091, "A", "C");
assert(tr.getAnnotation().size() == 3);
printf("%s = %s\n", tr.getTag()[0].c_str(), tr.getAnnotation()[0].c_str());
printf("%s = %s\n", tr.getTag()[1].c_str(), tr.getAnnotation()[1].c_str());
printf("%s = %s\n", tr.getTag()[2].c_str(), tr.getAnnotation()[2].c_str());
}
{
const char path[] = "/net/fantasia/home/zhanxw/anno/resources/dbNSFP/content/hg19/dbNSFP_light1.3.hg19.gz";
TabixReader tr(path, 1, 7, 3, 4); // dbNSFP chromosome
tr.addTag("GerpNR", "GERP_NR");
tr.addTag("GerpRS", "GERP_RS");
tr.addAnnotation("1", 69091, "A", "C");
assert(tr.getAnnotation().size() == 2);
printf("%s = %s\n", tr.getTag()[0].c_str(), tr.getAnnotation()[0].c_str());
printf("%s = %s\n", tr.getTag()[1].c_str(), tr.getAnnotation()[1].c_str());
}
{
const char path[] = "/net/fantasia/home/hmkang/bin/annovar/humandb/hg19_ljb_all.txt.gz";
TabixReader tr(path, 1, 2, 4, 5); // dbNSFP chromosome
tr.addTag("SIFT", 6);
tr.addTag("GERP", 16);
tr.addAnnotation("1", 69091, "A", "C");
assert(tr.getAnnotation().size() == 2);
printf("%s = %s\n", tr.getTag()[0].c_str(), tr.getAnnotation()[0].c_str());
printf("%s = %s\n", tr.getTag()[1].c_str(), tr.getAnnotation()[1].c_str());
}
return 0;
}