public static InteractorXref getUniprotXref(Protein protein) { return getUniprotXref((Interactor) protein); }
public static InteractorXref getUniprotXref(Protein protein) { return getUniprotXref((Interactor) protein); }
public PersistentProteinEvent(ProteinUpdateProcess process, Protein protein){ super(process); this.proteinAc = protein != null ? protein.getAc() : null; InteractorXref uniprotXref = ProteinUtils.getUniprotXref(protein); if (uniprotXref != null){ this.uniprotAc = uniprotXref.getPrimaryId(); } else { this.uniprotAc = null; } this.message = null; }
@Override @Transactional( "update" ) public void onInvalidIntactParent(InvalidIntactParentFoundEvent evt) throws ProcessorException { // reattach the updateProcess to the entity manager ProteinUpdateProcess updateProcess = IntactUpdateContext.getCurrentInstance().getUpdateFactory().getEntityManager().merge(this.updateProcess); Protein protein = evt.getProtein(); String newParentAc = evt.getNewParentAc(); String oldParentAc = evt.getOldParentAc(); InteractorXref uniprotXref = ProteinUtils.getUniprotXref(evt.getProtein()); String uniprotAc= uniprotXref != null ? uniprotXref.getPrimaryId() : null; IntactTranscriptUpdateEvent protEvt = new IntactTranscriptUpdateEvent(updateProcess, protein, uniprotAc, oldParentAc, newParentAc); IntactUpdateContext.getCurrentInstance().getUpdateFactory().getIntactTranscriptEventDao().persist(protEvt); }
@Override @Transactional( "update" ) public void onSecondaryAcsFound(UpdateCaseEvent evt) throws ProcessorException { // reattach the updateProcess to the entity manager ProteinUpdateProcess updateProcess = IntactUpdateContext.getCurrentInstance().getUpdateFactory().getEntityManager().merge(this.updateProcess); Collection<Protein> secondaryProteins = evt.getSecondaryProteins(); Collection<ProteinTranscript> secondaryIsoforms = evt.getSecondaryIsoforms(); Collection<XrefUpdaterReport> secondaryXrefReports = evt.getXrefUpdaterReports(); for (Protein prot : secondaryProteins){ InteractorXref oldPrimary = ProteinUtils.getUniprotXref(prot); String oldAc = oldPrimary != null ? oldPrimary.getPrimaryId() : null; SecondaryProteinEvent protEvt = new SecondaryProteinEvent(updateProcess, prot, oldAc, evt.getProtein().getPrimaryAc()); IntactUpdateContext.getCurrentInstance().getUpdateFactory().getSecondaryProteinEventDao().persist(protEvt); } for (ProteinTranscript protTrans : secondaryIsoforms){ Protein prot = protTrans.getProtein(); InteractorXref oldPrimary = ProteinUtils.getUniprotXref(prot); String oldAc = oldPrimary != null ? oldPrimary.getPrimaryId() : null; SecondaryProteinEvent protEvt = new SecondaryProteinEvent(updateProcess, prot, oldAc, protTrans.getUniprotVariant().getPrimaryAc()); IntactUpdateContext.getCurrentInstance().getUpdateFactory().getSecondaryProteinEventDao().persist(protEvt); } }
Protein protein = (Protein) interactor; InteractorXref uniprotIdentity = ProteinUtils.getUniprotXref(protein);