5 open IP
, "<", "phase.ht";
6 open IM
, "<", "manual.ht";
8 my (@id, @phase, @manual, @compare, @conflict, @out);
18 $phase[$n][0] = [split / /, $h1];
19 $phase[$n][1] = [split / /, $h2];
30 push @
{$manual[int($n)][0]}, $_;
32 push @
{$manual[int($n)][1]}, $_;
39 foreach my $n (0 .. 11) {
42 foreach my $p (0 .. 130) {
43 foreach my $a1 (0 .. 1) {
44 foreach my $a2 (0 .. 1) {
45 if ($phase[$n][$a1][$p] eq $manual[$n][$a2][$p]) {
46 $compare[$n]{"c$a1$a2"}[$p] = 0;
48 $compare[$n]{"c$a1$a2"}[$p] = 1;
52 $conflict[$n][0] += $compare[$n]{c00
}[$p] + $compare[$n]{c11
}[$p];
53 $conflict[$n][1] += $compare[$n]{c01
}[$p] + $compare[$n]{c10
}[$p];
55 if ($conflict[$n][1] > $conflict[$n][0]) {
56 $out[$n][0][0] = $phase[$n][0];
57 $out[$n][0][1] = $manual[$n][0];
58 $out[$n][0][2] = $compare[$n]{c00
};
59 $out[$n][1][0] = $phase[$n][1];
60 $out[$n][1][1] = $manual[$n][1];
61 $out[$n][1][2] = $compare[$n]{c11
};
63 $out[$n][0][0] = $phase[$n][0];
64 $out[$n][0][1] = $manual[$n][1];
65 $out[$n][0][2] = $compare[$n]{c01
};
66 $out[$n][1][0] = $phase[$n][1];
67 $out[$n][1][1] = $manual[$n][0];
68 $out[$n][1][2] = $compare[$n]{c10
};
72 open O
, ">", "compare.ht";
76 print O
"hyplotype0\tphase\t", (join " ", @
{$out[$_][0][0]}), "\n";
77 print O
"hyplotype0\tmanual\t", (join " ", @
{$out[$_][0][1]}), "\n";
78 print O
"hyplotype0\tconfl.\t", (join " ", @
{$out[$_][0][2]}), "\n\n";
79 print O
"hyplotype1\tphase\t", (join " ", @
{$out[$_][1][0]}), "\n";
80 print O
"hyplotype1\tmanual\t", (join " ", @
{$out[$_][1][1]}), "\n";
81 print O
"hyplotype1\tconfl.\t", (join " ", @
{$out[$_][1][2]}), "\n\n";