[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.2 - (download) (as text) (annotate)
Wed Dec 12 22:53:23 2007 UTC (12 years, 3 months ago) by mkubal
Branch: MAIN
CVS Tags: rast_rel_2008_06_18, rast_rel_2008_06_16, rast_rel_2008_04_23
Changes since 1.1: +2 -2 lines
specify database as argument

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

my $sqlite_db = shift(@ARGV);
my $dbmaster = DBMaster->new(-database => $sqlite_db, -backend => 'SQLite');

`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