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

View of /FigKernelScripts/ev_code_cron.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.9 - (download) (as text) (annotate)
Wed Jun 11 16:28:11 2008 UTC (11 years, 9 months ago) by parrello
Branch: MAIN
Changes since 1.8: +1 -8 lines
Changed to use AttrDBRefresh to load.

#__perl__
#

=pod

=head1 ev_code_cron.pl

A wrapper to recalculate and reload the evidence codes. This should allow you to redo all the evidence codes daily, weekly or whatever.
Really just a series of wrappers around other jobs. Should most certainly be niced while running.


=head2 author

RobE RobE@theFIG.info

=cut


use strict;
use FIG;
my $fig=new FIG;
use constant DEBUG=>1;

# recalculate the evidence codes

my $dest=$FIG_Config::temp."/evidence_codes.".time; # a temporary directory for the calculations to be stored.
mkdir ($dest, 0755);

##### FIND SUBSYSTEMS
# at the moment we are building evidence codes for all subsystems that are not experimental
# using the fig->trusted_subsystems code

print STDERR "Finding the subsystems\n" if (DEBUG);
open(OUT, ">$dest/all_subsys") || die "Can't write to $dest/all_subsys";
foreach my $ss ($fig->all_subsystems)
{
    next unless ($fig->usable_subsystem($ss));
    print OUT "$ss\n";
}
close OUT;

##### REBUILD EVIDENCE CODES
# just use the existing code to do this
my $command=$FIG_Config::bin."/get_ev_codes $dest/all_subsys > $dest/ev.codes";
print STDERR "Running the evidence code command $command\n" if (DEBUG);
system($command);

### The following adds the dlit and ilit evidence codes to the end of the 
### others;
if (-s "$FIG_Config::data/DlitByCurator/dlit.ev.codes")
{
    system "$FIG_Config::bin/generate_ilits 40 0.8  < $FIG_Config::data/DlitByCurator/dlits > $FIG_Config::data/DlitByCurator/ilits";
    system "$FIG_Config::bin/generate_dlit_ev_codes < $FIG_Config::data/DlitByCurator/dlits > $FIG_Config::data/DlitByCurator/dlit.ev.codes";
    system "$FIG_Config::bin/generate_ilit_ev_codes < $FIG_Config::data/DlitByCurator/ilits > $FIG_Config::data/DlitByCurator/ilit.ev.codes";
    system "cat $FIG_Config::data/DlitByCurator/[di]lit.ev.codes >> $dest/ev.codes";
}

##### RELOAD ATTRIBUTES DATABASE
# delete the old attributes and then add the new ones
print STDERR "Deleting the attributes\n" if (DEBUG);
$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

# now add all the attributes. This is really slow, and we should probably do a low level sql call to speed this up,
# but this handles breaking out the peg id into the separate parts and everything. It should be good.
print STDERR "Reloading attributes from $dest/ev.codes\n" if (DEBUG);
system("AttrDBRefresh --load=$dest/ev.codes");


MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3