/** * Retrieves the parameters from an interaction, initializing them if necessary. * Do not set the initialized collection of parameters because parameters cannot be orphan * @param interaction the interaction * @return The returned confidences are ensured to be initialized * @since 2.4.0 */ public static Collection<InteractionParameter> ensureInitializedInteractionParameters(Interaction interaction) { Collection<InteractionParameter> parameters; if (IntactCore.isInitialized(interaction.getParameters())) { parameters = interaction.getParameters(); } else { parameters = IntactContext.getCurrentInstance().getDaoFactory().getInteractionParameterDao().getByInteractionAc(interaction.getAc()); } return parameters; }
/** * Retrieves the parameters from an interaction, initializing them if necessary. * Do not set the initialized collection of parameters because parameters cannot be orphan * @param interaction the interaction * @return The returned confidences are ensured to be initialized * @since 2.4.0 */ public static Collection<InteractionParameter> ensureInitializedInteractionParameters(Interaction interaction) { Collection<InteractionParameter> parameters; if (IntactCore.isInitialized(interaction.getParameters())) { parameters = interaction.getParameters(); } else { parameters = IntactContext.getCurrentInstance().getDaoFactory().getInteractionParameterDao().getByInteractionAc(interaction.getAc()); } return parameters; }
private void synchronizeInteraction( Interaction interaction, boolean synchronizeAnnotatedAttributes ) { interaction.setCvInteractionType( synchronize( interaction.getCvInteractionType() ) ); interaction.setCvInteractorType( synchronize( interaction.getCvInteractorType() ) ); if (IntactCore.isInitializedAndDirty(interaction.getComponents())){ Collection<Component> components = synchronizeCollection(interaction.getComponents()); interaction.getComponents().clear(); interaction.getComponents().addAll(components); } interaction.setBioSource( synchronize( interaction.getBioSource() ) ); if (IntactCore.isInitializedAndDirty(interaction.getExperiments())){ Collection<Experiment> experiment = synchronizeCollection(interaction.getExperiments()); interaction.getExperiments().clear(); interaction.getExperiments().addAll(experiment); } // cannot call setConfidences in interaction because of orphan relationship limitation if (IntactCore.isInitializedAndDirty(interaction.getConfidences())){ Collection<Confidence> confidences = synchronizeConfidences(interaction.getConfidences(), interaction); interaction.getConfidences().clear(); interaction.getConfidences().addAll(confidences); } // cannot call setParameters in interaction because of orphan relationship limitation if (IntactCore.isInitializedAndDirty(interaction.getParameters())){ Collection<InteractionParameter> interactionParameters = synchronizeInteractionParameters(interaction.getParameters(), interaction); interaction.getParameters().clear(); interaction.getParameters().addAll(interactionParameters); } if (synchronizeAnnotatedAttributes){ synchronizeAnnotatedObjectCommons( interaction ); } }
private void synchronizeInteraction( Interaction interaction, boolean synchronizeAnnotatedAttributes ) { interaction.setCvInteractionType( synchronize( interaction.getCvInteractionType() ) ); interaction.setCvInteractorType( synchronize( interaction.getCvInteractorType() ) ); if (IntactCore.isInitializedAndDirty(interaction.getComponents())){ Collection<Component> components = synchronizeCollection(interaction.getComponents()); interaction.getComponents().clear(); interaction.getComponents().addAll(components); } interaction.setBioSource( synchronize( interaction.getBioSource() ) ); if (IntactCore.isInitializedAndDirty(interaction.getExperiments())){ Collection<Experiment> experiment = synchronizeCollection(interaction.getExperiments()); interaction.getExperiments().clear(); interaction.getExperiments().addAll(experiment); } // cannot call setConfidences in interaction because of orphan relationship limitation if (IntactCore.isInitializedAndDirty(interaction.getConfidences())){ Collection<Confidence> confidences = synchronizeConfidences(interaction.getConfidences(), interaction); interaction.getConfidences().clear(); interaction.getConfidences().addAll(confidences); } // cannot call setParameters in interaction because of orphan relationship limitation if (IntactCore.isInitializedAndDirty(interaction.getParameters())){ Collection<InteractionParameter> interactionParameters = synchronizeInteractionParameters(interaction.getParameters(), interaction); interaction.getParameters().clear(); interaction.getParameters().addAll(interactionParameters); } if (synchronizeAnnotatedAttributes){ synchronizeAnnotatedObjectCommons( interaction ); } }
protected void copyInteraction( Interaction source, Interaction target ) { copyProperty(source, "KD", target); copyProperty(source, "crc", target); copyProperty(source, "cvInteractionType", target); copyCollection( source.getComponents(), target.getComponents() ); copyCollection( source.getExperiments(), target.getExperiments() ); copyCollection( source.getConfidences(), target.getConfidences() ); copyCollection( source.getParameters(), target.getParameters() ); copyInteractorCommons( source, target ); // we have ommited CRC on purpose }
protected void copyInteraction( Interaction source, Interaction target ) { copyProperty(source, "KD", target); copyProperty(source, "crc", target); copyProperty(source, "cvInteractionType", target); copyCollection( source.getComponents(), target.getComponents() ); copyCollection( source.getExperiments(), target.getExperiments() ); copyCollection( source.getConfidences(), target.getConfidences() ); copyCollection( source.getParameters(), target.getParameters() ); copyInteractorCommons( source, target ); // we have ommited CRC on purpose }
return IntactCore.isInitialized(((Interaction) parent).getComponents()); } else if (parent instanceof Interaction && child instanceof InteractionParameter) { return IntactCore.isInitialized(((Interaction) parent).getParameters()); } else if (parent instanceof Component && child instanceof Feature) { return IntactCore.isInitialized(((Component) parent).getBindingDomains());
if (!interaction.getParameters().isEmpty()){ for (Parameter param : interaction.getParameters()){ psidev.psi.mi.tab.model.Parameter paramField = parameterConverter.intactToMitab(param);
return IntactCore.isInitialized(((Interaction) parent).getComponents()); } else if (parent instanceof Interaction && child instanceof InteractionParameter) { return IntactCore.isInitialized(((Interaction) parent).getParameters()); } else if (parent instanceof Component && child instanceof Feature) { return IntactCore.isInitialized(((Component) parent).getBindingDomains());
protected void traverseInteraction(Interaction interaction, IntactVisitor ... visitors) { if (interaction == null) return; for (IntactVisitor visitor : visitors) { visitor.visitInteraction(interaction); } // check if this element has been traversed already, to avoid cyclic recursion if (recursionChecker.isAlreadyTraversed(interaction)) { return; } traverse(interaction.getCvInteractionType(), visitors); traverse(interaction.getExperiments(), visitors); traverse(interaction.getComponents(), visitors); traverse(interaction.getConfidences(), visitors); traverse(interaction.getParameters(), visitors); }
protected void traverseInteraction(Interaction interaction, IntactVisitor ... visitors) { if (interaction == null) return; for (IntactVisitor visitor : visitors) { visitor.visitInteraction(interaction); } // check if this element has been traversed already, to avoid cyclic recursion if (recursionChecker.isAlreadyTraversed(interaction)) { return; } traverse(interaction.getCvInteractionType(), visitors); traverse(interaction.getExperiments(), visitors); traverse(interaction.getComponents(), visitors); traverse(interaction.getConfidences(), visitors); traverse(interaction.getParameters(), visitors); }
components = intactObject.getComponents(); confidences = intactObject.getConfidences(); parameters = intactObject.getParameters(); annotations = intactObject.getAnnotations();
if (isCollectionClonable(interaction.getParameters())) { Collection<InteractionParameter> parameters = IntactCore.ensureInitializedInteractionParameters(interaction);
if (isCollectionClonable(interaction.getParameters())) { Collection<InteractionParameter> parameters = IntactCore.ensureInitializedInteractionParameters(interaction);