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

View of /FigKernelScripts/load_external_orgs.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (download) (as text) (annotate)
Thu Jun 9 05:51:06 2005 UTC (14 years, 6 months ago) by parrello
Branch: MAIN
CVS Tags: merge-trunktag-bobdev_news-2, Root-bobdev_news, merge-bobdev_news-1, caBIG-dataload-0, merge-trunktag-bobdev_news-1, merge-bodev_news-3, caBIG-00-00-00, merge-bobdev_news-2, merge-trunktag-bodev_news-3
Branch point for: Branch-bobdev_news
Changes since 1.1: +14 -22 lines
*** empty log message ***

# -*- 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($_ = <SPORG>)) {
    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);

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3