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

Annotation of /FigKernelScripts/make_cdd_ontology.pl

Parent Directory Parent Directory | Revision Log Revision Log


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

1 : mkubal 1.1 use FIG;
2 :     use lib PPO;
3 :     use lib Ontology;
4 :     use DBMaster;
5 :    
6 : mkubal 1.2 my $sqlite_db = shift(@ARGV);
7 : mkubal 1.3 if(!$sqlite_db){print "#usage make_cdd_ontology sqlite_database_file\n"; exit;}
8 : mkubal 1.2 my $dbmaster = DBMaster->new(-database => $sqlite_db, -backend => 'SQLite');
9 : mkubal 1.1
10 :     `cp /vol/biodb/cdd/cddid.tbl.gz /vol/ontologies/temp`;
11 :     `gunzip /vol/ontologies/temp/cddid.tbl.gz`;
12 :    
13 :     open(IN,"/vol/ontologies/temp/cddid.tbl");
14 :     while($_ = <IN>){
15 :     chomp($_);
16 :     if($_ =~/^\d+/){
17 :     my @parts = split("\t",$_);
18 :     my $id = $parts[0];
19 :     my $term = $parts[2];
20 :     my $description = $parts[3];
21 :    
22 :     my ($dt_objs,$dt_obj);
23 :     $dt_objs = $dbmaster->cdd->get_objects( { 'id' => $id } );
24 :     print "term:$term\n";
25 :     if(scalar(@$dt_objs) == 0){
26 :     $dt_obj = $dbmaster->cdd->create( { 'id' => $id,
27 :     'term' => $term,
28 :     'description' => $description
29 :     } );
30 :     }
31 :     }
32 :     }
33 :    
34 :     `rm -f /vol/ontologies/temp/cddid* `;

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3