[ensembl-dev] Use of uninitialized value in print at HZ254_genedata.pl line .

刘鹏飞 liupfskygre at gmail.com
Mon Feb 10 05:22:33 GMT 2014


Hi Magali and
Hi all,

I use following code to fetch all information of genes for a bacteria, but
get some errors (althouth I could get all data I wanted), but I could not
figure out where goes wrong, thanks:
errors:
Use of uninitialized value in print at HZ254_genedata.pl line 20.

scripts:
# methanocella_conradii_hz254
#HZ254_genedata.pl
#!/usr/bin/perl
use strict;
use warnings;
use Bio::EnsEMBL::LookUp;
# load the lookup from the main Ensembl Bacteria public server
my $lookup = Bio::EnsEMBL::LookUp->new(
  -URL => "http://bacteria.ensembl.org/registry.json",
  -NO_CACHE => 1
);
# find the correct database adaptor using a unique name
my ($dba) = @{$lookup->get_by_name_exact(
  'methanocella_conradii_hz254'
)};
my $genes = $dba->get_GeneAdaptor()->fetch_all();
# get all gene infomation
open (MYFILE, '>>HZ254gene_data.txt');
foreach my $gene (@$genes){
print $gene->stable_id,"\t",
$gene->display_id,"\t",
$gene->description,"\t",
$gene->start, " - ",
$gene->end, "\t",
$gene->external_name, "\t",
$gene->length,"\n";
};
close (MYFILE);
##API version 74


-- 
Pengfei Liu, PhD Candidate

Lab of Microbial Ecology
College of Resources and Environmental Sciences
China Agricultural University
No.2 Yuanmingyuanxilu, Beijing, 100193
P.R. China

Tel: +86-10-62731358
Fax: +86-10-62731016

E-mail: liupfskygre at gmail.com

If you are afraid of tomorrow, how can you enjoy today!
Keep hungry, Keep foolish!
Moving forward!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.ensembl.org/pipermail/dev_ensembl.org/attachments/20140210/0d43c5fa/attachment.html>


More information about the Dev mailing list