[Bio] / FigKernelScripts / update-caches.pl Repository:
ViewVC logotype

Annotation of /FigKernelScripts/update-caches.pl

Parent Directory Parent Directory | Revision Log Revision Log


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

1 : olson 1.1
2 :     #
3 :     # Update the global caches we keep to speed up common operations.
4 :     #
5 :    
6 :     use FIG;
7 :     use FIG_Config;
8 :    
9 :     my $fig = new FIG;
10 :    
11 :     my $cache_dir = $fig->get_cache_directory();
12 :    
13 :     update_subsystem_caches($fig, $cache_dir);
14 :    
15 :     #update_genome_caches($fig, $cache_dir);
16 :    
17 :     #
18 :     # Subsystem caches are in $cache_dir/subsys
19 :     #
20 :     # Files are
21 :     # all_subsystems
22 :     # All subsys, one per line
23 :     # usable_subsystems
24 :     # All usable, one per line
25 :     # subsystem_classification
26 :     # 2-col table of subsys and classification
27 :     #
28 :     sub update_subsystem_caches
29 :     {
30 :     my($fig, $cache_dir) = @_;
31 :    
32 :     my $sc = "$cache_dir/subsys";
33 :     &FIG::verify_dir($sc);
34 :    
35 :     open(ALL, ">$sc/all_subsystems");
36 :     open(U, ">$sc/usable_subsystems");
37 :     open(SC, ">$sc/subsystem_classification");
38 :     for my $sub (sort $fig->all_subsystems)
39 :     {
40 :     print ALL "$sub\n";
41 :     if ($fig->usable_subsystem($sub))
42 :     {
43 :     print U "$sub\n";
44 :     }
45 :     my $c = $fig->subsystem_classification($sub);
46 :     if ($c)
47 :     {
48 :     print SC join("\t", $sub, @$c), "\n";
49 :     }
50 :     }
51 :     close(ALL);
52 :     close(U);
53 :     close(SC);
54 :     }

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3