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

Annotation of /FortyEight/rp_make_PFAM_HMM_derived_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 :    
4 :     my $input_file = $jobdir."/$genome_PFAM_HMM_search_results.txt";
5 : mkubal 1.3
6 :     if(! -d "$jobdir/rp/$genome/attributes"){
7 :     `mkdir $jobdir/rp/$genome/attributes`;
8 :     }
9 :    
10 :     my $output_file = $jobdir."/rp/$genome/attributes/PFAM_HMM_derived_attributes_for_$genome.txt";
11 : mkubal 1.1
12 :     open(IN,"$input_file");
13 :     open(PFAM,">$output_file");
14 :    
15 :     print PFAM "$genome\tPFAM_attribute_by_HMM_search_on_TimeLogic\tPfam_version_22\n";
16 :    
17 :     my $id;
18 :     my $pf;
19 :     my $start;
20 :     my $end;
21 :     my $evalue;
22 :     my $score;
23 :    
24 :     while ($_ = <IN>){
25 :     if($_ =~/(fig\|\d+.\d+.peg.\d+)/){
26 :     $id = $1;
27 :     }
28 :    
29 :     if($_ =~/^\sA\s=\s(PF\d+)/){
30 :     $pf = $1;
31 :     }
32 :    
33 :     if($_ =~/E_Value =\s+(.*)/){
34 :     $evalue = $1;
35 :     chomp($evalue);
36 :     }
37 :    
38 :     if($_ =~ /QS =\s+(\d+)\s+QE =\s+(\d+)/){
39 :     $start = $1;
40 :     $end = $2;
41 :     if($evalue =~/(\d+.\d+)e-(\d+)/){
42 :     $part1 = $1;
43 :     $part2 = $2;
44 :     if($part2 > 19){
45 :     $part2 = (1000 - $part2);
46 :     $part1 = $part1 * 100;
47 :     $score = $part2.".".$part1;
48 :     print PFAM "$id\tPFAM::$pf\t$score;$start-$end\n";
49 :     }
50 :     }
51 :     if($evalue =~/^0/){
52 :     print PFAM "$id\tPFAM::$pf\t0.0;$start-$end\n";
53 :     }
54 :     }
55 :     }
56 :     close(IN);
57 :    

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3