-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcheckMongo.pl
executable file
·65 lines (53 loc) · 1.29 KB
/
checkMongo.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
#!/usr/bin/perl
use strict;
use warnings;
# use Data::Dumper;
use JSON;
use FindBin '$Bin';
use lib "$Bin";
use Common;
my @tools = @Common::tools;
my %toolStatusPos = ();
my $i = 0;
foreach my $fieldName (@tools) {
$toolStatusPos{$fieldName} = $i;
++$i;
}
my $nTools = @tools;
my $labeledWithoutData = 0;
my $dataWithoutLabel = 0;
$Common::ticker{callback} = sub {
print STDERR "\tLabeled without data: $labeledWithoutData\n";
print STDERR "\tData without label: $dataWithoutLabel\n";
$labeledWithoutData = 0;
$dataWithoutLabel = 0;
};
my $aseqs = &Common::aseqs();
&Common::startTicker(10000);
my $cursor = $aseqs->find();
while (my $aseq = $cursor->next()) {
my @statuses = split('', $aseq->{_s});
my $type1 = 0;
my $type2 = 0;
for (my $i=0; $i< $nTools; ++$i) {
my $toolStatus = $statuses[$i];
my $toolName = $tools[$i];
if ($toolStatus eq 'T') {
if (!$aseq->{t}->{$toolName}) {
$type1 = 1;
last;
}
}
elsif ($aseq->{t}->{$toolName}) {
$type2 = 1;
last;
}
}
$labeledWithoutData += $type1;
$dataWithoutLabel += $type2;
# if ($type1 || $type2) {
# print Dumper($aseq);
# <STDIN>;
# }
&Common::tick();
}