[Bioperl-l] BerkeleyDB
shalu sharma
sharmashalu.bio at gmail.com
Fri Jan 25 15:18:18 UTC 2019
Hey everyone,
So I am using this BerkeleyDB to make a huge database (tree method).
I use it to pull out matching ids (its working fine) from multiple datasets.
here are few lines of the code:
use strict ;
use BerkeleyDB ;
use Bio::SeqIO;
my $filename = "tree" ;
unlink $filename ;
my %h ;
tie %h, 'BerkeleyDB::Btree',
-Filename => $filename,
-Flags => DB_CREATE,
or die "Cannot open $filename: $!\n" ;
# Add a key/value pair to the file
open(IN,"$ARGV[0]"); # adding values
while(<IN>){
my $line = $_;
chomp($line);
my @f = split('\t',$line);
my $id = $f[0];my $val = $f[1];$id =~ s/^\s+//;$id =~ s/\s+$//;
$val =~ s/^\s+//;$val =~ s/\s+$//;
$h{$id} = $val;
----
----
My question is that: It makes a huge tree file. Is it possible to re-use
that tree file again instead of making it again and again. My query
datasets changes but not that database.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.open-bio.org/pipermail/bioperl-l/attachments/20190125/c8c6945a/attachment.html>
More information about the Bioperl-l
mailing list