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

Annotation of /FigKernelScripts/make_pir_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_pir_ontology sqlite_database_file\n"; exit;}
8 :    
9 : mkubal 1.2 my $dbmaster = DBMaster->new(-database => $sqlite_db, -backend => 'SQLite');
10 : mkubal 1.1
11 : mkubal 1.2 #example of data in dat file
12 : mkubal 1.1 #>PIRSF000068 (Full) zinc-containing ferredoxin, Sulfolobus type
13 :     open(IN,"/vol/biodb/pir/pirsfinfo.dat");
14 :     while($_ = <IN>){
15 :     chomp($_);
16 :     if($_ =~/^>(PIRSF\d+)\s(.*)/){
17 :     my $id = $1;
18 :     my $term = $2;
19 :     my ($dt_objs,$dt_obj);
20 :     $dt_objs = $dbmaster->pir->get_objects( { 'id' => $id } );
21 :     if(scalar(@$dt_objs) == 0){
22 :     $dt_obj = $dbmaster->go->create( { 'id' => $id,
23 :     'term' => $term
24 :     } );
25 :     }
26 :     }
27 :     }

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3