[Bio] / FigKernelScripts / score_ifcs_mcauliffe.pl Repository:
ViewVC logotype

Annotation of /FigKernelScripts/score_ifcs_mcauliffe.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (view) (download) (as text)

1 : overbeek 1.1 #__perl__
2 :    
3 :     #
4 :     # Copyright (c) 2003-2006 University of Chicago and Fellowship
5 :     # for Interpretations of Genomes. All Rights Reserved.
6 :     #
7 :     # This file is part of the SEED Toolkit.
8 :     #
9 :     # The SEED Toolkit is free software. You can redistribute
10 :     # it and/or modify it under the terms of the SEED Toolkit
11 :     # Public License.
12 :     #
13 :     # You should have received a copy of the SEED Toolkit Public License
14 :     # along with this program; if not write to the University of Chicago
15 :     # at info@ci.uchicago.edu or the Fellowship for Interpretation of
16 :     # Genomes at veronika@thefig.info or download a copy from
17 :     # http://www.theseed.org/LICENSE.TXT.
18 :     #
19 :    
20 :     use strict;
21 :     use FIG;
22 :     use FIGStatisticalModels;
23 :     my $fig = new FIG;
24 :     my $fs = new FIGStatisticalModels;
25 :    
26 :    
27 :     #usage: score_ifcs < ifc > scored.ifc
28 :    
29 :     while (defined($_ = <STDIN>))
30 :     {
31 :     chomp;
32 :     my @flds = split(/\t/,$_);
33 : overbeek 1.2 my ($peg1,$peg2,$peg3,$peg4,$bbh13,$fc34,$bbh24);
34 : overbeek 1.1 if (@flds == 7)
35 :     {
36 : overbeek 1.2 ($peg1,$peg2,$peg3,$peg4,$bbh13,$fc34,$bbh24) = @flds;
37 : overbeek 1.1 }
38 :     else
39 :     {
40 : overbeek 1.2 ($peg1,$peg2,undef,$peg3,$peg4,$bbh13,$fc34,$bbh24) = @flds;
41 : overbeek 1.1 }
42 : overbeek 1.2 my $p1 = &score_bbh($fig,$peg1,$bbh13);
43 :     my $p2 = $fs->fc_score2probability($fc34);
44 :     my $p3 = &score_bbh($fig,$peg4,$bbh24);
45 : overbeek 1.1 my $sc = sprintf("%0.3f",$p1 * $p2 * $p3);
46 : overbeek 1.2 print join("\t",($peg1,$peg2,$sc,$peg3,$peg4,$bbh13,$fc34,$bbh24)),"\n";
47 : overbeek 1.1 }
48 :    
49 : overbeek 1.2
50 : overbeek 1.1 sub score_bbh {
51 : overbeek 1.2 my($fig,$peg,$bsc) = @_;
52 :     my($i,$bins);
53 : overbeek 1.1
54 :     my $func = scalar($fig->function_of($peg));
55 : overbeek 1.2 my $tc=0;
56 :     $tc = 1 if ($func =~ /aminotransferase|system|component|oxidase|regulator|cytochrome|specific|permease|transcriptional|transport|dehydrogenase/i);
57 : overbeek 1.1
58 : overbeek 1.2 return $fs->fc_bitscore2probability($bsc, $tc);
59 : overbeek 1.1
60 :     }
61 :    

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3