-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCount_new_exon_number_use_one.pl
57 lines (49 loc) · 1.48 KB
/
Count_new_exon_number_use_one.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
#!/usr/bin/perl -w
use strict;
use Getopt::Long;
open IN,"$ARGV[0]" || die"$!";
open Homo,"$ARGV[1]" || die"$!";
open List,"$ARGV[2]" || die"$!";
open Blast_list,"$ARGV[3]"||die '!';
#BF689635,4 NM_000014 + 9112046 9112087 42 major 99.3150684931507 290 292
#BF690537,3 NM_000014 - 9112603 9112705 103 major 97.6027397260274 285 292
#BQ942264,4 BQ568179,1
#CF121528,3 BY746763,3
my %homo;
while (<Homo>) {
chomp;
my @infor=split;
$homo{$infor[0]}=$infor[0];
}
close Homo;
my %ugid_of_ref;
while (<List>) {
#NM_000015 + Hs.2 108 980
chomp;
my @infor=split;
$ugid_of_ref{$infor[0]}=$infor[2];
}
close List;
my %exon_of_ref;
my %total_exon_of_ugid;
my %total_new_exon_of_ugid;
while (<IN>) {
chomp;
my @infor=split;
$exon_of_ref{$infor[0]}=$infor[1];
$total_exon_of_ugid{$ugid_of_ref{$infor[1]}}++;
if (exists $homo{$infor[0]}) {$total_new_exon_of_ugid{$ugid_of_ref{$infor[1]}}++;}
}
close IN;
my %use;
while (<Blast_list>) {
chomp;
my @infor=split;
if (!exists $exon_of_ref{$infor[0]}) {next;}
$use{$ugid_of_ref{$exon_of_ref{$infor[0]}}}=1;
}
foreach my $key (keys %total_exon_of_ugid) {
if (!exists $use{$key}) {next;}
if (!exists $total_new_exon_of_ugid{$key}) {$total_new_exon_of_ugid{$key}=0;}
print "$key\t$total_new_exon_of_ugid{$key}\t$total_exon_of_ugid{$key}\t",$total_new_exon_of_ugid{$key}/$total_exon_of_ugid{$key},"\n";
}