[Bio] / FortyEight / rp_make_PSORT_attributes.pl Repository:
ViewVC logotype

Annotation of /FortyEight/rp_make_PSORT_attributes.pl

Parent Directory Parent Directory | Revision Log Revision Log


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

1 : mkubal 1.1 my $jobdir = shift(@ARGV);
2 :     my $genome = shift(@ARGV);
3 :     my $date = localtime();
4 :    
5 :     if(! -d "$jobdir/rp/$genome/attributes"){
6 :     `mkdir $jobdir/rp/$genome/attributes`;
7 :     }
8 :    
9 :     if(-e "$jobdir/rp/$genome/attributes/phenotypes.txt"){
10 :    
11 : mkubal 1.2
12 : mkubal 1.1 my $stain;
13 :     open(IN,"$jobdir/rp/$genome/attributes/phenotypes.txt");
14 :     while($_ = <IN>){
15 : mkubal 1.2 if($_ =~/Gram_Stain\tPositive/){$stain = "Positive";}
16 :     elsif($_ =~/Gram_Stain\tNegative/){$stain = "Negative";}
17 : mkubal 1.1 }
18 :     close(IN);
19 :    
20 : mkubal 1.2 print "$stain\n";
21 :    
22 : mkubal 1.1 my $score_threshold;
23 :     if($stain =~/(Negative|Positive)/){
24 :     if($stain eq "Negative"){$score_threshold = 2;}
25 :     else{$score_threshold = 2.5;}
26 :     $results = "/vol/seed-attributes/computation_results/Psort/$genome/$genome.output";
27 :     open(IN,$results);
28 :     my $peg;
29 :     my $record = 0;
30 :     open(OUT,">$jobdir/rp/$genome/attributes/psort.txt");
31 :     while ($_ = <IN>){
32 :     chomp($_);
33 :     if($record){
34 :     if($_ =~/(\w+)\s+(\d+.\d+)/){print OUT "$peg\tPSORT::$1\t$2\n";}
35 : mkubal 1.3 elsif($_ =~/(\w+)\s+.*multiple.*(\d+.\d+)/){print OUT "$peg\tPSORT::$1\t$2\n";}
36 : mkubal 1.1 elsif($_ =~/Unknown/){print OUT "$peg\tPSORT::unknown\tunknown\n";}
37 :     $record = 0;
38 :     }
39 :     else{
40 :     if($_ =~/(fig\|\d+.\d+.peg.\d+)/){$peg = $1;}
41 :     if($_ =~/(CytoplasmicMembrane)\s+(\d+.\d+)/){if($2 > $score_threshold){print OUT "$peg\tPSORT_score::$1\t$2\n";}}
42 :     if($_ =~/(Cytoplasmic)\s+(\d+.\d+)/){if($2 > $score_threshold){print OUT "$peg\tPSORT_score::$1\t$2\n";}}
43 :     if($_ =~/(OuterMembrane)\s+(\d+.\d+)/){if($2 > $score_threshold){print OUT "$peg\tPSORT_score::$1\t$2\n";}}
44 :     if($_ =~/(Periplasmic)\s+(\d+.\d+)/){if($2 > $score_threshold){print OUT "$peg\tPSORT_score::$1\t$2\n";}}
45 :     if($_ =~/(Extracellular)\s+(\d+.\d+)/){if($2 > $score_threshold){print OUT "$peg\tPSORT_score::$1\t$2\n";}}
46 :     if($_ =~/(Cellwall)\s+(\d+.\d+)/){if($2 > $score_threshold){print OUT "$peg\tPSORT_score::$1\t$2\n";}}
47 :     }
48 :     if($_ =~/Final Prediction/){$record = 1}
49 :     }
50 :     close(OUT);
51 :     }
52 :     }
53 :    
54 :    

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3