[ensembl-dev] slice fetch_all warnings

Patrick Meidl pmeidl at cemm.oeaw.ac.at
Tue Jul 12 09:05:15 BST 2011


On Tue, Jul 12 2011, Hardip Patel <H.Patel at victorchang.edu.au> wrote:

> I am using the following code to obtain all toplevel slices for the
> yeast genome.
> 
> 
> my $slice_adaptor = $reg->get_adaptor('Saccharomyces cerevisiae', 'Core', 'Slice');
> foreach my $slice (@{$slice_adaptor->fetch_all('toplevel', 'EF3')}){
>   ...do something...
> }
> 
> However it is giving following warnings during the accession of Mito
> and 2-micro sequences.
> 
> Use of uninitialized value in numeric gt (>) at /short/sharedapps/Ensembl/ensembl63/modules/Bio/EnsEMBL/DBSQL/SequenceAdaptor.pm line 150.

looking at the code in fetch_by_Slice_start_end_strand(), this looks
like valid behaviour ($end can be undefined), but it might be nice to
change the code to check for this before doing the numeric comparison.

generally, I always use

--8-----------------
use warnings;
no warnings 'uninitialized';
--8-----------------

in my perl scripts, because perl allows a convenient programming style
where you don't care about initialising scalar variables (perl will Do
The Right Thing with them), and many people use this style.

HTH

    patrick

-- 
Patrick Meidl, Mag.
Bioinformatician

Ce-M-M-
Research Centre for Molecular Medicine
of the Austrian Academy of Science

Lazarettgasse 14 / AKH BT 25.3
Vienna, Austria

room 02.205
phone +43 1 40160 70016
email pmeidl at cemm.oeaw.ac.at
web http://www.cemm.at/





More information about the Dev mailing list