-
Notifications
You must be signed in to change notification settings - Fork 0
/
build_metadata_json.pl
executable file
·70 lines (56 loc) · 1.07 KB
/
build_metadata_json.pl
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
56
57
58
59
60
61
62
63
64
65
66
67
68
#!/usr/bin/perl
my $nb = 1000;
print "{\n";
print "\"label\": \"Conservation level\",\n";
print "\"categories\":[\n";
# cat1
print "{\n";
print "\"label\": \"high level\",\n";
# debut style
print "\"style\": {\n";
print "\"fill\": \"red\",\n";
print "\"fill-opacity\": \"0.5\"\n";
print "},\n";
print "\"regions\": [\n";
for (my $i = 1; $i <=$nb ; $i++)
{
print "{\n";
print " \"id\": \"seq$i\",\n";
print " \"ranges\": [[21,176],[180,186],[210,230]]\n";
if ($i < $nb) {
print "},\n";
} else {
print "}\n";
}
}
# fin regions
print "]\n";
# fin cat1
print "},\n";
# cat1
print "{\n";
print "\"label\": \"medium level\",\n";
# debut style
print "\"style\": {\n";
print "\"fill\": \"blue\",\n";
print "\"fill-opacity\": \"0.5\"\n";
print "},\n";
print "\"regions\": [\n";
for (my $i = 1; $i <=$nb ; $i++)
{
print "{\n";
print " \"id\": \"seq$i\",\n";
print " \"ranges\": [[1,20],[177,179]]\n";
if ($i < $nb) {
print "},\n";
} else {
print "}\n";
}
}
# fin regions
print "]\n";
# fin cat2
print "}\n";
print "]\n";
# fin object
print "}\n";