forked from pxulab/MRLR
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path2nd_test_sum.pl
More file actions
executable file
·67 lines (61 loc) · 1.41 KB
/
2nd_test_sum.pl
File metadata and controls
executable file
·67 lines (61 loc) · 1.41 KB
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 -w
#
use strict;
my $file1=shift or die "Usage: $0 <2nd_F_C_HR_test_F> <2nd_F_C_HR_test_C>\n";
my $file2=shift or die "Usage: $0 <2nd_F_C_HR_test_F> <2nd_F_C_HR_test_C>\n";
my %info;
open my $file1_h,'<',$file1;
while(<$file1_h>){
my @line=split;
my $sym;
if($line[-2]>=1 && $line[-2]/($line[-3]+$line[-2])>=0.8){
$sym="error";
}elsif($line[-3]>=1 && $line[-3]/($line[-3]+$line[-2])>=0.8){
$sym="yes";
}else{
$sym="no";
}
my $value="$line[-3]\t$line[-2]";
pop @line;
pop @line;
pop @line;
my $id = join "\t",@line;
$info{$id}="$value\t$sym\t-\t-\t-";
}
close $file1_h;
open my $file2_h,'<',$file2;
while(<$file2_h>){
my @line=split;
my $sym;
if($line[-2]>=1 && $line[-2]/($line[-3]+$line[-2])>=0.8){
$sym="error";
}elsif($line[-3]>=1 && $line[-3]/($line[-3]+$line[-2])>=0.8){
$sym="yes";
}else{
$sym="no";
}
my $value="$line[-3]\t$line[-2]";
pop @line;
pop @line;
pop @line;
my $id = join "\t",@line;
if(exists $info{$id}){
$info{$id}=~s/\t-\t-\t-/\t$value\t$sym/;
}
else{
$info{$id}="-\t-\t-\t$value\t$sym";
}
}
close $file2_h;
foreach my $id (keys %info){
my @value=split /\t/,$info{$id};
if($value[2] eq "error" or $value[5] eq "error"){
next;
}
elsif($value[2] eq "yes" and $value[5] eq "yes" ){
print "$id\t$info{$id}\thigh_conf\n";
}
else{
next;
}
}