######################################################################## # # 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($_ = )) { if ($_ =~ /^(\d+)\t(\S.*\S)/) { $index_hash{$1} = $2; } else { print STDERR "INVALID: $_"; } } undef $index_hash_tie; untie %index_hash;