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

Annotation of /FigKernelScripts/FFB2_load_oligo_index.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (view) (download) (as text)

1 : overbeek 1.1 ########################################################################
2 :     #
3 :     # Copyright (c) 2003-2006 University of Chicago and Fellowship
4 :     # for Interpretations of Genomes. All Rights Reserved.
5 :     #
6 :     # This file is part of the SEED Toolkit.
7 :     #
8 :     # The SEED Toolkit is free software. You can redistribute
9 :     # it and/or modify it under the terms of the SEED Toolkit
10 :     # Public License.
11 :     #
12 :     # You should have received a copy of the SEED Toolkit Public License
13 :     # along with this program; if not write to the University of Chicago
14 :     # at info@ci.uchicago.edu or the Fellowship for Interpretation of
15 :     # Genomes at veronika@thefig.info or download a copy from
16 :     # http://www.theseed.org/LICENSE.TXT.
17 :     #
18 :     ########################################################################
19 :    
20 :     use strict;
21 :     use DB_File;
22 :    
23 :     my $usage = "usage: load_oligo_index IndexF DBF";
24 :    
25 :     my ($indexF,$dbF);
26 :     (
27 :     ($indexF = shift @ARGV) &&
28 :     ($dbF = shift @ARGV)
29 :     )
30 :     || die $usage;
31 :    
32 :     my %index_hash;
33 :    
34 :     if (-e $dbF) { unlink $dbF }
35 :    
36 :     my $index_hash_tie = tie %index_hash, 'DB_File', $dbF, O_RDWR | O_CREAT, 0666, $DB_HASH;
37 :     $index_hash_tie || die "tie failed";
38 :    
39 :     open(INDEX,"<$indexF") || die "could not open $indexF";
40 :     while (defined($_ = <INDEX>))
41 :     {
42 :     if ($_ =~ /^(\d+)\t(\S.*\S)/)
43 :     {
44 :     $index_hash{$1} = $2;
45 :     }
46 :     else
47 :     {
48 :     print STDERR "INVALID: $_";
49 :     }
50 :     }
51 :     undef $index_hash_tie;
52 :     untie %index_hash;

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3