[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.1 - (download) (as text) (annotate)
Mon Dec 1 20:46:40 2003 UTC (16 years ago) by efrank
Branch: MAIN
CVS Tags: V00-00-01, efrank-preMakefileToStandardMk, delong-01, delong-02, V00-00-00

Makefile:
	get it to work with the release tools

All the rest:
	had to rename foo to foo.pl so that makefiles could recognize
	perl source from, say, Makefiles and READMEs

# -*- perl -*-

###########################################
use strict;
use FIG;
use DBrtns;

my $fig = new FIG;
my $dbf = $fig->{_dbf};

my($temp_dir,$prot,$org);

# usage: load_extaernal_orgs

$dbf->drop_table( tbl => "external_orgs" );
$dbf->create_table( tbl  => "external_orgs",
                    flds => "prot varchar(32),"  .
                            "org varchar(64)"
                  );

$temp_dir = $FIG_Config::temp;
open(TAB,">$temp_dir/tmp$$") || die "could not open $temp_dir/tmp$$";
open(SPORG,"<$FIG_Config::global/ext_org.table") || die "could not open ext_org.table";
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);

$dbf->load_table( tbl => "external_orgs",
                  file => "$temp_dir/tmp$$" );
$dbf->create_index( idx  => "external_orgs_ix",
                    tbl  => "external_orgs",
                    type => "btree",
                    flds => "prot" );
$dbf->vacuum_it("external_orgs");
unlink("$temp_dir/tmp$$");

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3