[Bioperl-l] rebuilding a genbank Bio Index

Jason Stajich jason@cgt.mc.duke.edu
Mon, 4 Mar 2002 16:41:21 -0500 (EST)


On Mon, 4 Mar 2002, Andreas Matern wrote:

> I have a Bio::Index::Genbank which has regretfully had its member files
> updated.
>
> I've been trying to rebuild the index like so:
> (N.B. this is exactly how I made the index in the first place)
>
> use Bio::Index::GenBank;
> my $Index_File_Name = "genbank";
> my $inx = Bio::Index::GenBank->new('-filename' => $Index_File_name,
> '-write_flag' => 'WRITE');
> $inx->Make_index('/path/to/gbfile/file.seq');
>
> and then trying to access it like so:
>
> use Bio::Index::GenBank;
> my $Index_File_Name = "genbank";
> my $inx = Bio::Index::GenBank->new('-filename' => $Index_File_name);
> @acc = $inx->get_all_primary_ids();
> foreach my $acc (@acc) {
> 	//do fancy stuff here
> }
>
> But I still get errors like:
>
> MSG: file 0 [/path/to/gbfile/file.seq ] has changed size 15543834 ->
> 165442561. This probably means you need to rebuild the index.
>
add a
unlink($Index_File_name)
before the
my $inx = Bio::Index::GenBank->new('-filename' => $Index_File_name);

This will mean rebuilding the entire index so if you had other files
indexed you'll need to re-add them.  At least I don't think we have a
way of pulling out only a subset of the files that are indexed.

> Am I missing something?  Is there some kind of 'update' or 'rebuild'
> command I can't seem to find?
> Any help is appreciated.
>
> If it helps, I'm using the CVS version of bioperl (from Friday) on irix
> with perl 5.6.0 under irix.
>
> Thanks!
>
> -Andreas
>

-- 
Jason Stajich
Duke University
jason@cgt.mc.duke.edu