protected boolean isExpandableBasic(Interaction interaction) { if (interaction.getComponents().isEmpty()) { return false; } return true; }
public boolean isExpandable(Interaction interaction) { if ( interaction.getComponents().size() > 2 || interaction.getComponents().size() == 0 ) { return false; } return true; } }
/** * Collect a distinct set of Interactor associated to the given Interaction. * * @param interaction the interaction * @return a non null Set of Interactor. */ public static Set<Interactor> selectDistinctInteractors(Interaction interaction) { Set<Interactor> interactors = new HashSet<Interactor>(interaction.getComponents().size()); for (Component component : interaction.getComponents()) { interactors.add(component.getInteractor()); } return interactors; }
/** * Collect a distinct set of Interactor associated to the given Interaction. * * @param interaction the interaction * @return a non null Set of Interactor. */ public static Set<Interactor> selectDistinctInteractors( Interaction interaction ) { Set<Interactor> interactors = new HashSet<Interactor>( interaction.getComponents().size() ); for ( Component component : interaction.getComponents() ) { interactors.add( component.getInteractor() ); } return interactors; }
/** * Collect a distinct set of Interactor associated to the given Interaction. * * @param interaction the interaction * @return a non null Set of Interactor. */ public static Set<Interactor> selectDistinctInteractors(Interaction interaction) { Set<Interactor> interactors = new HashSet<Interactor>(interaction.getComponents().size()); for (Component component : interaction.getComponents()) { interactors.add(component.getInteractor()); } return interactors; }
public Collection<GeneralMessage> check(Interaction interaction) throws SanityRuleException { Collection<GeneralMessage> messages = new ArrayList<GeneralMessage>(); Collection<Component> components = interaction.getComponents(); if(components.size() == 0){ messages.add(new GeneralMessage(MessageDefinition.INTERACTION_WITHOUT_COMPONENT, interaction)); } return messages; } }
public Component createComponentRandom() { return createInteractionRandomBinary().getComponents().iterator().next(); }
public Component createComponentRandom() { return createInteractionRandomBinary().getComponents().iterator().next(); }
public Component createComponentRandom() { return createInteractionRandomBinary().getComponents().iterator().next(); }
/** * Checks if an interaction contain other interactor types than Protein * * @param interaction * @return */ public static boolean containsNonProteinInteractors( Interaction interaction ) { for ( Component component : interaction.getComponents() ) { Interactor interactor = component.getInteractor(); if ( !( interactor instanceof ProteinImpl ) ) { return true; } } return false; }
public Feature createFeature(String shortLabel, CvFeatureType featureType) { Interaction interaction = createInteractionRandomBinary(); Component component = interaction.getComponents().iterator().next(); Feature feature = new Feature(getInstitution(), shortLabel, component, featureType); return feature; }
public Feature createFeature(String shortLabel, CvFeatureType featureType) { Interaction interaction = createInteractionRandomBinary(); Component component = interaction.getComponents().iterator().next(); Feature feature = new Feature(getInstitution(), shortLabel, component, featureType); return feature; }
public Feature createFeature(String shortLabel, CvFeatureType featureType) { Interaction interaction = createInteractionRandomBinary(); Component component = interaction.getComponents().iterator().next(); Feature feature = new Feature(getInstitution(), shortLabel, component, featureType); return feature; }
protected void saveOrUpdateComponents(Interaction intactObject) throws PersisterException { for (Component component : intactObject.getComponents()) { ComponentPersister.getInstance().saveOrUpdate(component); } }
protected void syncComponents(Interaction intactObject) { ComponentPersister compPersister = ComponentPersister.getInstance(); List<Component> components = new ArrayList<Component>(intactObject.getComponents().size()); for (Component component : intactObject.getComponents()) { Component c = compPersister.syncIfTransient(component); c.setInteraction(intactObject); c.setInteractor( component.getInteractor() ); components.add(c); } // for (Component c : components) { // c.setInteraction(intactObject); // } intactObject.setComponents(components); }
protected Key keyForInteraction(Interaction interaction) { final Key key = new Key(new CrcCalculator().crc64(interaction)); // pre-calculate the keys for the components here and put them in a map int n = 0; for (Component component : interaction.getComponents()) { Key compKey = new Key(key.getUniqueString() + ":" + component.getShortLabel() + "[" + n + "]"); keyCache.put(Component.class.getSimpleName() + ":" + System.identityHashCode(component), compKey); n++; } return key; }
protected Key keyForInteraction(Interaction interaction) { final Key key = new Key(new CrcCalculator().crc64(interaction)); // pre-calculate the keys for the components here and put them in a map int n = 0; for (Component component : interaction.getComponents()) { Key compKey = new Key(key.getUniqueString() + ":" + component.getShortLabel() + "[" + n + "]"); keyCache.put(Component.class.getSimpleName() + ":" + System.identityHashCode(component), compKey); n++; } return key; }
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 }
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); }