[Bioperl-l] get_Stream_by_gi: Memory going up every call.
Chris Fields
cjfields at uiuc.edu
Mon Oct 29 16:06:24 UTC 2007
It may be based on the mode (set by -retrievaltype) in which the
sequences are being retrieved and parsed. The Bio::DB::WebDBSeqI
module has the documentation for this parameter. If you are making
tons of calls to get_Seq*/get_Stream* methods it may lead to
substantial increases in memory until the child processes finish up
parsing each data stream.
You can possibly add in a wait() in between sequence retrieval calls,
or try setting the Bio::DB::GenBank instance to 'tempfile' or
'io_string' (the former always worked faster for me):
$self->{gb} = Bio::DB::GenBank->new(-retrievaltype => 'tempfile');
chris
On Oct 26, 2007, at 7:42 AM, Jelle86 wrote:
> Ok I stripped a lot. And this is causing the problem:
>
> use Bio::DB::Genbank;
> sub new(){
> my $invocant = shift;
> my $class = ref($invocant) || $invocant;
> my $self = {@_};
> $self->{gb} = Bio::DB::GenBank->new();
> bless $self, $class;
> return $self;
> }
>
> sub streamQuery(){
> my $self = shift;
> my $stream_obj = $self->{gb}->get_Stream_by_gi($self->{ids});
> while (my $seq_obj = $stream_obj->next_seq) {
>
> }
> }
>
> Both subs (new and streamQuery) are called several times with a new
> accessionlist.
> Removing the while loop, will use a bit less memory. But the memory
> usage is
> still going up.
> --
> View this message in context: http://www.nabble.com/get_Stream_by_gi
> %3A-Memory-going-up-every-call.-tf4689188.html#a13426480
> Sent from the Perl - Bioperl-L mailing list archive at Nabble.com.
>
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/bioperl-l
Christopher Fields
Postdoctoral Researcher
Lab of Dr. Robert Switzer
Dept of Biochemistry
University of Illinois Urbana-Champaign
More information about the Bioperl-l
mailing list