public void writeUniqueIdentifier(P participant) throws IOException { if (participant == null){ writer.write(MitabUtils.EMPTY_COLUMN); } else { Interactor interactor = participant.getInteractor(); // write first identifier if (!interactor.getIdentifiers().isEmpty()){ writeIdentifier(interactor.getPreferredIdentifier()); } else{ writer.write(MitabUtils.EMPTY_COLUMN); } } }
Interactor interactor = participant.getInteractor(); if (interactor.getIdentifiers().size() > 1){ Iterator<Xref> identifierIterator = interactor.getIdentifiers().iterator(); boolean isFirst = true; Xref next = null;
if (!interactor1.getIdentifiers().isEmpty() && !interactor2.getIdentifiers().isEmpty()){ Iterator<Xref> iterator1 = interactor1.getIdentifiers().iterator(); Xref altid1 = iterator1.next(); for (Xref altid2 : interactor2.getIdentifiers()){ if (DefaultExternalIdentifierComparator.areEquals(altid1, altid2)){ return true;
if (!interactor1.getIdentifiers().isEmpty() || !interactor2.getIdentifiers().isEmpty()){ Collection<Xref> identifiers1 = interactor1.getIdentifiers(); Collection<Xref> identifiers2 = interactor2.getIdentifiers(); return identifierCollectionComparator.compare(identifiers1, identifiers2);
/*** * This method will copy properties of interactor source in interactor target and will override all the other properties of Target interactor. * @param source * @param target */ public static void copyAndOverrideBasicInteractorProperties(Interactor source, Interactor target){ if (source != null && target != null){ target.setShortName(source.getShortName()); target.setFullName(source.getFullName()); target.setInteractorType(source.getInteractorType()); target.setOrganism(source.getOrganism()); // copy collections target.getAnnotations().clear(); target.getAnnotations().addAll(source.getAnnotations()); target.getIdentifiers().clear(); target.getIdentifiers().addAll(source.getIdentifiers()); target.getAliases().clear(); target.getAliases().addAll(source.getAliases()); target.getXrefs().clear(); target.getXrefs().addAll(source.getXrefs()); target.getChecksums().clear(); target.getChecksums().addAll(source.getChecksums()); } }
if (!interactor.getIdentifiers().isEmpty()){ List<Xref> list1 = new ArrayList<Xref>(interactor.getIdentifiers());
final Set<String> dbRefs = RuleUtils.collectNames( dbs ); final Collection<Xref> identities = XrefUtils.searchAllXrefsHavingDatabaseAndQualifier(interactor.getIdentifiers(), dbMiRefs, dbRefs, Arrays.asList(Xref.IDENTITY_MI), Arrays.asList(Xref.IDENTITY)); final Set<String> dbRefs = RuleUtils.collectNames( dbs ); final Collection<Xref> identities = XrefUtils.searchAllXrefsHavingDatabaseAndQualifier(interactor.getIdentifiers(), dbMiRefs, dbRefs, Arrays.asList(Xref.IDENTITY_MI), Arrays.asList(Xref.IDENTITY)); if(identities.isEmpty() ) {
protected void processInteractorPool(Collection<MitabXref> xref, InteractorPool interactor) { InteractorPool pool = (InteractorPool)interactor; for (Xref ref : xref){ // we have a component of the interactor pool if (XrefUtils.doesXrefHaveQualifier(ref, Xref.INTERACTOR_SET_QUALIFIER_MI, Xref.INTERACTOR_SET_QUALIFIER)){ Interactor subInteractor = interactorFactory.createInteractorFromDatabase(ref.getDatabase(), ref.getId().toLowerCase()); if (subInteractor != null){ subInteractor.getIdentifiers().add(new MitabXref(ref.getDatabase(), ref.getId(), ref.getVersion(), CvTermUtils.createIdentityQualifier())); ((MitabInteractor)subInteractor).setSourceLocator(((MitabXref)ref).getSourceLocator()); } // create a default interactor else{ subInteractor = interactorFactory.createInteractor(ref.getId().toLowerCase(), CvTermUtils.createUnknownInteractorType()); subInteractor.getIdentifiers().add(new MitabXref(ref.getDatabase(), ref.getId(), ref.getVersion(), CvTermUtils.createIdentityQualifier())); ((MitabInteractor)subInteractor).setSourceLocator(((MitabXref)ref).getSourceLocator()); } // add the component to the interactor pool pool.add(subInteractor); } // we have a simple xref else{ pool.getXrefs().add(ref); } } }
Collection<Xref> identifiers = container.getIdentifiers();
interactor.getIdentifiers().addAll(uniqueId);
interactor.getIdentifiers().add(ref);
for (Xref ref : interactor.getIdentifiers()){ checkXref(messages, ref, interactor, "interactor");
for (Xref xref : interactor.getIdentifiers()) { if (XrefUtils.isXrefFromDatabase(xref, Xref.UNIPROTKB_MI, Xref.UNIPROTKB) && XrefUtils.doesXrefHaveQualifier(xref, Xref.IDENTITY_MI, Xref.IDENTITY)){