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

Annotation of /FigKernelScripts/load_go.pl

Parent Directory Parent Directory | Revision Log Revision Log


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

1 : mkubal 1.1 #
2 :     # Copyright (c) 2003-2006 University of Chicago and Fellowship
3 :     # for Interpretations of Genomes. All Rights Reserved.
4 :     #
5 :     # This file is part of the SEED Toolkit.
6 :     #
7 :     # The SEED Toolkit is free software. You can redistribute
8 :     # it and/or modify it under the terms of the SEED Toolkit
9 :     # Public License.
10 :     #
11 :     # You should have received a copy of the SEED Toolkit Public License
12 :     # along with this program; if not write to the University of Chicago
13 :     # at info@ci.uchicago.edu or the Fellowship for Interpretation of
14 :     # Genomes at veronika@thefig.info or download a copy from
15 :     # http://www.theseed.org/LICENSE.TXT.
16 :     #
17 :    
18 :    
19 :     # -*- perl -*-
20 :    
21 :     ###########################################
22 :     use strict;
23 :    
24 :     use FIG;
25 :     my $fig = new FIG;
26 :    
27 :     my $usage = "usage: load_go";
28 :    
29 :     use Tracer;
30 :    
31 : overbeek 1.2 my $dbf = $fig->db_handle;
32 : mkubal 1.1
33 : overbeek 1.2 $dbf->drop_table( tbl => "go_terms" );
34 :     $dbf->create_table( tbl => "go_terms",
35 :     flds => "go_id char(10), go_desc varchar(200), go_type char(1), obsolete char(3)"
36 :     );
37 :    
38 :     my $temp_dir = $FIG_Config::temp;
39 :    
40 :     open(TMP,">$temp_dir/go.$$") || die "could not open temporary file";
41 :     if (open(GO,"<$FIG_Config::data/Ontologies/GO/GO.terms_ids_obs"))
42 :     {
43 :     while (defined($_ = <GO>))
44 : mkubal 1.1 {
45 : overbeek 1.2 if ($_ =~ /^GO:\d{7}\t/)
46 :     {
47 :     print TMP $_;
48 :     }
49 : mkubal 1.1 }
50 : overbeek 1.2 close(GO);
51 :     }
52 :     close(TMP);
53 : mkubal 1.1
54 : overbeek 1.2 $dbf->load_table( tbl => "go_terms",
55 :     file => "$temp_dir/go.$$" );
56 : mkubal 1.1
57 : overbeek 1.2 unlink("$temp_dir/go.$$");
58 : mkubal 1.1
59 : overbeek 1.2 $dbf->create_index( idx => "go_id_ix",
60 :     tbl => "go_terms",
61 :     type => "btree",
62 :     flds => "go_id" );
63 :     $dbf->vacuum_it("go_terms");
64 :    
65 :     $dbf->drop_table( tbl => "fr2go" );
66 :     $dbf->create_table( tbl => "fr2go",
67 :     flds => "role varchar(200), go_id char(10)"
68 :     );
69 :     $dbf->load_table( tbl => "fr2go",
70 :     file => "$FIG_Config::data/Ontologies/GO/fr2go" );
71 :     $dbf->create_index( idx => "fr2go_fr_ix",
72 :     tbl => "fr2go",
73 :     type => "btree",
74 :     flds => "role" );
75 :     $dbf->create_index( idx => "fr2go_go_ix",
76 :     tbl => "fr2go",
77 :     type => "btree",
78 :     flds => "go_id" );
79 :     $dbf->vacuum_it("fr2go");

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3