<div>Hi All</div><div><br></div><div>I use Ensembl API to retrieve gene information, the script works well on Ensembl data. However, when try to retrieve some EnsemblGenomes's entries, error happens.</div><div><br></div>
<div>I guess the gene Id which contain special character such as dot ('.') cause API fail to work. For example, species=Caenorhabditis_elegans&id=C45B2.4 . I also try to get data with display_label, instead of gene_id. Unfortunately, the method $sth->fetch() fails to work on the same entries.</div>
<div><br></div><div>Is there anyone know the solution? If someone knows the way that find out the database name of a given species, I can use my own SQL sentence to do the task. </div><div><br></div><div>Thanks.</div><div>
<br></div><div><span style="background-color:rgb(255,255,255)"><font color="#ff0000">Code: retrieve data with gene_id</font></span></div><div><br></div><div><div>use Bio::EnsEMBL::Registry;</div><div>use DBConfig;</div><div>
<br></div><div>my %my_host = &DBConfig::DBConfigure;</div><div>my $my_specise;</div><div>my $registry = "Bio::EnsEMBL::Registry";</div><div>my $stable_id;</div><div><br></div><div>$registry->load_registry_from_db(</div>
<div>    -host => $my_host{ip}, </div><div>    -user => $my_host{user},</div><div>    -pass => $my_host{pass},</div><div>    -port => $my_host{port}</div><div>);</div><div><br></div><div>my $gene_adaptor = $registry->get_adaptor($my_specise, 'Core', 'gene' );</div>
<div>my $gene = $gene_adaptor->fetch_by_stable_id($stable_id);</div><div>my $transcripts = $gene->get_all_Transcripts();</div></div><div>......................</div><div>......................</div><div>......................</div>
<div><br></div><div><font color="#ff0000">Code: retrieve data with display_label</font></div><div><br></div><div><div>use Bio::EnsEMBL::Registry;</div><div>use DBConfig;</div></div><div><br></div><div><div>my $my_specise;</div>
<div>my $registry = "Bio::EnsEMBL::Registry";</div><div>my $stable_id;</div><div>my $display_label;</div></div><div>my %my_host = &DBConfig::DBConfigure;</div><div><br></div><div><div>$registry->load_registry_from_db(</div>
<div>    -host => $my_host{ip},</div><div>    -user => $my_host{user},</div><div>    -pass => $my_host{pass},</div><div>    -port => $my_host{port}</div><div>);</div></div><div><br></div><div><div>my $gene_adaptor = $registry->get_adaptor($my_specise, 'Core', 'gene' );</div>
<div>my $dba= $registry->get_DBAdaptor($my_specise, "core");</div><div><br></div><div># Retrieve gene's display_label, according to the given gene_id</div><div>my $sth = $dba->dbc->prepare( "select x.display_label from gene g,xref x where g.display_xref_id = x.xref_id and g.stable_id='$stable_id'");</div>
<div>$sth->execute;</div><div>$sth->bind_columns(\$display_label);</div><div><br></div><div>if ($sth->fetch()){</div><div>    print $display_label;</div><div>}</div><div>else{ die "Cannot find this gene."; }</div>
</div><div>..............................</div><div>..............................</div><div>..............................</div><div><br></div>-- <br><div><font face="verdana, sans-serif" size="1">Gang Chen</font></div><div>
<font face="verdana, sans-serif" size="1">TILSI</font></div><div><font face="verdana, sans-serif" size="1"><span style="background-color:rgb(255,255,255)">Taicang Institute For Life Science Information</span><br style="background-color:rgb(255,255,255)">
<span style="background-color:rgb(255,255,255)">Address: A2/162, Renmin South Road, Taicang, 215400, Jiangsu Province, P.R.China</span><br style="background-color:rgb(255,255,255)"><span style="background-color:rgb(255,255,255)">Phone:£¨+86£©512-82782588</span></font></div>
<br>