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

View of /FigKernelScripts/make_cdd_ontology.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (download) (as text) (annotate)
Fri Dec 7 16:54:40 2007 UTC (12 years ago) by mkubal
Branch: MAIN
use local sqlite

use FIG;
use lib PPO;
use lib Ontology;
use DBMaster;

my $sqlite_db = "$FIG_Config::global/Ontology/ontology.sqlite";
my $dbmaster = DBMaster->new(-database => $sqlite_db);

`cp /vol/biodb/cdd/cddid.tbl.gz /vol/ontologies/temp`;
`gunzip /vol/ontologies/temp/cddid.tbl.gz`;

open(IN,"/vol/ontologies/temp/cddid.tbl");
while($_ = <IN>){
    chomp($_);
    if($_ =~/^\d+/){
	my @parts = split("\t",$_);
	my $id = $parts[0];
	my $term = $parts[2];
	my $description = $parts[3];
	
	my ($dt_objs,$dt_obj);
	$dt_objs =  $dbmaster->cdd->get_objects( { 'id' => $id } );
	print "term:$term\n";
	if(scalar(@$dt_objs) == 0){ 
	   $dt_obj = $dbmaster->cdd->create( { 'id'    => $id,
					      'term' => $term,
					      'description' => $description
					       } );
       }
    }
}

`rm -f /vol/ontologies/temp/cddid* `;

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3