my$xref_sth=$self->dbi()->prepare("SELECT xref_id FROM xref WHERE accession=? AND version=? AND source_id=$source_id AND species_id=$species_id");
my$sql='select tsi.stable_id, x.dbprimary_acc from xref x, object_xref ox, transcript_stable_id tsi, external_db e where x.xref_id=ox.xref_id and ox.ensembl_object_type = "Transcript" and ox.ensembl_id = tsi.transcript_id and e.external_db_id = x.external_db_id and e.db_name like "Ens_%_transcript"';
#
# Need to get the stable_id via the ENST xrefs!!!!!
#
my%seen;
#
#
#
my$sql='select ox.ensembl_id, x.dbprimary_acc from object_xref ox, xref x, external_db e where x.xref_id = ox.xref_id and x.external_db_id = e.external_db_id and e.db_name like "Ens_%_transcript" and x.dbprimary_acc like "'.$tran_name.'%"';
my%trans_id_to_stable_id;
my$sth=$dbi2->prepare($sql);
$sth->execute()orcroak($dbi2->errstr());
while(my@row=$sth->fetchrow_array()){
$trans_id_to_stable_id{$row[0]}=$row[1];
# print $row[0]."\t".$row[1]."\n";
}
$sth->finish;
$sql='select ox.ensembl_id, x.dbprimary_acc, x.display_label, x.version from object_xref ox, xref x, external_db e where x.xref_id = ox.xref_id and x.external_db_id = e.external_db_id and e.db_name like "CCDS"';
$sth=$dbi2->prepare($sql);
$sth->execute()orcroak($dbi2->errstr());
my$sth=$dbi2->prepare($sql)or"Could not prepare sql $sql\n";;