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

Annotation of /FigKernelScripts/make_CDD_attributes.pl

Parent Directory Parent Directory | Revision Log Revision Log


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

1 : mkubal 1.1 $genome = shift(@ARGV);
2 :     open(IN,"/vol/seed-attributes/computation_results/CDD/$genome/rpsblast_results.txt");
3 :     open(OUT,">/vol/seed-attributes/CDD/CDD_attributes_for_$genome.txt");
4 :    
5 :     my $peg, $id, $score, %id_score, %id_start,%id_stop,$record, $record_start,$start,$stop;
6 :     while ($_ = <IN>){
7 :     chomp($_);
8 :     if($_ =~/Query=\s(fig\|\d+.\d+.peg.\d+)/){
9 :     $new_peg = $1;
10 :     if($peg){
11 :     foreach $key (keys(%id_score)){
12 :     $string = "$peg\tCDD::$key\t$id_score{$key};$id_start{$key}-$id_stop{$key}\n";
13 :     if($string =~/(\d+-\d+)$/){print OUT "$string"}
14 :     }
15 :     }
16 :     $peg = $new_peg;
17 :     foreach $key (keys(%id_score)){delete($id_score{$key})}
18 :     foreach $key (keys(%id_start)){delete($id_start{$key})}
19 :     foreach $key (keys(%id_stop)){delete($id_stop{$key})}
20 :     $record = 0;
21 :     }
22 :    
23 :     #handle last peg in file
24 :     if($_ =~/\Database:\sCDD/){
25 :     if($peg){
26 :     foreach $key (keys(%id_score)){
27 :     print OUT "$peg\tCDD::$key\t$id_score{$key};$id_start{$key}-$id_stop{$key}\n";
28 :     }
29 :     }
30 :     }
31 :    
32 :     if($_ =~/\|CDD\|(\d+).*\s+(\d+e-\d+)$/){
33 :     $id = $1;
34 :     $score = $2;
35 :     if($score =~/(\d+)e-(\d+)/){
36 :     $part1 = $1;
37 :     $part2 = $2;
38 :     if($part2 > 19){
39 :     $part2 = (1000 - $part2);
40 :     $part1 = $part1 * 10;
41 :     $part1 = (1000 - $part1);
42 :     $score = $part2.".".$part1;
43 :     $id_score{$id} = $score;
44 :     }
45 :     }
46 :     }
47 :    
48 :     if($_ =~/>gnl\|CDD\|(\d+)\s/){
49 :     $id = $1;
50 :     if($id_score{$id}){$record = 1;$record_start =1;}
51 :     else{$record = 0}
52 :     }
53 :    
54 :     if($record){
55 :     if($record_start){
56 :     if($_ =~/Query:\s(\d+)/){
57 :     $start = $1;
58 :     $record_start = 0;
59 :     $record_stop = 1;
60 :     $id_start{$id} = $start;
61 :     }
62 :     }
63 :     if($_ =~/Query:\s\d+.*\s(\d+)$/){
64 :     $stop = $1;
65 :     $id_stop{$id} = $stop;
66 :     }
67 :     }
68 :     }
69 :    
70 :    

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3