[Bioperl-l] final proposal: Bio::DB::WebSeqDBI

Jason Stajich jason@chg.mc.duke.edu
Tue, 12 Dec 2000 11:45:16 -0500 (EST)


On Mon, 11 Dec 2000, Hilmar Lapp wrote:

> Jason Stajich wrote:
> > 
> > One issue I am not sure how to best deal with, the temporary file removal
> > at the end of the life of the Bio::DB::WebSeqDBI object.  The following
> > code illustrates a case this will remove files too soon.
> > 
> > my $seqdb = new Bio::DB::Genbank(-retrievaltype=>'tempfile');
> > my $seqio = $seqdb->get_Stream_by_id($accession);
> > undef $seqdb;  # this will remove the seqdb object and cleanup the
> >                # tempfile that was created
> > my $seq = $seqio->next_seq(); # bomb because no file exists now.
> > 
> 
> Provided that things work the same way as in e.g. C (and it ought to be so,
> because it's the OS that dictates it), the tempfile should not be
> physically removed as long as there is a stream (filehandle) open on it (it
> may be invisible to directory listings though). Since SeqIO::* modules keep
> a file handle open until $seqio->close() is called, there should be no
> problem. Am I missing something? Have you tested for the behaviour your
> mentioning?

It always helps to test something before crying wooolfie.  This is in fact
not a problem since the filehandle is opened in the method to create a
SeqIO, so it is only unlinked when the SeqIO object is destroyed. I have
added this to the test routines as well.

> 
> > 
> > Is the name WebSeqDBI misleading - (ie looks like it would be a DBI
> > module...?) We like to use 'I' at the end of a module name to denote
> > interfaces.
> > 
> 
> I agree with David, it's somewhat misleading. I don't have a strong view
> though. In general, I wouldn't have considered it as an interface anyway
> (why does it qualify as one?), so why not simply omit the trailing 'I'?

Ewan's suggestion BioDBSeqI has been used, since semantically it has to be
an interface since no one should instantiate a WebDBSeqI object directly.

I think I'm ready to finalize some documentation and commit.  All tests
pass here assuming NCBI is not rejecting me for too many requests during
the testing phase... =)


Jason Stajich
jason@chg.mc.duke.edu
Center for Human Genetics
Duke University Medical Center 
http://www.chg.duke.edu/