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

Annotation of /FigKernelScripts/ev_code_cron.pl

Parent Directory Parent Directory | Revision Log Revision Log


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

1 : overbeek 1.1 #__perl__
2 :     #
3 :    
4 :     =pod
5 :    
6 :     =head1 ev_code_cron.pl
7 :    
8 :     A wrapper to recalculate and reload the evidence codes. This should allow you to redo all the evidence codes daily, weekly or whatever.
9 :     Really just a series of wrappers around other jobs. Should most certainly be niced while running.
10 :    
11 :    
12 :     =head2 author
13 :    
14 :     RobE RobE@theFIG.info
15 :    
16 :     =cut
17 :    
18 :    
19 :     use strict;
20 :     use FIG;
21 :     my $fig=new FIG;
22 :     use constant DEBUG=>1;
23 :    
24 :     # recalculate the evidence codes
25 :    
26 :     my $dest=$FIG_Config::temp."/evidence_codes.".time; # a temporary directory for the calculations to be stored.
27 :     mkdir ($dest, 0755);
28 :    
29 :     ##### FIND SUBSYSTEMS
30 :     # at the moment we are building evidence codes for all subsystems that are not experimental
31 :     # using the fig->trusted_subsystems code
32 :    
33 :     print STDERR "Finding the subsystems\n" if (DEBUG);
34 :     open(OUT, ">$dest/all_subsys") || die "Can't write to $dest/all_subsys";
35 :     foreach my $ss ($fig->all_subsystems)
36 :     {
37 :     next unless ($fig->usable_subsystem($ss));
38 :     print OUT "$ss\n";
39 :     }
40 :     close OUT;
41 :    
42 :     ##### REBUILD EVIDENCE CODES
43 :     # just use the existing code to do this
44 :     my $command=$FIG_Config::bin."/get_ev_codes $dest/all_subsys > $dest/ev.codes";
45 :     print STDERR "Running the evidence code command $command\n" if (DEBUG);
46 :     system($command);
47 :    
48 : overbeek 1.8 ### The following adds the dlit and ilit evidence codes to the end of the
49 :     ### others;
50 :     if (-s "$FIG_Config::data/DlitByCurator/dlit.ev.codes")
51 :     {
52 : overbeek 1.10 system "$FIG_Config::bin/generate_ilits 20 0.7 < $FIG_Config::data/DlitByCurator/dlits > $FIG_Config::data/DlitByCurator/ilits";
53 : overbeek 1.8 system "$FIG_Config::bin/generate_dlit_ev_codes < $FIG_Config::data/DlitByCurator/dlits > $FIG_Config::data/DlitByCurator/dlit.ev.codes";
54 :     system "$FIG_Config::bin/generate_ilit_ev_codes < $FIG_Config::data/DlitByCurator/ilits > $FIG_Config::data/DlitByCurator/ilit.ev.codes";
55 :     system "cat $FIG_Config::data/DlitByCurator/[di]lit.ev.codes >> $dest/ev.codes";
56 :     }
57 :    
58 : overbeek 1.1 ##### RELOAD ATTRIBUTES DATABASE
59 :     # delete the old attributes and then add the new ones
60 :     print STDERR "Deleting the attributes\n" if (DEBUG);
61 : redwards 1.3 $fig->erase_attribute_entirely("evidence_code"); # this removes the evidence code and all notion of it, including all the files. This will scrub out things that get deleted
62 : overbeek 1.1
63 :     # now add all the attributes. This is really slow, and we should probably do a low level sql call to speed this up,
64 :     # but this handles breaking out the peg id into the separate parts and everything. It should be good.
65 :     print STDERR "Reloading attributes from $dest/ev.codes\n" if (DEBUG);
66 : parrello 1.9 system("AttrDBRefresh --load=$dest/ev.codes");
67 : overbeek 1.1

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3