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

Annotation of /FortyEight/rp_make_interpro_download_attributes.pl

Parent Directory Parent Directory | Revision Log Revision Log


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

1 : mkubal 1.1 my $jobdir = shift(@ARGV);
2 :     my $genome = shift(@ARGV);
3 :    
4 :     my $attribute_file = "$jobdir/rp/$genome/attributes/interpro_download_attributes.txt";
5 :     my $crc64_mapping_file = "$jobdir/rp/$genome/crc64_for_pegs_of_$genome.txt";
6 :    
7 :     open(RESULTS,">$attribute_file");
8 :    
9 :     my @files = ("uniparc_match_1.dump","uniparc_match_2.dump","uniparc_match_3.dump","uniparc_match_4.dump","uniparc_match_5.dump","uniparc_match_6.dump","uniparc_match_7.dump");
10 :    
11 :     my %id_crc;
12 :    
13 :     open(IN,$crc64_mapping_file);
14 :     while($_ = <IN>){
15 :     chomp($_);
16 :     my ($id,$crc) = split("\t",$_);
17 :     $id_crc{$crc} = $id;
18 :     }
19 :     close(IN);
20 :    
21 :     my $interpro_download_dir = "/vol/seed-attributes/Interpro_Download_Dump";
22 :     foreach my $file (@files){
23 :     open(IN,"$interpro_download_dir/$file");
24 :     my $crc;
25 :     my $db;
26 :     my $db_id;
27 :    
28 :     my $id;
29 :     my $bitscore;
30 :     my $evalue;
31 :     my $length;
32 :     my $start;
33 :     my $end;
34 :     my $record = 0;
35 :    
36 :     my $interpro_id;
37 :    
38 :     while ($_ = <IN>){
39 :     if($record){
40 :     if($_ =~ /match id=\"(\w+\d+)\".*dbname=\"(\w+)\"/){
41 :     $db_id = $1;
42 :     $db = $2;
43 :     }
44 :    
45 :     if($_ =~ /ipr id=\"(\w+\d+)\"/){
46 :     $interpro_id = $1;
47 :     }
48 :    
49 :     if($_ =~ /lcn start=\"(\d+)\"\s+end=\"(\d+)\"\s+score=\"(.*)\"/){
50 :     $start = $1;
51 :     $end = $2;
52 :     $bitscore = $3;
53 :     my $db_size = 679928271;
54 :    
55 :     if($db){
56 :     print RESULTS "$id\t$db"."::$db_id"."_interpro_download\t$bitscore;$start-$end\n";
57 :     print RESULTS "$id\tIPR::$interpro_id"."_interpro_download\t$bitscore;$start-$end\n";
58 :     }
59 :     }
60 :     }
61 :    
62 :     if($_ =~/length=\"(\d+)\"\s+crc64=\"(.*)\"/){
63 :     $length = $1;
64 :     $crc = $2;
65 :     $record = 0;
66 :     }
67 :     if($id_crc{$crc}){
68 :     $id = $id_crc{$crc};
69 :     $record = 1;
70 :     }
71 :     }
72 :     close(IN);
73 :     }
74 :    
75 :     print RESULTS "$genome\tInterpro_Domain_Download\tRelease 15.0\n";
76 :     close(RESULTS);

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3