# -*- perl -*- ########################################### use strict; use FIG; use Tracer; my $fig = new FIG; my($temp_dir,$prot,$org); # usage: load_extaernal_orgs $temp_dir = $FIG_Config::temp; my $orgFile = "$temp_dir/tmp$$"; Open(\*TAB, ">$orgFile"); Open(\*SPORG, "<$FIG_Config::global/ext_org.table"); Trace("Copying external organism file.") if T(2); while (defined($_ = )) { chop; ($prot,$org) = split(/\t/,$_); if (defined($prot) && defined($org) && (length($org) < 64)) { print TAB "$prot\t$org\n"; } } close(TAB); close(SPORG); $fig->reload_table('all', "external_orgs", "prot varchar(32), org varchar(64)", { external_orgs_ix => "prot" }, $orgFile); unlink($orgFile); Trace("External organisms loaded.") if T(2);