[ensembl-dev] A question on lazy loading

Ma, Man Chun John manchunjohn-ma at uiowa.edu
Wed Sep 8 21:24:26 BST 2010


Hi all,

I'm writing a script on parse some Ensembl Variation data. For the sake
of uniformity, our lab decided to use flanking sequences as extracted
from the reference sequence, instead of what is stored in the
flanking_sequence table. 
I originally write the following, supposing $v is a Variation and $vf is
a VariationFeature object of the same SNP:

[...]
My
$three_prime_flanking=$vf->Slice->subseq($vf->seq_region_start-101,$vf_r
egion_start-1);
[...]

When running the script under ActivePerl 5.10.1 with DBD-mysql 4.011, I
found there has been a big increase in both network activity and memory
use when it comes to this line, much more than similar scripts I ran
under the same environment. However, after I changed it to the
following, the script returned normal:

[...]
My $vf_slice=$vf->Slice;
My
$three_prime_flanking=$vf_Slice->subseq($vf->seq_region_start-101,$vf_re
gion_start-1);
[...]

Is there something about the Ensembl API's lazy loading that I don't
know here?

John MC Ma
Graduate Assistant
Kwitek Lab
Department of Internal Medicine
3125E MERF
375 Newton Road
Iowa City IA 52242




More information about the Dev mailing list