public static InteractorXref getUniprotXref(Protein protein) { return getUniprotXref((Interactor) protein); }
private static String getLabel(Component comp1) { String name = ProteinUtils.getGeneName(comp1.getInteractor()); if (name == null) name = "null"; name = name.toLowerCase(); return name; } }
public static Collection<InteractorXref> extractIsoformParentCrossReferencesFrom(Protein protein) { return extractCrossReferencesFrom(protein, CvDatabase.INTACT_MI_REF, CvXrefQualifier.ISOFORM_PARENT_MI_REF); } }
if (protein == null) return null; if ((protein instanceof Protein) && !(isFromUniprot((Protein) protein))) {
/** * Get the Xref identities for an interactor * * @param interactor * @return */ public static List<InteractorXref> getIdentityXrefs(Interactor interactor) { return getIdentityXrefs(interactor, false); }
if (protein == null) return null; if ((protein instanceof Protein) && !(isFromUniprot((Protein) protein))) {
/** * Get the Xref identities for an interactor * * @param interactor * @return */ public static List<InteractorXref> getIdentityXrefs(Interactor interactor) { return getIdentityXrefs(interactor, false); }
public static InteractorXref getUniprotXref(Protein protein) { return getUniprotXref((Interactor) protein); }
private static String getLabel(Component comp1) { String name = ProteinUtils.getGeneName(comp1.getInteractor()); if (name == null) name = "null"; name = name.toLowerCase(); return name; } }
if ( (protein instanceof Protein) && !(isFromUniprot( (Protein)protein )) ) {
/** * Check if two interactors contain the same identity xrefs, excluding the IMEx partner identities * * @param interactor1 * @param interactor2 * @return */ public static boolean containTheSameIdentities(Interactor interactor1, Interactor interactor2) { List<InteractorXref> identities1 = getIdentityXrefs(interactor1, true); List<InteractorXref> identities2 = getIdentityXrefs(interactor2, true); if (identities1.size() != identities2.size()) { return false; } Comparator<InteractorXref> identityXrefComparator = new Comparator<InteractorXref>() { public int compare(InteractorXref o1, InteractorXref o2) { return o1.getPrimaryId().compareTo(o2.getPrimaryId()); } }; Collections.sort(identities1, identityXrefComparator); Collections.sort(identities2, identityXrefComparator); for (int i = 0; i < identities1.size(); i++) { if (!(identities1.get(i).equals(identities2.get(i)))) { return false; } } return true; }
public static Collection<InteractorXref> extractChainParentCrossReferencesFrom(Protein protein) { return extractCrossReferencesFrom(protein, CvDatabase.INTACT_MI_REF, CvXrefQualifier.CHAIN_PARENT_MI_REF); }
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; }
String geneName = ProteinUtils.getGeneName(interactor);
/** * Check if two interactors contain the same identity xrefs, excluding the IMEx partner identities * * @param interactor1 * @param interactor2 * @return */ public static boolean containTheSameIdentities(Interactor interactor1, Interactor interactor2) { List<InteractorXref> identities1 = getIdentityXrefs(interactor1, true); List<InteractorXref> identities2 = getIdentityXrefs(interactor2, true); if (identities1.size() != identities2.size()) { return false; } Comparator<InteractorXref> identityXrefComparator = new Comparator<InteractorXref>() { public int compare(InteractorXref o1, InteractorXref o2) { return o1.getPrimaryId().compareTo(o2.getPrimaryId()); } }; Collections.sort(identities1, identityXrefComparator); Collections.sort(identities2, identityXrefComparator); for (int i = 0; i < identities1.size(); i++) { if (!(identities1.get(i).equals(identities2.get(i)))) { return false; } } return true; }
public static Collection<InteractorXref> extractIsoformParentCrossReferencesFrom(Protein protein) { return extractCrossReferencesFrom(protein, CvDatabase.INTACT_MI_REF, CvXrefQualifier.ISOFORM_PARENT_MI_REF); } }
@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); }
for (InteractorXref idXref : ProteinUtils.getIdentityXrefs(interactor, false)) { if (xrefPointsToOwnAc(idXref)) {
public static Collection<InteractorXref> extractChainParentCrossReferencesFrom(Protein protein) { return extractCrossReferencesFrom(protein, CvDatabase.INTACT_MI_REF, CvXrefQualifier.CHAIN_PARENT_MI_REF); }
@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); } }