Mercurial > repos > xuebing > splicesite_max_entropy
comparison splicesitescore/score3.pl~ @ 8:ec97befe722b
Uploaded
author | xuebing |
---|---|
date | Sun, 01 Apr 2012 08:14:45 -0400 |
parents | 3fd430270c0c |
children |
comparison
equal
deleted
inserted
replaced
7:3fd430270c0c | 8:ec97befe722b |
---|---|
2 | 2 |
3 | 3 |
4 my $inputfile = $ARGV[0]; | 4 my $inputfile = $ARGV[0]; |
5 my $usemaxent = 1; | 5 my $usemaxent = 1; |
6 | 6 |
7 | 7 my $modelpath = "/home/wuxbl/rowley/tools/maxentscan/splicemodels/"; |
8 my @metables = &makemaxentscores; | 8 my @metables = &makemaxentscores($modelpath); |
9 | 9 |
10 open (FILE,"<$inputfile") || die "can't open!\n"; | 10 open (FILE,"<$inputfile") || die "can't open!\n"; |
11 | 11 |
12 while(<FILE>) { | 12 while(<FILE>) { |
13 chomp; | 13 chomp; |
49 } | 49 } |
50 return $sum; | 50 return $sum; |
51 } | 51 } |
52 | 52 |
53 sub makemaxentscores{ | 53 sub makemaxentscores{ |
54 my $dir = "splicemodels/"; | 54 my $dir = shift; |
55 my @list = ('me2x3acc1','me2x3acc2','me2x3acc3','me2x3acc4', | 55 my @list = ('me2x3acc1','me2x3acc2','me2x3acc3','me2x3acc4', |
56 'me2x3acc5','me2x3acc6','me2x3acc7','me2x3acc8','me2x3acc9'); | 56 'me2x3acc5','me2x3acc6','me2x3acc7','me2x3acc8','me2x3acc9'); |
57 my @metables; | 57 my @metables; |
58 my $num = 0 ; | 58 my $num = 0 ; |
59 foreach my $file (@list) { | 59 foreach my $file (@list) { |
69 #print STDERR $file."\t".$num."\t".$n."\n"; | 69 #print STDERR $file."\t".$num."\t".$n."\n"; |
70 $num++; | 70 $num++; |
71 } | 71 } |
72 return @metables; | 72 return @metables; |
73 } | 73 } |
74 sub makewmmscores{ | 74 |
75 my $dir = "splicemodels/"; | |
76 my @list = ('me1s0acc1','me1s0acc2','me1s0acc3','me1s0acc4', | |
77 'me1s0acc5','me1s0acc6','me1s0acc7','me1s0acc8','me1s0acc9'); | |
78 my @metables; | |
79 my $num = 0 ; | |
80 foreach my $file (@list) { | |
81 my $n = 0; | |
82 open (SCOREF,"<".$dir.$file) || die "Can't open $file!\n"; | |
83 while(<SCOREF>) { | |
84 chomp; | |
85 $_=~ s/\s//; | |
86 $metables[$num]{$n} = $_; | |
87 $n++; | |
88 } | |
89 close(SCOREF); | |
90 #print STDERR $file."\t".$num."\t".$n."\n"; | |
91 $num++; | |
92 } | |
93 return @metables; | |
94 } | |
95 sub makemmscores{ | |
96 my $dir = "splicemodels/"; | |
97 my @list = ('me2s0acc1','me2s0acc2','me2s0acc3','me2s0acc4', | |
98 'me2s0acc5','me2s0acc6','me2s0acc7','me2s0acc8','me2s0acc9'); | |
99 my @metables; | |
100 my $num = 0 ; | |
101 foreach my $file (@list) { | |
102 my $n = 0; | |
103 open (SCOREF,"<".$dir.$file) || die "Can't open $file!\n"; | |
104 while(<SCOREF>) { | |
105 chomp; | |
106 $_=~ s/\s//; | |
107 $metables[$num]{$n} = $_; | |
108 $n++; | |
109 } | |
110 close(SCOREF); | |
111 #print STDERR $file."\t".$num."\t".$n."\n"; | |
112 $num++; | |
113 } | |
114 return @metables; | |
115 } | |
116 sub maxentscore{ | 75 sub maxentscore{ |
117 my $seq = shift; | 76 my $seq = shift; |
118 my $table_ref = shift; | 77 my $table_ref = shift; |
119 my @metables = @$table_ref; | 78 my @metables = @$table_ref; |
120 my @sc; | 79 my @sc; |