{'RaiseError'=>1})||die"Can't connect to database $new_dbname";
# if one source specified, use that, otherwise loop over them all
if($source){
compare($source);
}else{
my$old_extdb_sth=$old_dbi->prepare("SELECT db_name FROM external_db WHERE db_name NOT LIKE 'AFFY%' AND status LIKE 'KNOWN%'");
my$ext_db;
$old_extdb_sth->execute();
$old_extdb_sth->bind_columns(\$ext_db);
while($old_extdb_sth->fetch()){
compare($ext_db);
}
}
sub compare{
my$source=shift;
# Read & cache all old stable_id-display_xref mappings
#print "Caching old gene stable ID - $source display_xref mappings from $old_dbname\n";
my$sql="SELECT gsi.stable_id, x.dbprimary_acc FROM xref x, gene_stable_id gsi, gene g, external_db e WHERE gsi.gene_id=g.gene_id AND g.display_xref_id=x.xref_id AND e.external_db_id=x.external_db_id AND e.db_name='".$source."'";