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

Annotation of /FigKernelScripts/make_pfam_ontology.pl

Parent Directory Parent Directory | Revision Log Revision Log


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

1 : mkubal 1.1 use FIG;
2 : mkubal 1.3
3 : mkubal 1.4 use lib PPO;
4 :     use lib Ontology;
5 : mkubal 1.1 use DBMaster;
6 :    
7 : mkubal 1.2 my $sqlite_db = shift(@ARGV);
8 : mkubal 1.4 if(!$sqlite_db){print "#usage make_pfam_ontology sqlite_database_file\n"; exit;}
9 : mkubal 1.2 my $dbmaster = DBMaster->new(-database => $sqlite_db, -backend => 'SQLite');
10 : mkubal 1.1
11 :     `cp /vol/biodb/pfam/Pfam-A.full.gz /vol/ontologies/temp/`;
12 :     `gunzip /vol/ontologies/temp/Pfam-A.full.gz`;
13 :    
14 :     open(IN,"/vol/ontologies/temp/Pfam-A.full");
15 :     my ($id,$term);
16 :     while($_ = <IN>){
17 :     chomp($_);
18 : mkubal 1.3 #if($_ =~/GF\s+AC\s+(PF\d+)(\.\d+)?/){$id = $1;$term= "";}
19 :     #elsif($_ =~/GF\s+DE\s+(.*)/){
20 :     if($_ =~/GF\s+ID\s+(.*)/){$term = $1;$id= "";}
21 :     elsif($_ =~/GF\s+AC\s+(PF\d+)(\.\d+)?/){
22 :     $id = $1;
23 : mkubal 1.1 chomp($term);
24 :     if($id){
25 :     my ($dt_objs,$dt_obj);
26 :     $dt_objs = $dbmaster->pfam->get_objects( { 'id' => $id } );
27 :     if(scalar(@$dt_objs) == 0){
28 :     print "$id $term\n";
29 :     $dt_obj = $dbmaster->pfam->create( { 'id' => $id,
30 :     'term' => $term
31 :     } );
32 :     }
33 :     }
34 :     $id = "";
35 :     }
36 :     }
37 :    
38 :     `rm -f /vol/ontologies/temp/Pfam-A.full`;

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3