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

View of /FigKernelScripts/FFB3_load_oligo_index.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (download) (as text) (annotate)
Tue Jan 10 13:18:14 2012 UTC (7 years, 10 months ago) by olson
Branch: MAIN
CVS Tags: rast_rel_2014_0729, mgrast_version_3_2, rast_rel_2014_0912, HEAD
New figfam building code.

########################################################################
#
# Copyright (c) 2003-2006 University of Chicago and Fellowship
# for Interpretations of Genomes. All Rights Reserved.
#
# This file is part of the SEED Toolkit.
# 
# The SEED Toolkit is free software. You can redistribute
# it and/or modify it under the terms of the SEED Toolkit
# Public License. 
#
# You should have received a copy of the SEED Toolkit Public License
# along with this program; if not write to the University of Chicago
# at info@ci.uchicago.edu or the Fellowship for Interpretation of
# Genomes at veronika@thefig.info or download a copy from
# http://www.theseed.org/LICENSE.TXT.
#
########################################################################

use strict;
use DB_File;

my $usage = "usage: load_oligo_index IndexF DBF";

my ($indexF,$dbF);
(
 ($indexF = shift @ARGV) &&
 ($dbF    = shift @ARGV)
)
    || die $usage;

my %index_hash;

if (-e $dbF) { unlink $dbF }

my $index_hash_tie = tie %index_hash, 'DB_File', $dbF, O_RDWR | O_CREAT, 0666, $DB_HASH;
$index_hash_tie || die "tie failed";

open(INDEX,"<$indexF") || die "could not open $indexF";
while (defined($_ = <INDEX>))
{
    if ($_ =~ /^(\d+)\t(.*)\s*$/)
    {
	$index_hash{$1} = $2;
    }
    else
    {
	print STDERR "INVALID: $_";
    }
}
undef $index_hash_tie;
untie %index_hash;    

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3