public Collection<Xref> getXrefs() { return wrappedInteraction.getXrefs(); }
protected void initialiseInteractionIdentifiers(Collection<MitabXref> interactionIds, T interaction){ Iterator<MitabXref> refsIterator = interactionIds.iterator(); while (refsIterator.hasNext()){ MitabXref ref = refsIterator.next(); if (XrefUtils.isXrefFromDatabase(ref, Xref.IMEX_MI, Xref.IMEX) && XrefUtils.doesXrefHaveQualifier(ref, Xref.IMEX_PRIMARY_MI, Xref.IMEX_PRIMARY)){ interaction.getXrefs().add(ref); } else if (XrefUtils.isXrefFromDatabase(ref, Checksum.RIGID_MI, Checksum.RIGID) || XrefUtils.isXrefFromDatabase(ref, null, Checksum.IRIGID)){ createChecksumFromId(interaction, ref); } else{ interaction.getIdentifiers().add(ref); } } }
interaction.getXrefs().addAll(xrefI);
/** * This method will copy basic properties from the Interaction source in the complex target. * It will erase existing annotations, xrefs, checksums and identifiers * This method does not copy the participants of the source * @param source * @param target */ public static void copyAndOverrideBasicComplexPropertiesWithInteractionProperties(Interaction source, Complex target){ if (source != null && target != null){ target.setInteractionType(source.getInteractionType()); target.setCreatedDate(source.getCreatedDate()); target.setUpdatedDate(source.getUpdatedDate()); if (source.getShortName() != null){ target.setShortName(source.getShortName()); } // copy collections target.getAnnotations().clear(); target.getAnnotations().addAll(source.getAnnotations()); target.getXrefs().clear(); target.getXrefs().addAll(source.getXrefs()); target.getIdentifiers().clear(); target.getIdentifiers().addAll(source.getIdentifiers()); target.getChecksums().clear(); target.getChecksums().addAll(source.getChecksums()); } }
/** * For each cross reference of this XrefContainer, collects all respective cross reference type(s) and * check if the dependencies are correct. * * @param container to check on. * @return a collection of validator messages. * if we fail to retreive the MI Ontology. */ public Collection<ValidatorMessage> check( Interaction container) throws ValidatorException { Collection<ValidatorMessage> messages = new ArrayList<ValidatorMessage>(); // Collect the db references Collection<Xref> databaseReferences = container.getXrefs(); for ( Xref reference : databaseReferences) { MiContext context = RuleUtils.buildContext(reference, "database xref"); context.addAssociatedContext(RuleUtils.buildContext(container, "interaction")); // build a context in case of error messages.addAll( mapping.check( reference.getDatabase(), reference.getQualifier(), context, this ) ); } // Collect the identifiers Collection<Xref> identifiers = container.getIdentifiers(); for ( Xref reference : identifiers) { MiContext context = RuleUtils.buildContext(reference, "database xref"); context.addAssociatedContext(RuleUtils.buildContext(container, "interaction")); // build a context in case of error messages.addAll( mapping.check( reference.getDatabase(), reference.getQualifier(), context, this ) ); } return messages; }