diff --git a/misc-scripts/xref_mapping/XrefMapper/ProcessPaired.pm b/misc-scripts/xref_mapping/XrefMapper/ProcessPaired.pm index 583abc1834724b2e2f4416e42cbd03dda6d58f22..26f06a53bca27a1cbd0e9abecc693ba1778fce38 100644 --- a/misc-scripts/xref_mapping/XrefMapper/ProcessPaired.pm +++ b/misc-scripts/xref_mapping/XrefMapper/ProcessPaired.pm @@ -84,6 +84,7 @@ sub process{ my $transl_object_xrefs_sth = $self->xref->dbc->prepare("select ox.object_xref_id, ox.ensembl_id, x.accession from object_xref ox join xref x on (ox.xref_id = x.xref_id and ox.ox_status = 'DUMP_OUT' and ox.ensembl_object_type = 'Translation') join source s on (x.source_id = s.source_id and s.name like 'RefSeq\_peptide%')"); my $ox_mark_delete_sth = $self->xref->dbc->prepare("update object_xref set ox_status = 'MULTI_DELETE' where object_xref_id = ?"); + my $ox_dx_delete_sth = $self->xref->dbc->prepare("update object_xref master_ox, object_xref dependent_ox, xref dependent, xref master, dependent_xref dx set dependent_ox.ox_status = 'MULTI_DELETE' where dependent.xref_id = dx.dependent_xref_id and master.xref_id = dx.master_xref_id and dependent.xref_id = dependent_ox.xref_id and master.xref_id = master_ox.xref_id and master_ox.object_xref_id = ? and dependent_ox.ensembl_id = ?"); $transcr_obj_xrefs_sth->execute(); @@ -168,6 +169,8 @@ sub process{ #this translations's transcript is not matched with the paired RefSeq_mRNA%, #change the status to 'MULTI_DELETE' $ox_mark_delete_sth->execute($translation_object_xref_id) || die("Failed to update status to 'MULTI_DELETE for object_xref_id $translation_object_xref_id"); + $ox_dx_delete_sth->execute($translation_object_xref_id, $translation_id); + # Process all dependent xrefs as well $change{'translation object xrefs removed'}++; }