# $best_ensembl_id = list of e! IDs from highest priority xref for this accession
# master xref IDs are entries for the current accession via different methods. We take dependent xrefs from the old and add to the new
# possible that $object_type does not correspond to all of the $best_ensembl_id, only some
# get $object_type from object_xref of new_master_xref instead of trusting calling code
# cache object-type to id mapping
my$dep_sth=$self->xref->dbc->prepare("select distinct dependent_xref_id, dx.linkage_annotation, dx.linkage_source_id from dependent_xref dx where dx.master_xref_id = ?");
my$insert_dep_x_sth=$self->xref->dbc->prepare("insert into dependent_xref(master_xref_id, dependent_xref_id, linkage_annotation, linkage_source_id) values(?, ?, ?, ?)");
my$remove_dep_ox_sth=$self->xref->dbc->prepare("delete ix, g from object_xref ox left join identity_xref ix on ix.object_xref_id = ox.object_xref_id left join go_xref g on g.object_xref_id = ox.object_xref_id where master_xref_id = ? and ensembl_object_type = ? and xref_id = ? and ensembl_id = ?");
my$old_ens_id_sth=$self->xref->dbc->prepare("select distinct ensembl_id from object_xref where xref_id = ?");
my$update_dep_ox_sth=$self->xref->dbc->prepare("update ignore object_xref set ox_status = 'FAILED_PRIORITY' where master_xref_id = ? and ensembl_object_type = ? and xref_id = ? and ensembl_id = ? and ox_status = 'DUMP_OUT'");
my$clean_dep_ox_sth=$self->xref->dbc->prepare("delete from object_xref where master_xref_id = ? and ensembl_object_type = ? and xref_id = ? and ensembl_id = ? and ox_status = 'DUMP_OUT'");
my$dep_ox_sth=$self->xref->dbc->prepare("select object_xref_id from object_xref where master_xref_id = ? and ensembl_object_type = ? and ensembl_id = ? and linkage_type = 'DEPENDENT' AND ox_status = 'DUMP_OUT' and xref_id = ?");
my$insert_dep_go_sth=$self->xref->dbc->prepare("insert ignore into go_xref values(?, ?, ?)");