<div dir="ltr"><div>Hi Magali and <br></div><div>Hi all,<br><br></div><div>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:<br>
</div><div>errors:<br>Use of uninitialized value in print at HZ254_genedata.pl line 20.<br><br>scripts:<br># methanocella_conradii_hz254 <br>#HZ254_genedata.pl<br>#!/usr/bin/perl<br>use strict;<br>use warnings;<br>use Bio::EnsEMBL::LookUp;<br>
# load the lookup from the main Ensembl Bacteria public server<br>my $lookup = Bio::EnsEMBL::LookUp->new(<br>  -URL => "<a href="http://bacteria.ensembl.org/registry.json">http://bacteria.ensembl.org/registry.json</a>",<br>
  -NO_CACHE => 1<br>);<br># find the correct database adaptor using a unique name<br>my ($dba) = @{$lookup->get_by_name_exact(<br>  'methanocella_conradii_hz254'<br>)};<br>my $genes = $dba->get_GeneAdaptor()->fetch_all(); <br>
# get all gene infomation<br>open (MYFILE, '>>HZ254gene_data.txt');<br>foreach my $gene (@$genes){<br>print $gene->stable_id,"\t", <br>$gene->display_id,"\t",<br>$gene->description,"\t", <br>
$gene->start, " - ", <br>$gene->end, "\t", <br>$gene->external_name, "\t",<br>$gene->length,"\n";<br>};<br>close (MYFILE);<br></div><div>##API version 74<br><br></div><div>
<div><div><br>-- <br><div>Pengfei Liu, PhD Candidate<br><br>Lab of Microbial Ecology<br>College of Resources and Environmental Sciences<br>China Agricultural University<br>No.2 Yuanmingyuanxilu, Beijing, 100193<br>P.R. China<br>
<br>Tel: +86-10-62731358<br>Fax: +86-10-62731016<br> <br>E-mail: <a href="mailto:liupfskygre@gmail.com" target="_blank">liupfskygre@gmail.com</a></div>
<div> </div>
<div>If you are afraid of tomorrow, how can you enjoy today! </div>
<div>Keep hungry, Keep foolish! </div>
<div>Moving forward!</div>
</div></div></div></div>